Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Peek and Build-Bot Upgrade #806

Merged
merged 22 commits into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
cb68468
Refactored peek script into a class
Thomas-Boi Aug 4, 2021
8e0c06c
Post-peek workflow now upload the new screenshots
Thomas-Boi Aug 5, 2021
53bc65e
Refactored BuildSeleniumRunner into a class
Thomas-Boi Aug 6, 2021
6e1cda1
Updated build_icons.yml to reflect new changes
Thomas-Boi Aug 6, 2021
38cf20c
Fixed issue with building icons that were already in the app
Thomas-Boi Aug 6, 2021
b052112
Build script will take screenshot of new icons
Thomas-Boi Aug 6, 2021
248e8e7
Update post peek yaml message
Thomas-Boi Aug 7, 2021
d340261
Added alerts
Thomas-Boi Aug 8, 2021
b9d66c1
Peek script now check for strokes in icons
Thomas-Boi Aug 8, 2021
03c7640
Updated post_peek's strokes in svgs message
Thomas-Boi Aug 9, 2021
1a25f6f
Updated post_peek script's message
Thomas-Boi Aug 9, 2021
c477e8d
Updated post_peek's message
Thomas-Boi Aug 9, 2021
5c6d92b
Refactored get_release_message into icomoon_build
Thomas-Boi Aug 9, 2021
8f5ab94
Change devicon.css name to devicon-base.css
Thomas-Boi Aug 9, 2021
4623f7f
Updated post_peek message
Thomas-Boi Aug 10, 2021
5c91c27
Added update icon as a valid PR title for bot-peek
Thomas-Boi Aug 10, 2021
853c86f
Add \n char to SVG after it gets optimized
Thomas-Boi Aug 10, 2021
71b84f0
Fixed error with 'update icon' regex
Thomas-Boi Aug 11, 2021
2871bb0
Build script now batch issues when upload SVG
Thomas-Boi Aug 12, 2021
e72f344
Addressed build-bot's screenshot order
Thomas-Boi Aug 12, 2021
73643f6
Apply suggestions from code review
Thomas-Boi Aug 13, 2021
9ca468b
Merge branch 'develop' into thomas/features/seleniumUpdate
Thomas-Boi Aug 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
267 changes: 0 additions & 267 deletions .github/scripts/build_assets/SeleniumRunner.py

This file was deleted.

57 changes: 29 additions & 28 deletions .github/scripts/build_assets/api_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,38 @@
import sys
import re


def get_merged_pull_reqs_since_last_release(token):
"""
Get all the merged pull requests since the last release.
"""
stopPattern = r"^(r|R)elease v"
pull_reqs = []
found_last_release = False
page = 1

print("Getting PRs since last release.")
while not found_last_release:
data = get_merged_pull_reqs(token, page)
# assume we don't encounter it during the loop
last_release_index = 101

for i in range(len(data)):
if re.search(stopPattern, data[i]["title"]):
found_last_release = True
last_release_index = i
break
pull_reqs.extend(data[:last_release_index])
page += 1

# should contain all the PRs since last release
return pull_reqs


def get_merged_pull_reqs(token, page):
"""
Get the merged pull requests based on page. There are
100 results page. See https://docs.github.com/en/rest/reference/pulls
100 results per page. See https://docs.github.com/en/rest/reference/pulls
for more details on the parameters.
:param token, a GitHub API token.
:param page, the page number.
Expand Down Expand Up @@ -71,30 +99,3 @@ def find_all_authors(pull_req_data, token):
authors.add(commit["commit"]["author"]["name"])
print(f"This URL didn't have an `author` attribute: {pull_req_data['commits_url']}")
return ", ".join(["@" + author for author in list(authors)])


def get_merged_pull_reqs_since_last_release(token):
"""
Get all the merged pull requests since the last release.
"""
stopPattern = r"^(r|R)elease v"
pull_reqs = []
found_last_release = False
page = 1

print("Getting PRs since last release.")
while not found_last_release:
data = get_merged_pull_reqs(token, page)
# assume we don't encounter it during the loop
last_release_index = 101

for i in range(len(data)):
if re.search(stopPattern, data[i]["title"]):
found_last_release = True
last_release_index = i
break
pull_reqs.extend(data[:last_release_index])
page += 1

# should contain all the PRs since last release
return pull_reqs
6 changes: 3 additions & 3 deletions .github/scripts/build_assets/filehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def get_icon_svgs_paths(folder_path: Path, icon_info: dict,
for font_version in icon_info["versions"]["font"]:
# if it's an alias, we don't want to make it into an icon
if is_alias(font_version, aliases):
print(f"Skipping this font since it's an alias: {icon_info['name']}-{font_version}.svg")
print(f"Finding SVG filepaths: skipping this font since it's an alias: {icon_info['name']}-{font_version}.svg")
continue

file_name = f"{icon_info['name']}-{font_version}.svg"
Expand Down Expand Up @@ -177,7 +177,7 @@ def rename_extracted_files(extract_path: str):
},
{
"old": Path(extract_path, "style.css"),
"new": Path(extract_path, "devicon.css")
"new": Path(extract_path, "devicon-base.css")
}
]

Expand All @@ -203,7 +203,7 @@ def create_screenshot_folder(dir, screenshot_name: str="screenshots/"):
try:
os.mkdir(screenshot_folder)
except FileExistsError:
print(f"{screenshot_folder} already exist. Script will do nothing.")
print(f"{screenshot_folder} already exist. Not creating new folder.")
finally:
return str(screenshot_folder)

Expand Down
Loading