From 84ad016d2d10c083b08308c566414f9d2413d2dd Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Sat, 24 Apr 2021 12:10:06 -0700 Subject: [PATCH 01/22] Updated README and CONTRIBUTING --- CONTRIBUTING.md | 14 +++++++------- README.md | 5 ++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2f825964a..fe0016c9e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -310,19 +310,19 @@ As an example, let's assume you have created the svgs for Redhat and Amazon Web

The Build Script: how it works and its quirks

-

To make adding icons easier for repo maintainers, we rely on GitHub Actions, Python, Selenium, and Gulp to automate our tasks.

+

We rely on GitHub Actions, Python, Selenium, Imgur, and Gulp to automate our tasks. Please feel free to take a look at the workflow files. The codes should be clear enough to follow along.

So far, the tasks in the build script are:

-

There are some quirks and bugs that the build scripts might run into. Listed below are the common ones and their solution

+

There are some quirks and bugs that the build scripts might run into. Listed below are the common ones and their solutions

  1. No connection could be made because the target machine actively refused it. (os error 10061)
      diff --git a/README.md b/README.md index c0e6bae1a..5b08278d5 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,11 @@ All product names, logos, and brands are property of their respective owners. All company, product and service names used in this website are for identification purposes only. Use of these names, logos, and brands does not - imply endorsement. + imply endorsement. Usage of these logos should be done according to the company/brand/service's brand policy. +

      + Thank you to our contributors and the IcoMoon app. Devicon would not be possible without you. +

      Getting started

      From df357335caff11815a6a23711e279aa76ac01fb5 Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Sat, 24 Apr 2021 13:33:11 -0700 Subject: [PATCH 02/22] Added check for devicon object when peeking --- .github/drafts/check_devicon_object.py | 37 ----------- .github/scripts/icomoon_peek.py | 86 +++++++++++++++++++++----- 2 files changed, 71 insertions(+), 52 deletions(-) delete mode 100644 .github/drafts/check_devicon_object.py diff --git a/.github/drafts/check_devicon_object.py b/.github/drafts/check_devicon_object.py deleted file mode 100644 index b610d88ed..000000000 --- a/.github/drafts/check_devicon_object.py +++ /dev/null @@ -1,37 +0,0 @@ -from typing import List - -# abandoned since it's not too hard to check devicon objects using our eyes -# however, still keep in case we need it in the future - -def check_devicon_objects(icons: List[dict]): - """ - Check that the devicon objects added is up to standard. - """ - err_msgs = [] - for icon in icons: - if type(icon["name"]) != str: - err_msgs.append("'name' must be a string, not: " + str(icon["name"])) - - try: - for tag in icon["tags"]: - if type(tag) != str: - raise TypeError() - except TypeError: - err_msgs.append("'tags' must be an array of strings, not: " + str(icon["tags"])) - break - - - if type(icon["versions"]["svg"]) != list or len(icon["versions"]["svg"]) == 0: - err_msgs.append("Icon name must be a string") - - if type(icon["versions"]["font"]) != list or len(icon["versions"]["svg"]) == 0: - err_msgs.append("Icon name must be a string") - - if type(icon["color"]) != str or "#" not in icon["color"]: - err_msgs.append("'color' must be a string in the format '#abcdef'") - - if type(icon["aliases"]) != list: - err_msgs.append("'aliases' must be an array of dicts") - - if len(err_msgs) > 0: - raise Exception("Error found in devicon.json: \n" + "\n".join(err_msgs)) diff --git a/.github/scripts/icomoon_peek.py b/.github/scripts/icomoon_peek.py index b4c993cb0..12a809390 100644 --- a/.github/scripts/icomoon_peek.py +++ b/.github/scripts/icomoon_peek.py @@ -2,7 +2,6 @@ import re import sys from selenium.common.exceptions import TimeoutException -import xml.etree.ElementTree as et # pycharm complains that build_assets is an unresolved ref # don't worry about it, the script still runs @@ -15,27 +14,25 @@ def main(): args = arg_getters.get_selenium_runner_args(True) new_icons = filehandler.find_new_icons(args.devicon_json_path, args.icomoon_json_path) - # get only the icon object that has the name matching the pr title - filtered_icons = find_object_added_in_this_pr(new_icons, args.pr_title) - if len(new_icons) == 0: sys.exit("No files need to be uploaded. Ending script...") - if len(filtered_icons) == 0: - message = "No icons found matching the icon name in the PR's title.\n" \ - "Ensure that a new icon entry is added in the devicon.json and the PR title matches the convention here: \n" \ + # get only the icon object that has the name matching the pr title + filtered_icon = find_object_added_in_this_pr(new_icons, args.pr_title) + + if filtered_icon == None: + message = "No proper icon found matching the icon name in the PR's title.\n" \ + "Ensure that a new icon entry is properly added in the devicon.json and the PR title matches the convention here: \n" \ "https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#overview\n" \ "Ending script...\n" sys.exit(message) - # print list of new icons - print("List of new icons:", *new_icons, sep = "\n") - print("Icons being uploaded:", *filtered_icons, sep = "\n", end='\n\n') + print("Icon being checked:", filtered_icon, sep = "\n", end='\n\n') runner = None try: runner = SeleniumRunner(args.download_path, args.geckodriver_path, args.headless) - svgs = filehandler.get_svgs_paths(filtered_icons, args.icons_folder_path, True) + svgs = filehandler.get_svgs_paths([filtered_icon], args.icons_folder_path, True) screenshot_folder = filehandler.create_screenshot_folder("./") runner.upload_svgs(svgs, screenshot_folder) print("Task completed.") @@ -52,19 +49,78 @@ def find_object_added_in_this_pr(icons: List[dict], pr_title: str): Find the icon name from the PR title. :param icons, a list of the font objects found in the devicon.json. :pr_title, the title of the PR that this workflow was called on. - :return a list containing the dictionary with the "name" + :return a dictionary with the "name" entry's value matching the name in the pr_title. - If none can be found, return an empty list. + If none can be found, return None. """ try: pattern = re.compile(r"(?<=^new icon: )\w+ (?=\(.+\))", re.I) icon_name = pattern.findall(pr_title)[0].lower().strip() # should only have one match - return [icon for icon in icons if icon["name"] == icon_name] + icon = [icon for icon in icons if icon["name"] == icon_name][0] + check_devicon_object(icon, icon_name) + return icon except IndexError: # there are no match in the findall() - return [] + return None + except ValueError as e: + print(e) + return None +def check_devicon_object(icon: dict, icon_name: str): + """ + Check that the devicon object added is up to standard. + :return a string containing the error messages if any. + """ + err_msgs = [] + try: + if type(icon["name"]) != icon_name: + err_msgs.append("'name' value is not: " + icon_name) + except KeyError: + err_msgs.append("Missing key: 'name'.") + + try: + for tag in icon["tags"]: + if type(tag) != str: + raise TypeError() + except TypeError: + err_msgs.append("'tags' must be an array of strings, not: " + str(icon["tags"])) + except KeyError: + err_msgs.append("Missing key: 'tags'.") + try: + if type(icon["versions"]) != dict: + err_msgs.append("'versions' must be an object.") + except KeyError: + err_msgs.append("Missing key: 'versions'.") + + try: + if type(icon["versions"]["svg"]) != list or len(icon["versions"]["svg"]) == 0: + err_msgs.append("Must contain at least 1 svg version in a list.") + except KeyError: + err_msgs.append("Missing key: 'svg' in 'versions'.") + + try: + if type(icon["versions"]["font"]) != list or len(icon["versions"]["svg"]) == 0: + err_msgs.append("Must contain at least 1 font version in a list.") + except KeyError: + err_msgs.append("Missing key: 'font' in 'versions'.") + + try: + if type(icon["color"]) != str or "#" not in icon["color"]: + err_msgs.append("'color' must be a string in the format '#abcdef'") + except KeyError: + err_msgs.append("Missing key: 'color'.") + + try: + if type(icon["aliases"]) != list: + err_msgs.append("'aliases' must be an array.") + except KeyError: + err_msgs.append("Missing key: 'aliases'.") + + if len(err_msgs) > 0: + message = f"Error found in 'devicon.json' for '{icon_name}' entry: \n" + "\n".join(err_msgs) + "\n" + raise ValueError(message) + return "" if __name__ == "__main__": main() From 330fcd4d1d48cbc1b4adee133a86508a6c7b4b42 Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Sat, 24 Apr 2021 14:13:59 -0700 Subject: [PATCH 03/22] Added PR template --- .github/PULL_REQUEST_TEMPLATE/new_feature.md | 9 +++++++++ .github/PULL_REQUEST_TEMPLATE/new_icon.md | 9 +++++++++ CONTRIBUTING.md | 1 - 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .github/PULL_REQUEST_TEMPLATE/new_feature.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/new_icon.md diff --git a/.github/PULL_REQUEST_TEMPLATE/new_feature.md b/.github/PULL_REQUEST_TEMPLATE/new_feature.md new file mode 100644 index 000000000..9ee604e23 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/new_feature.md @@ -0,0 +1,9 @@ +## This PR adds... + +*List your features here and their reasons for creation* + +## Notes + +*List anything note-worthy here (potential issues, this needs merge to `master` before working etc...)* + +*Don't forget to link any issues that this PR will solved.* \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE/new_icon.md b/.github/PULL_REQUEST_TEMPLATE/new_icon.md new file mode 100644 index 000000000..63eac4890 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/new_icon.md @@ -0,0 +1,9 @@ +**Double check these details before you open a PR** + +- [] PR does not match another non-stale PR currently opened +- [] PR name matches the format *new icon: Icon name (versions separated by comma)* as seen [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#overview) +- [] Your icons are put in a folder as seen [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#organizational-guidelines) +- [] SVG matches the standards laid out [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#svgStandards) +- [] A new object is added in the `devicon.json` as seen [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#-updating-the-deviconjson-) + +Refer to the [`CONTRIBUTING.md`](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#contributing-to-devicon) for more details. \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe0016c9e..e1aae465c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -91,7 +91,6 @@ First of all, thanks for taking the time to contribute! This project can only gr
    • Each .svg file contains one version of an icon in a 0 0 128 128 viewbox. You can use a service like resize-image for scaling the svg.
    • The svg element does not need the height and width attributes. However, if you do use it, ensure their values are either "128" or "128px". Ex: height="128"
    • Each .svg must use the fill attribute instead of using classes for colors. See here for more details.
    • -
    • The naming convention for the svg file is the following: (Technology name)-(original|plain|line)(-wordmark?).

    From 035cbf1ace9fdd6f3a0c8210536e0c50c55d361a Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Mon, 26 Apr 2021 00:15:40 -0700 Subject: [PATCH 04/22] Added a script to create release messages --- .github/scripts/build_assets/arg_getters.py | 11 ++ .github/scripts/get_release_message.py | 75 +++++++++++++ .github/workflows/get_release_message.yml | 11 ++ CONTRIBUTING.md | 1 + gulpfile.js | 3 +- package.json | 6 +- test.txt | 114 ++++++++++++++++++++ 7 files changed, 218 insertions(+), 3 deletions(-) create mode 100644 .github/scripts/get_release_message.py create mode 100644 .github/workflows/get_release_message.yml create mode 100644 test.txt diff --git a/.github/scripts/build_assets/arg_getters.py b/.github/scripts/build_assets/arg_getters.py index 51c5d557f..19c24c4a4 100644 --- a/.github/scripts/build_assets/arg_getters.py +++ b/.github/scripts/build_assets/arg_getters.py @@ -67,4 +67,15 @@ def get_check_svgs_monthly_args(): parser.add_argument("icons_folder_path", help="The path to the icons folder", action=PathResolverAction) + return parser.parse_args() + + +def get_release_message_args(): + """ + Get the commandline arguments for the check_svgs_monthly.py. + """ + parser = ArgumentParser(description="Create a text containing the icons and features added since last release.") + parser.add_argument("token", + help="The GitHub token to access the GitHub REST API.", + type=str) return parser.parse_args() \ No newline at end of file diff --git a/.github/scripts/get_release_message.py b/.github/scripts/get_release_message.py new file mode 100644 index 000000000..0ad041acb --- /dev/null +++ b/.github/scripts/get_release_message.py @@ -0,0 +1,75 @@ +import requests +from build_assets import arg_getters +import re + +def main(): + print("Please wait a few seconds...") + args = arg_getters.get_release_message_args() + queryPath = "https://api.github.com/repos/devicons/devicon/pulls?accept=application/vnd.github.v3+json&state=closed&per_page=100" + stopPattern = r"^(r|R)elease v" + headers = { + "Authorization": f"token {args.token}" + } + + response = requests.get(queryPath, headers=headers) + if response.status_code != 200: + print(f"Can't query the GitHub API. Status code is {response.status_code}") + return + + data = response.json() + newIcons = [] + features = [] + + for pullData in data: + if re.search(stopPattern, pullData["title"]): + break + + authors = findAllAuthors(pullData, headers) + markdown = f"- [{pullData['title']}]({pullData['html_url']}) by {authors}." + + if isFeatureIcon(pullData): + newIcons.append(markdown) + else: + features.append(markdown) + + thankYou = "A huge thanks to all our maintainers and contributors for making this release possible!" + iconTitle = "**{} New Icons**\n".format(len(newIcons)) + featureTitle = "**{} New Features**\n".format(len(features)) + finalString = "{0}\n\n {1}{2}\n\n {3}{4}".format(thankYou, + iconTitle, "\n".join(newIcons), featureTitle, "\n".join(features)) + + print("--------------Here is the build message--------------\n", finalString) + + +""" + Check whether the pullData is a feature:icon PR. + :param pullData + :return true if the pullData has a label named "feature:icon" +""" +def isFeatureIcon(pullData): + for label in pullData["labels"]: + if label["name"] == "feature:icon": + return True + return False + + +""" +Find all the authors of a PR based on its commits. +:param pullData - the data of a pull request. +""" +def findAllAuthors(pullData, authHeader): + response = requests.get(pullData["commits_url"], headers=authHeader) + if response.status_code != 200: + print(f"Can't query the GitHub API. Status code is {response.status_code}") + print("Response is: ", response.text) + return + + commits = response.json() + authors = set() # want unique authors only + for commit in commits: + authors.add("@" + commit["author"]["login"]) + return ", ".join(list(authors)) + + +if __name__ == "__main__": + main() diff --git a/.github/workflows/get_release_message.yml b/.github/workflows/get_release_message.yml new file mode 100644 index 000000000..f64dd23f8 --- /dev/null +++ b/.github/workflows/get_release_message.yml @@ -0,0 +1,11 @@ +name: Get Release Message +on: workflow_dispatch +jobs: + build: + name: Get Fonts From Icomoon + runs-on: ubuntu-18.04 + steps: + - name: Run the get_release_message.py + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: python ./.github/scripts/get_release_message.py $GITHUB_TOKEN \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e1aae465c..38636d210 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,6 +40,7 @@ First of all, thanks for taking the time to contribute! This project can only gr
  2. Include the name of the Icon in the pull request title in this format: new icon: Icon name (versions)
  3. Optional: Add images of the new svg(s) to the description of the pull request. This would help speed up the review process
  4. Optional: Reference the issues regarding the new icon.
  5. +
  6. A bot will check your SVGs. If there are any errors, please fix them as instructed.
  7. Wait for a maintainer to review your changes. They will run a script to check your icons.
  8. If there are no issues, they will accept your pull request and merge it using squash merging. If there are any problems, they will let you know and give you a chance to fix it.
diff --git a/gulpfile.js b/gulpfile.js index 1541ffc10..810d4c35a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -10,6 +10,7 @@ const aliasSCSSName = "devicon-alias.scss"; const colorsCSSName = "devicon-colors.css"; const finalMinSCSSName = "devicon.min.scss"; +//////// CSS Tasks //////// /** * Create the devicon.min.css by creating needed @@ -149,4 +150,4 @@ function cleanUp() { exports.updateCss = createDeviconMinCSS; -exports.clean = cleanUp; +exports.clean = cleanUp; \ No newline at end of file diff --git a/package.json b/package.json index dc43b4882..58fe7e825 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "scripts": { "build-css": "gulp updateCss && gulp clean", "peek-test": "python ./.github/scripts/icomoon_peek.py ./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe ./icomoon.json ./devicon.json ./icons ./ --pr_title \"%PR_TITLE%\"", - "build-test": "python ./.github/scripts/icomoon_build.py ./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe ./icomoon.json ./devicon.json ./icons ./" + "build-test": "python ./.github/scripts/icomoon_build.py ./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe ./icomoon.json ./devicon.json ./icons ./", + "release-message": "gulp getReleaseMessage" }, "repository": { "type": "git", @@ -28,5 +29,6 @@ "gulp": "^4.0.0", "gulp-sass": "^4.1.0", "sass": "^1.26.10" - } + }, + "dependencies": {} } diff --git a/test.txt b/test.txt new file mode 100644 index 000000000..61ff65ea0 --- /dev/null +++ b/test.txt @@ -0,0 +1,114 @@ + +> devicon@2.11.0 release-message C:\Users\Admin_Think541\Documents\JavaScriptProjects\devicon +> gulp getReleaseMessage + +[23:36:30] Using gulpfile ~\Documents\JavaScriptProjects\devicon\gulpfile.js +[23:36:30] Starting 'getReleaseMessage'... +Please wait a few seconds... +[23:36:30] Finished 'getReleaseMessage' after 28 ms +--------------Here is the build message-------------- + A huge thanks to all our maintainers and contributors for making this release possible! + + **32 New Icons** +- [new icon: perl (original, plain)](https://github.com/devicons/devicon/pull/569) by @Thomas-Boi, @mattkoskela, @Panquesito7. +- [new icon: nixos (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/564) by @jeovazero. +- [new icon: gitter (plain, plain-wordmark)](https://github.com/devicons/devicon/pull/556) by @maltejur, @Panquesito7. +- [new icon: rails (plain, plain-wordmark)](https://github.com/devicons/devicon/pull/554) by @maltejur, @Panquesito7. +- [new icon: phoenix (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/551) by @Panquesito7. +- [new icon: spring (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/550) by @Panquesito7. +- [new icon: lua (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/548) by @Panquesito7. +- [new icon: digitalocean (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/547) by @Panquesito7. +- [new icon: weblate (original, plain, original-wordmark, plain-wordmark)](https://github.com/devicons/devicon/pull/544) by @maltejur, @Panquesito7. +- [new icon: nextjs (original)](https://github.com/devicons/devicon/pull/541) by @maltejur, @Panquesito7. +- [New icon: dotnetcore (original)](https://github.com/devicons/devicon/pull/533) by @kirinnee, @EnisMulic, @Panquesito7. +- [new icon: figma (original, plain)](https://github.com/devicons/devicon/pull/531) by @EnisMulic, @AanchalCh, @Panquesito7. +- [new icon: jest (original, plain, line)](https://github.com/devicons/devicon/pull/527) by @wsameer, @Panquesito7. +- [new icon: dart (original, plain, original-wordmark, plain-wordmark)](https://github.com/devicons/devicon/pull/522) by @maltejur, @Panquesito7. +- [new icon: TheAlgorithms (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/521) by @Panquesito7. +- [new icon: AArch64 (original, plain)](https://github.com/devicons/devicon/pull/507) by @Panquesito7, @amacado. +- [new icon: OCaml (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/502) by @Panquesito7, @amacado. +- [new icon: Jupyter (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/501) by @Panquesito7, @amacado. +- [new icon: elixir (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/500) by @maltejur. +- [new icon: fsharp (original,plain)](https://github.com/devicons/devicon/pull/495) by @maltejur. +- [new icon: matlab (original, plain)](https://github.com/devicons/devicon/pull/492) by @amacado, @Panquesito7. +- [new icon: r (original, plain)](https://github.com/devicons/devicon/pull/491) by @jakob-r. +- [new icon: flask (original, original-wordmark)](https://github.com/devicons/devicon/pull/463) by @EnisMulic, @moghya. +- [new icon: firebase (plain, plain-wordmark)](https://github.com/devicons/devicon/pull/461) by @EnisMulic. +- [new icon: googlecloud (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/428) by @EnisMulic. +- [new icon: microsoftsqlserver (plain, plain-wordmark)](https://github.com/devicons/devicon/pull/427) by @EnisMulic. +- [new icon: sqlalchemy (original, original-wordmark, plain)](https://github.com/devicons/devicon/pull/426) by @EnisMulic. +- [new icon: objectivec (plain)](https://github.com/devicons/devicon/pull/425) by @EnisMulic. +- [new icon: kubernetes (plain, plain-wordmark)](https://github.com/devicons/devicon/pull/424) by @EnisMulic. +- [new icon: rocksdb (plain)](https://github.com/devicons/devicon/pull/423) by @EnisMulic. +- [new icon: pandas (plain, plain-wordmark, original, original-wordmark)](https://github.com/devicons/devicon/pull/422) by @EnisMulic. +- [new icon: Bash (original, plain)](https://github.com/devicons/devicon/pull/415) by @EnisMulic. + + **68 Features** +- [Added a section for common bugs in the CONTRIBUTING](https://github.com/devicons/devicon/pull/563) by @Thomas-Boi. +- [Bump ini from 1.3.5 to 1.3.8](https://github.com/devicons/devicon/pull/562) by @Thomas-Boi, @dependabot[bot], @amacado. +- [enhance guidelines for drafting a new release](https://github.com/devicons/devicon/pull/561) by @amacado. +- [Release v2.11.0](https://github.com/devicons/devicon/pull/560) by @amacado, @Thomas-Boi, @Panquesito7, @maltejur, @EnisMulic, @dependabot[bot]. +- [Build preparation for Release v2.11.0](https://github.com/devicons/devicon/pull/559) by @Thomas-Boi. +- [bot:build new icons, icomoon.json and devicon.css](https://github.com/devicons/devicon/pull/558) by @Thomas-Boi. +- [Fix link reference in `.github/scripts/icomoon_peek.py`](https://github.com/devicons/devicon/pull/557) by @Panquesito7. +- [add paragraph about release strategy](https://github.com/devicons/devicon/pull/555) by @amacado. +- [Update `package.json` for the new release](https://github.com/devicons/devicon/pull/553) by @Panquesito7. +- [The table of contents was removed.](https://github.com/devicons/devicon/pull/552) by @NaveedAhmadHematmal. +- [Bump y18n from 3.2.1 to 3.2.2](https://github.com/devicons/devicon/pull/545) by @dependabot[bot], @Panquesito7. +- [Updated the svg checker so it doesn't post confirmation messages and updated CONTRIBUTING.md](https://github.com/devicons/devicon/pull/542) by @Thomas-Boi, @amacado. +- [Add Discord invitation on the website, `README.md`, and `CONTRIBUTING.md`](https://github.com/devicons/devicon/pull/538) by @Panquesito7. +- [New icon: graphql (plain, plain-wordmark)](https://github.com/devicons/devicon/pull/530) by @EnisMulic, @amacado. +- [fix: Alerts reported by Dependabot](https://github.com/devicons/devicon/pull/528) by @Panquesito7. +- [feat: Setup Stale workflow](https://github.com/devicons/devicon/pull/524) by @Panquesito7. +- [feat: Add labeler workflow](https://github.com/devicons/devicon/pull/523) by @Panquesito7. +- [Fix issue with "post_peek_screenshot" action failing when it's not supposed to](https://github.com/devicons/devicon/pull/520) by @Thomas-Boi, @Panquesito7. +- [fix: Merge branch `master` into `develop`](https://github.com/devicons/devicon/pull/519) by @amacado. +- [Release v2.10.1](https://github.com/devicons/devicon/pull/518) by @amacado, @Thomas-Boi. +- [introducing teams and guidelines for supporters](https://github.com/devicons/devicon/pull/516) by @amacado. +- [Fix the issue with "Post Check SVG" posting the wrong message](https://github.com/devicons/devicon/pull/515) by @Thomas-Boi. +- [add environment for npm publish workflow](https://github.com/devicons/devicon/pull/513) by @amacado. +- [bot:build new icons, icomoon.json and devicon.css](https://github.com/devicons/devicon/pull/512) by @amacado. +- [Remove \n from script](https://github.com/devicons/devicon/pull/511) by @Thomas-Boi. +- [Updated the logging of the actions](https://github.com/devicons/devicon/pull/509) by @Thomas-Boi, @amacado. +- [fix check svg icons workflow](https://github.com/devicons/devicon/pull/508) by @amacado. +- [fix bug regarding workflow check](https://github.com/devicons/devicon/pull/506) by @amacado. +- [Release v2.10.0](https://github.com/devicons/devicon/pull/504) by @tylensthilaire, @EnisMulic, @Thomas-Boi, @Th1nkK1D. +- [merge master < develop](https://github.com/devicons/devicon/pull/503) by @amacado. +- [new icon: ocaml (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/499) by @Panquesito7. +- [new icon: Jupyter (original, plain)](https://github.com/devicons/devicon/pull/498) by @amacado, @Panquesito7. +- [automate workflow for npm publish](https://github.com/devicons/devicon/pull/497) by @amacado. +- [redesign readme.md](https://github.com/devicons/devicon/pull/496) by @amacado. +- [new icon: R (original)](https://github.com/devicons/devicon/pull/493) by @Panquesito7. +- [Removed 'default fall back icon' from build_icons.yml](https://github.com/devicons/devicon/pull/487) by @Thomas-Boi. +- [bot:build new icons, icomoon.json and devicon.css](https://github.com/devicons/devicon/pull/486) by @amacado. +- [Release 2.9.0](https://github.com/devicons/devicon/pull/485) by @tylensthilaire, @EnisMulic, @Thomas-Boi, @Th1nkK1D. +- [Added working workflows that has commenting on forked repo's PR.](https://github.com/devicons/devicon/pull/481) by @Thomas-Boi. +- [Add guideline about squash merging](https://github.com/devicons/devicon/pull/480) by @amacado. +- [Check svg upgrades](https://github.com/devicons/devicon/pull/479) by @Thomas-Boi. +- [new icon: testingicon (original, plain) [TESTING DO NOT MERGE]](https://github.com/devicons/devicon/pull/477) by @Thomas-Boi. +- [new icon: testingicon (original, plain) [TESTING DO NOT MERGE]](https://github.com/devicons/devicon/pull/476) by @Thomas-Boi. +- [Check whether the new check_svgs scripts work [TEST DO NOT MERGE]](https://github.com/devicons/devicon/pull/475) by @Thomas-Boi. +- [new icon: testingicon (original, plain) [TESTING DO NOT MERGE]](https://github.com/devicons/devicon/pull/474) by @Thomas-Boi. +- [new icon: testingicon (original, plain) [TESTING DO NOT MERGE]](https://github.com/devicons/devicon/pull/473) by @Thomas-Boi. +- [Fix the ref issue of the checkout action and sqlalchemy ](https://github.com/devicons/devicon/pull/472) by @Thomas-Boi. +- [Added a script that will create a default icon fall back for all devicon classes](https://github.com/devicons/devicon/pull/469) by @Thomas-Boi. +- [Fixed an error with devicon.json](https://github.com/devicons/devicon/pull/468) by @Thomas-Boi. +- [new icon: uwsgi (original, plain)](https://github.com/devicons/devicon/pull/462) by @EnisMulic. +- [Added check script for the icons and fix icons with fill or viewBox issues](https://github.com/devicons/devicon/pull/460) by @Thomas-Boi. +- [Release v2.8.2](https://github.com/devicons/devicon/pull/457) by @amacado, @Thomas-Boi, @EnisMulic. +- [fix displaying svg code in devicon.dev](https://github.com/devicons/devicon/pull/455) by @amacado. +- [Change the peek workflow to use upload artifacts](https://github.com/devicons/devicon/pull/454) by @Thomas-Boi. +- [Release v2.8.1](https://github.com/devicons/devicon/pull/453) by @amacado, @EnisMulic. +- [new icon: testingicon (original, plain) [DO NOT MERGE]](https://github.com/devicons/devicon/pull/452) by @Thomas-Boi. +- [fix icon: bash (plain)](https://github.com/devicons/devicon/pull/451) by @EnisMulic. +- [fix icon: bash (plain), remove extra content](https://github.com/devicons/devicon/pull/450) by @EnisMulic. +- [new icon: testingicon (original, plain) [DO NOT MERGE] testing workflow from fork](https://github.com/devicons/devicon/pull/446) by @Thomas-Boi, @amacado. +- [new icon: testingicon (original, plain) [DO NOT MERGE] Testing Workflow: Amacado/feature/test bot peek](https://github.com/devicons/devicon/pull/445) by @Thomas-Boi, @amacado. +- [merge master back into development (after build)](https://github.com/devicons/devicon/pull/443) by @amacado. +- [bot:build new icons, icomoon.json and devicon.css](https://github.com/devicons/devicon/pull/442) by @amacado. +- [fix typo in github workflow](https://github.com/devicons/devicon/pull/441) by @amacado. +- [fix typo in imgur output](https://github.com/devicons/devicon/pull/440) by @amacado. +- [new icon: testingicon (original, plain) - TEST - DO NOT MERGE ](https://github.com/devicons/devicon/pull/421) by @dependabot[bot], @Thomas-Boi, @amacado, @rawdanowiczdev, @EnisMulic. +- [new icon: testingicon (original, plain) - TEST - DO NOT MERGE](https://github.com/devicons/devicon/pull/420) by @dependabot[bot], @Thomas-Boi, @amacado, @rawdanowiczdev, @EnisMulic. +- [new icon: testingicon (original, plain) - TEST](https://github.com/devicons/devicon/pull/419) by @dependabot[bot], @Thomas-Boi. +- [Updated CONTRIBUTING](https://github.com/devicons/devicon/pull/416) by @Thomas-Boi. From 2e9c01f64e4b7259ca792ae95ec71fb9824a86e2 Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Mon, 26 Apr 2021 00:25:39 -0700 Subject: [PATCH 05/22] Updated CONTRIBUTING about new script --- CONTRIBUTING.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 38636d210..726fee1dc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -379,7 +379,19 @@ We are running a Discord server. You can go here to talk, discuss, and more with
  • Push the branch draft-release
  • Manually trigger the workflow build_icons.yml (which has a workflow_dispatch event trigger) and select the branch draft-release as target branch. This will build a font version of all icons using icomoon and automatically creates a pull request to merge the build result back into draft-release
  • Review and approve the auto-create pull request created by the action of the step above
  • -
  • Create a pull request towards development. Mention the release number in the pull request title (like "Build preparation for release vMAJOR.MINOR.PATCH) and add information about all new icons, fixes, features and enhancements in the description of the pull request. Take the commits as a guideline. It's also a good idea to mention and thank all contributions who participated in the release (take description of #504 as an example).
  • +
  • Create a pull request towards development. Mention the release number in the pull request title (like "Build preparation for release vMAJOR.MINOR.PATCH). +
      +
    • + Add information about all new icons, fixes, features and enhancements in the description of the pull request. +
    • +
    • + Take the PRs/commits as a guideline. It's also a good idea to mention and thank all contributions who participated in the release (take description of #504 as an example). +
    • +
    • + Rather than doing it manually, you can instead run python ./.github/scripts/get_release_message.py $GITHUB_TOKEN locally. Pass in your GitHub Personal Access Token for $GITHUB_TOKEN and you should see the messages. Next release, you can trigger this script in the GitHub Actions tab. +
    • +
    +
  • Wait for review and approval of the pull request (you can perform a squash-merge)
  • Once merged create a pull request with BASE master and HEAD development. Copy the description of the earlier pull request.
  • Since it was already approved in the 'development' stage a maintainer is allowed to merge it (DON'T perform a squash-merge).
  • From f8d931d933bb2fa6c1741a2f0d3f330b33c78154 Mon Sep 17 00:00:00 2001 From: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com> Date: Mon, 26 Apr 2021 15:22:14 -0700 Subject: [PATCH 06/22] Update .github/PULL_REQUEST_TEMPLATE/new_icon.md Co-authored-by: David Leal --- .github/PULL_REQUEST_TEMPLATE/new_icon.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/new_icon.md b/.github/PULL_REQUEST_TEMPLATE/new_icon.md index 63eac4890..cffee5f2a 100644 --- a/.github/PULL_REQUEST_TEMPLATE/new_icon.md +++ b/.github/PULL_REQUEST_TEMPLATE/new_icon.md @@ -4,6 +4,6 @@ - [] PR name matches the format *new icon: Icon name (versions separated by comma)* as seen [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#overview) - [] Your icons are put in a folder as seen [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#organizational-guidelines) - [] SVG matches the standards laid out [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#svgStandards) -- [] A new object is added in the `devicon.json` as seen [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#-updating-the-deviconjson-) +- [] A new object is added in the `devicon.json` file as seen [here](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#-updating-the-deviconjson-) -Refer to the [`CONTRIBUTING.md`](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#contributing-to-devicon) for more details. \ No newline at end of file +Refer to the [`CONTRIBUTING.md`](https://github.com/devicons/devicon/blob/develop/CONTRIBUTING.md#contributing-to-devicon) for more details. From 086fa4a1ce5f414a8918074b4657e870c45d0b1c Mon Sep 17 00:00:00 2001 From: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com> Date: Mon, 26 Apr 2021 15:22:20 -0700 Subject: [PATCH 07/22] Update .github/scripts/build_assets/arg_getters.py Co-authored-by: David Leal --- .github/scripts/build_assets/arg_getters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/build_assets/arg_getters.py b/.github/scripts/build_assets/arg_getters.py index 19c24c4a4..a54d3d722 100644 --- a/.github/scripts/build_assets/arg_getters.py +++ b/.github/scripts/build_assets/arg_getters.py @@ -78,4 +78,4 @@ def get_release_message_args(): parser.add_argument("token", help="The GitHub token to access the GitHub REST API.", type=str) - return parser.parse_args() \ No newline at end of file + return parser.parse_args() From 056fc89588c929fbe684ffeabb59b360be8fba0d Mon Sep 17 00:00:00 2001 From: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com> Date: Mon, 26 Apr 2021 15:23:50 -0700 Subject: [PATCH 08/22] Update .github/workflows/get_release_message.yml Co-authored-by: David Leal --- .github/workflows/get_release_message.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/get_release_message.yml b/.github/workflows/get_release_message.yml index f64dd23f8..04c87329a 100644 --- a/.github/workflows/get_release_message.yml +++ b/.github/workflows/get_release_message.yml @@ -8,4 +8,4 @@ jobs: - name: Run the get_release_message.py env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: python ./.github/scripts/get_release_message.py $GITHUB_TOKEN \ No newline at end of file + run: python ./.github/scripts/get_release_message.py $GITHUB_TOKEN From 738e69b4cdce61acec460c2b274b8d507322954d Mon Sep 17 00:00:00 2001 From: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com> Date: Mon, 26 Apr 2021 15:23:56 -0700 Subject: [PATCH 09/22] Update gulpfile.js Co-authored-by: David Leal --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 810d4c35a..24e29721e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -150,4 +150,4 @@ function cleanUp() { exports.updateCss = createDeviconMinCSS; -exports.clean = cleanUp; \ No newline at end of file +exports.clean = cleanUp; From 6c029ea9d0441afd5b9fc746f0c4ab08de742834 Mon Sep 17 00:00:00 2001 From: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com> Date: Mon, 26 Apr 2021 16:01:43 -0700 Subject: [PATCH 10/22] Update .github/PULL_REQUEST_TEMPLATE/new_feature.md Co-authored-by: David Leal --- .github/PULL_REQUEST_TEMPLATE/new_feature.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/new_feature.md b/.github/PULL_REQUEST_TEMPLATE/new_feature.md index 9ee604e23..f9e6a3719 100644 --- a/.github/PULL_REQUEST_TEMPLATE/new_feature.md +++ b/.github/PULL_REQUEST_TEMPLATE/new_feature.md @@ -1,9 +1,9 @@ ## This PR adds... -*List your features here and their reasons for creation* +*List your features here and their reasons for creation.* ## Notes *List anything note-worthy here (potential issues, this needs merge to `master` before working etc...)* -*Don't forget to link any issues that this PR will solved.* \ No newline at end of file +*Don't forget to link any issues that this PR will solved.* From a07cb17ca85652b17256a2b84bf10ab3d33d0eab Mon Sep 17 00:00:00 2001 From: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com> Date: Mon, 26 Apr 2021 16:01:55 -0700 Subject: [PATCH 11/22] Update .github/PULL_REQUEST_TEMPLATE/new_feature.md Co-authored-by: David Leal --- .github/PULL_REQUEST_TEMPLATE/new_feature.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/new_feature.md b/.github/PULL_REQUEST_TEMPLATE/new_feature.md index f9e6a3719..48f92dd98 100644 --- a/.github/PULL_REQUEST_TEMPLATE/new_feature.md +++ b/.github/PULL_REQUEST_TEMPLATE/new_feature.md @@ -4,6 +4,6 @@ ## Notes -*List anything note-worthy here (potential issues, this needs merge to `master` before working etc...)* +*List anything note-worthy here (potential issues, this needs merge to `master` before working etc....)* *Don't forget to link any issues that this PR will solved.* From a56350613d190fa6e83e39400594dbe5e388c480 Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Mon, 26 Apr 2021 16:12:18 -0700 Subject: [PATCH 12/22] Added a way for peek bot to comment error --- .github/scripts/icomoon_peek.py | 42 +++++++++++----------- .github/workflows/peek_icons.yml | 7 ++++ .github/workflows/post_peek_screenshot.yml | 20 ++++++++--- 3 files changed, 45 insertions(+), 24 deletions(-) diff --git a/.github/scripts/icomoon_peek.py b/.github/scripts/icomoon_peek.py index 12a809390..100fe0551 100644 --- a/.github/scripts/icomoon_peek.py +++ b/.github/scripts/icomoon_peek.py @@ -11,44 +11,45 @@ def main(): - args = arg_getters.get_selenium_runner_args(True) - new_icons = filehandler.find_new_icons(args.devicon_json_path, args.icomoon_json_path) + runner = None + try: + args = arg_getters.get_selenium_runner_args(True) + new_icons = filehandler.find_new_icons(args.devicon_json_path, args.icomoon_json_path) - if len(new_icons) == 0: - sys.exit("No files need to be uploaded. Ending script...") + if len(new_icons) == 0: + raise Exception("No files need to be uploaded. Ending script...") - # get only the icon object that has the name matching the pr title - filtered_icon = find_object_added_in_this_pr(new_icons, args.pr_title) + # get only the icon object that has the name matching the pr title + err_messages = [] + filtered_icon = find_object_added_in_this_pr(new_icons, args.pr_title, err_messages) - if filtered_icon == None: - message = "No proper icon found matching the icon name in the PR's title.\n" \ - "Ensure that a new icon entry is properly added in the devicon.json and the PR title matches the convention here: \n" \ - "https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#overview\n" \ - "Ending script...\n" - sys.exit(message) + if filtered_icon is None: + # should have 1 error message if filtered_icon is None + raise Exception(err_messages[0]) - print("Icon being checked:", filtered_icon, sep = "\n", end='\n\n') + print("Icon being checked:", filtered_icon, sep = "\n", end='\n\n') - runner = None - try: runner = SeleniumRunner(args.download_path, args.geckodriver_path, args.headless) svgs = filehandler.get_svgs_paths([filtered_icon], args.icons_folder_path, True) screenshot_folder = filehandler.create_screenshot_folder("./") runner.upload_svgs(svgs, screenshot_folder) print("Task completed.") - except TimeoutException as e: - util.exit_with_err("Selenium Time Out Error: \n" + str(e)) + + # no errors, do this so upload-artifact won't fail + filehandler.write_to_file("./err_messages.txt", "0") except Exception as e: + filehandler.write_to_file("./err_messages.txt", str(e)) util.exit_with_err(e) finally: runner.close() -def find_object_added_in_this_pr(icons: List[dict], pr_title: str): +def find_object_added_in_this_pr(icons: List[dict], pr_title: str, err_messages: List[str]): """ Find the icon name from the PR title. :param icons, a list of the font objects found in the devicon.json. :pr_title, the title of the PR that this workflow was called on. + :param err_messages, the error messages that will be displayed :return a dictionary with the "name" entry's value matching the name in the pr_title. If none can be found, return None. @@ -60,9 +61,10 @@ def find_object_added_in_this_pr(icons: List[dict], pr_title: str): check_devicon_object(icon, icon_name) return icon except IndexError: # there are no match in the findall() + err_messages.append("Couldn't find an icon matching the name in the PR title.") return None except ValueError as e: - print(e) + err_messages.append(str(e)) return None @@ -118,7 +120,7 @@ def check_devicon_object(icon: dict, icon_name: str): err_msgs.append("Missing key: 'aliases'.") if len(err_msgs) > 0: - message = f"Error found in 'devicon.json' for '{icon_name}' entry: \n" + "\n".join(err_msgs) + "\n" + message = "Error found in 'devicon.json' for '{}' entry: \n{}\n".format(icon_name, "\n".join(err_msgs)) raise ValueError(message) return "" diff --git a/.github/workflows/peek_icons.yml b/.github/workflows/peek_icons.yml index 20f3455f1..b39a5292f 100644 --- a/.github/workflows/peek_icons.yml +++ b/.github/workflows/peek_icons.yml @@ -44,6 +44,13 @@ jobs: ./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe ./icomoon.json ./devicon.json ./icons ./ --headless --pr_title "%PR_TITLE%" + - name: Upload the err messages (created by icomoon_peek.py) + uses: actions/upload-artifact@v2 + if: success() + with: + name: err_messages + path: ./err_messages.txt + - name: Upload screenshots for comments uses: actions/upload-artifact@v2 if: success() diff --git a/.github/workflows/post_peek_screenshot.yml b/.github/workflows/post_peek_screenshot.yml index 15ae7ea71..59b55e4a4 100644 --- a/.github/workflows/post_peek_screenshot.yml +++ b/.github/workflows/post_peek_screenshot.yml @@ -32,6 +32,14 @@ jobs: with: path: ./pr_num/pr_num.txt + - name: Read the err message file + if: success() + id: err_message_reader + uses: juliangruber/read-file-action@v1.0.0 + with: + path: ./err_messages/err_messages.txt + + - name: Upload screenshot of the newly made icons gotten from the artifacts id: icons_overview_img_step if: env.PEEK_STATUS == 'success' && success() @@ -87,15 +95,19 @@ jobs: MESSAGE: | Hi there, - I'm Devicons' Peek Bot and it seems we've ran into a problem (sorry!). + I'm Devicons' Peek Bot and it seems we've ran into a problem. + + ``` + {0} + ``` - Please double check and fix the possible issues below: + Make sure that: - Your svgs are named and added correctly to the /icons folder as seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#orgGuidelines). - Your icon information has been added to the `devicon.json` as seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#updateDevicon) - Your PR title follows the format seen [here](https://github.com/devicons/devicon/blob/master/CONTRIBUTING.md#overview) - I will retry once everything is fixed. If I still fail (sorry!) or there are other erros, the maintainers will investigate. + I will retry once everything is fixed. If I still fail or there are other error, the maintainers will investigate. Best of luck, Peek Bot :relaxed: @@ -103,4 +115,4 @@ jobs: type: create issue_number: ${{ steps.pr_num_reader.outputs.content }} token: ${{ secrets.GITHUB_TOKEN }} - body: ${{ env.MESSAGE }} + body: ${{ format(env.MESSAGE, steps.err_message_reader.outputs.content) }} From e62292314152d4d74a504f13de64d0aa8f41ae1a Mon Sep 17 00:00:00 2001 From: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com> Date: Tue, 27 Apr 2021 09:50:05 -0700 Subject: [PATCH 13/22] Update CONTRIBUTING.md Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com> --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 726fee1dc..bfddff414 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -388,7 +388,7 @@ We are running a Discord server. You can go here to talk, discuss, and more with Take the PRs/commits as a guideline. It's also a good idea to mention and thank all contributions who participated in the release (take description of #504 as an example).
  • - Rather than doing it manually, you can instead run python ./.github/scripts/get_release_message.py $GITHUB_TOKEN locally. Pass in your GitHub Personal Access Token for $GITHUB_TOKEN and you should see the messages. Next release, you can trigger this script in the GitHub Actions tab. + Rather than doing it manually, you can instead run python ./.github/scripts/get_release_message.py $GITHUB_TOKEN locally. Pass in your GitHub Personal Access Token for $GITHUB_TOKEN and you should see the messages. You can also use the `workflow_dispatch` trigger in the GitHub Actions tab.
  • From 1905ac9b20a217be2554599a1b775ea04ead2acc Mon Sep 17 00:00:00 2001 From: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com> Date: Tue, 27 Apr 2021 09:50:38 -0700 Subject: [PATCH 14/22] Update .github/scripts/get_release_message.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Malte Jürgens --- .github/scripts/get_release_message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/get_release_message.py b/.github/scripts/get_release_message.py index 0ad041acb..b17b457d0 100644 --- a/.github/scripts/get_release_message.py +++ b/.github/scripts/get_release_message.py @@ -12,7 +12,7 @@ def main(): } response = requests.get(queryPath, headers=headers) - if response.status_code != 200: + if not response: print(f"Can't query the GitHub API. Status code is {response.status_code}") return From a3980688a70546a4b81069b9a8780a6938df6a95 Mon Sep 17 00:00:00 2001 From: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com> Date: Tue, 27 Apr 2021 09:53:08 -0700 Subject: [PATCH 15/22] Update .github/scripts/get_release_message.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Malte Jürgens --- .github/scripts/get_release_message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/get_release_message.py b/.github/scripts/get_release_message.py index b17b457d0..6a9af77f9 100644 --- a/.github/scripts/get_release_message.py +++ b/.github/scripts/get_release_message.py @@ -59,7 +59,7 @@ def isFeatureIcon(pullData): """ def findAllAuthors(pullData, authHeader): response = requests.get(pullData["commits_url"], headers=authHeader) - if response.status_code != 200: + if not response: print(f"Can't query the GitHub API. Status code is {response.status_code}") print("Response is: ", response.text) return From 2a3ee3a517fab995bb87027f7ef76f28e3bf9779 Mon Sep 17 00:00:00 2001 From: Thomas Bui <43018778+Thomas-Boi@users.noreply.github.com> Date: Tue, 27 Apr 2021 16:51:36 -0700 Subject: [PATCH 16/22] Update .github/PULL_REQUEST_TEMPLATE/new_feature.md Co-authored-by: David Leal --- .github/PULL_REQUEST_TEMPLATE/new_feature.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/new_feature.md b/.github/PULL_REQUEST_TEMPLATE/new_feature.md index 48f92dd98..2c605d599 100644 --- a/.github/PULL_REQUEST_TEMPLATE/new_feature.md +++ b/.github/PULL_REQUEST_TEMPLATE/new_feature.md @@ -4,6 +4,6 @@ ## Notes -*List anything note-worthy here (potential issues, this needs merge to `master` before working etc....)* +*List anything note-worthy here (potential issues, this needs merge to `master` before working, etc....).* *Don't forget to link any issues that this PR will solved.* From fb3fc678cc55863241c1198ed63c0f0a79a03eda Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Tue, 27 Apr 2021 17:10:37 -0700 Subject: [PATCH 17/22] Clean up and updated CONTRIBUTING --- .github/scripts/build_assets/arg_getters.py | 2 +- .github/scripts/get_release_message.py | 2 +- CONTRIBUTING.md | 10 +- package.json | 1 - test.txt | 114 -------------------- 5 files changed, 11 insertions(+), 118 deletions(-) delete mode 100644 test.txt diff --git a/.github/scripts/build_assets/arg_getters.py b/.github/scripts/build_assets/arg_getters.py index a54d3d722..ebe37ea7d 100644 --- a/.github/scripts/build_assets/arg_getters.py +++ b/.github/scripts/build_assets/arg_getters.py @@ -72,7 +72,7 @@ def get_check_svgs_monthly_args(): def get_release_message_args(): """ - Get the commandline arguments for the check_svgs_monthly.py. + Get the commandline arguments for get_release_message.py. """ parser = ArgumentParser(description="Create a text containing the icons and features added since last release.") parser.add_argument("token", diff --git a/.github/scripts/get_release_message.py b/.github/scripts/get_release_message.py index 6a9af77f9..af8b6b78c 100644 --- a/.github/scripts/get_release_message.py +++ b/.github/scripts/get_release_message.py @@ -13,7 +13,7 @@ def main(): response = requests.get(queryPath, headers=headers) if not response: - print(f"Can't query the GitHub API. Status code is {response.status_code}") + print(f"Can't query the GitHub API. Status code is {response.status_code}. Message is {response.text}") return data = response.json() diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bfddff414..676f6b423 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -320,9 +320,10 @@ As an example, let's assume you have created the svgs for Redhat and Amazon Web
  • Ensure code quality is up to standard
  • Comment on the PR so maintainers don't have to manually upload icon result. Used by peek-bot and build-bot.
  • Publishing a new release to npm; See #288
  • +
  • Creating a list of features that was added since last release. Note that this is limited to the last 100 PRs for now.
  • -

    There are some quirks and bugs that the build scripts might run into. Listed below are the common ones and their solutions

    +

    There are some bugs that the build scripts might run into. Listed below are the common ones and their solutions

    1. No connection could be made because the target machine actively refused it. (os error 10061)
        @@ -351,6 +352,13 @@ As an example, let's assume you have created the svgs for Redhat and Amazon Web
      • Solution: Follow the steps laid out here
    2. +
    3. Icon created by Icomoon contains strange lines that aren't in the SVG +
        +
      • See this PR's peek result.
      • +
      • This is caused by a bug in Icomoon's parser (see this).
      • +
      • Solution: Luckily this is an extremely rare case. Try remake the svg in a different way (using different paths/shapes) and test using Icomoon.
      • +
      +

    Discord server

    diff --git a/package.json b/package.json index 58fe7e825..c8e473637 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "build-css": "gulp updateCss && gulp clean", "peek-test": "python ./.github/scripts/icomoon_peek.py ./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe ./icomoon.json ./devicon.json ./icons ./ --pr_title \"%PR_TITLE%\"", "build-test": "python ./.github/scripts/icomoon_build.py ./.github/scripts/build_assets/geckodriver-v0.27.0-win64/geckodriver.exe ./icomoon.json ./devicon.json ./icons ./", - "release-message": "gulp getReleaseMessage" }, "repository": { "type": "git", diff --git a/test.txt b/test.txt deleted file mode 100644 index 61ff65ea0..000000000 --- a/test.txt +++ /dev/null @@ -1,114 +0,0 @@ - -> devicon@2.11.0 release-message C:\Users\Admin_Think541\Documents\JavaScriptProjects\devicon -> gulp getReleaseMessage - -[23:36:30] Using gulpfile ~\Documents\JavaScriptProjects\devicon\gulpfile.js -[23:36:30] Starting 'getReleaseMessage'... -Please wait a few seconds... -[23:36:30] Finished 'getReleaseMessage' after 28 ms ---------------Here is the build message-------------- - A huge thanks to all our maintainers and contributors for making this release possible! - - **32 New Icons** -- [new icon: perl (original, plain)](https://github.com/devicons/devicon/pull/569) by @Thomas-Boi, @mattkoskela, @Panquesito7. -- [new icon: nixos (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/564) by @jeovazero. -- [new icon: gitter (plain, plain-wordmark)](https://github.com/devicons/devicon/pull/556) by @maltejur, @Panquesito7. -- [new icon: rails (plain, plain-wordmark)](https://github.com/devicons/devicon/pull/554) by @maltejur, @Panquesito7. -- [new icon: phoenix (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/551) by @Panquesito7. -- [new icon: spring (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/550) by @Panquesito7. -- [new icon: lua (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/548) by @Panquesito7. -- [new icon: digitalocean (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/547) by @Panquesito7. -- [new icon: weblate (original, plain, original-wordmark, plain-wordmark)](https://github.com/devicons/devicon/pull/544) by @maltejur, @Panquesito7. -- [new icon: nextjs (original)](https://github.com/devicons/devicon/pull/541) by @maltejur, @Panquesito7. -- [New icon: dotnetcore (original)](https://github.com/devicons/devicon/pull/533) by @kirinnee, @EnisMulic, @Panquesito7. -- [new icon: figma (original, plain)](https://github.com/devicons/devicon/pull/531) by @EnisMulic, @AanchalCh, @Panquesito7. -- [new icon: jest (original, plain, line)](https://github.com/devicons/devicon/pull/527) by @wsameer, @Panquesito7. -- [new icon: dart (original, plain, original-wordmark, plain-wordmark)](https://github.com/devicons/devicon/pull/522) by @maltejur, @Panquesito7. -- [new icon: TheAlgorithms (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/521) by @Panquesito7. -- [new icon: AArch64 (original, plain)](https://github.com/devicons/devicon/pull/507) by @Panquesito7, @amacado. -- [new icon: OCaml (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/502) by @Panquesito7, @amacado. -- [new icon: Jupyter (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/501) by @Panquesito7, @amacado. -- [new icon: elixir (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/500) by @maltejur. -- [new icon: fsharp (original,plain)](https://github.com/devicons/devicon/pull/495) by @maltejur. -- [new icon: matlab (original, plain)](https://github.com/devicons/devicon/pull/492) by @amacado, @Panquesito7. -- [new icon: r (original, plain)](https://github.com/devicons/devicon/pull/491) by @jakob-r. -- [new icon: flask (original, original-wordmark)](https://github.com/devicons/devicon/pull/463) by @EnisMulic, @moghya. -- [new icon: firebase (plain, plain-wordmark)](https://github.com/devicons/devicon/pull/461) by @EnisMulic. -- [new icon: googlecloud (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/428) by @EnisMulic. -- [new icon: microsoftsqlserver (plain, plain-wordmark)](https://github.com/devicons/devicon/pull/427) by @EnisMulic. -- [new icon: sqlalchemy (original, original-wordmark, plain)](https://github.com/devicons/devicon/pull/426) by @EnisMulic. -- [new icon: objectivec (plain)](https://github.com/devicons/devicon/pull/425) by @EnisMulic. -- [new icon: kubernetes (plain, plain-wordmark)](https://github.com/devicons/devicon/pull/424) by @EnisMulic. -- [new icon: rocksdb (plain)](https://github.com/devicons/devicon/pull/423) by @EnisMulic. -- [new icon: pandas (plain, plain-wordmark, original, original-wordmark)](https://github.com/devicons/devicon/pull/422) by @EnisMulic. -- [new icon: Bash (original, plain)](https://github.com/devicons/devicon/pull/415) by @EnisMulic. - - **68 Features** -- [Added a section for common bugs in the CONTRIBUTING](https://github.com/devicons/devicon/pull/563) by @Thomas-Boi. -- [Bump ini from 1.3.5 to 1.3.8](https://github.com/devicons/devicon/pull/562) by @Thomas-Boi, @dependabot[bot], @amacado. -- [enhance guidelines for drafting a new release](https://github.com/devicons/devicon/pull/561) by @amacado. -- [Release v2.11.0](https://github.com/devicons/devicon/pull/560) by @amacado, @Thomas-Boi, @Panquesito7, @maltejur, @EnisMulic, @dependabot[bot]. -- [Build preparation for Release v2.11.0](https://github.com/devicons/devicon/pull/559) by @Thomas-Boi. -- [bot:build new icons, icomoon.json and devicon.css](https://github.com/devicons/devicon/pull/558) by @Thomas-Boi. -- [Fix link reference in `.github/scripts/icomoon_peek.py`](https://github.com/devicons/devicon/pull/557) by @Panquesito7. -- [add paragraph about release strategy](https://github.com/devicons/devicon/pull/555) by @amacado. -- [Update `package.json` for the new release](https://github.com/devicons/devicon/pull/553) by @Panquesito7. -- [The table of contents was removed.](https://github.com/devicons/devicon/pull/552) by @NaveedAhmadHematmal. -- [Bump y18n from 3.2.1 to 3.2.2](https://github.com/devicons/devicon/pull/545) by @dependabot[bot], @Panquesito7. -- [Updated the svg checker so it doesn't post confirmation messages and updated CONTRIBUTING.md](https://github.com/devicons/devicon/pull/542) by @Thomas-Boi, @amacado. -- [Add Discord invitation on the website, `README.md`, and `CONTRIBUTING.md`](https://github.com/devicons/devicon/pull/538) by @Panquesito7. -- [New icon: graphql (plain, plain-wordmark)](https://github.com/devicons/devicon/pull/530) by @EnisMulic, @amacado. -- [fix: Alerts reported by Dependabot](https://github.com/devicons/devicon/pull/528) by @Panquesito7. -- [feat: Setup Stale workflow](https://github.com/devicons/devicon/pull/524) by @Panquesito7. -- [feat: Add labeler workflow](https://github.com/devicons/devicon/pull/523) by @Panquesito7. -- [Fix issue with "post_peek_screenshot" action failing when it's not supposed to](https://github.com/devicons/devicon/pull/520) by @Thomas-Boi, @Panquesito7. -- [fix: Merge branch `master` into `develop`](https://github.com/devicons/devicon/pull/519) by @amacado. -- [Release v2.10.1](https://github.com/devicons/devicon/pull/518) by @amacado, @Thomas-Boi. -- [introducing teams and guidelines for supporters](https://github.com/devicons/devicon/pull/516) by @amacado. -- [Fix the issue with "Post Check SVG" posting the wrong message](https://github.com/devicons/devicon/pull/515) by @Thomas-Boi. -- [add environment for npm publish workflow](https://github.com/devicons/devicon/pull/513) by @amacado. -- [bot:build new icons, icomoon.json and devicon.css](https://github.com/devicons/devicon/pull/512) by @amacado. -- [Remove \n from script](https://github.com/devicons/devicon/pull/511) by @Thomas-Boi. -- [Updated the logging of the actions](https://github.com/devicons/devicon/pull/509) by @Thomas-Boi, @amacado. -- [fix check svg icons workflow](https://github.com/devicons/devicon/pull/508) by @amacado. -- [fix bug regarding workflow check](https://github.com/devicons/devicon/pull/506) by @amacado. -- [Release v2.10.0](https://github.com/devicons/devicon/pull/504) by @tylensthilaire, @EnisMulic, @Thomas-Boi, @Th1nkK1D. -- [merge master < develop](https://github.com/devicons/devicon/pull/503) by @amacado. -- [new icon: ocaml (original, original-wordmark, plain, plain-wordmark)](https://github.com/devicons/devicon/pull/499) by @Panquesito7. -- [new icon: Jupyter (original, plain)](https://github.com/devicons/devicon/pull/498) by @amacado, @Panquesito7. -- [automate workflow for npm publish](https://github.com/devicons/devicon/pull/497) by @amacado. -- [redesign readme.md](https://github.com/devicons/devicon/pull/496) by @amacado. -- [new icon: R (original)](https://github.com/devicons/devicon/pull/493) by @Panquesito7. -- [Removed 'default fall back icon' from build_icons.yml](https://github.com/devicons/devicon/pull/487) by @Thomas-Boi. -- [bot:build new icons, icomoon.json and devicon.css](https://github.com/devicons/devicon/pull/486) by @amacado. -- [Release 2.9.0](https://github.com/devicons/devicon/pull/485) by @tylensthilaire, @EnisMulic, @Thomas-Boi, @Th1nkK1D. -- [Added working workflows that has commenting on forked repo's PR.](https://github.com/devicons/devicon/pull/481) by @Thomas-Boi. -- [Add guideline about squash merging](https://github.com/devicons/devicon/pull/480) by @amacado. -- [Check svg upgrades](https://github.com/devicons/devicon/pull/479) by @Thomas-Boi. -- [new icon: testingicon (original, plain) [TESTING DO NOT MERGE]](https://github.com/devicons/devicon/pull/477) by @Thomas-Boi. -- [new icon: testingicon (original, plain) [TESTING DO NOT MERGE]](https://github.com/devicons/devicon/pull/476) by @Thomas-Boi. -- [Check whether the new check_svgs scripts work [TEST DO NOT MERGE]](https://github.com/devicons/devicon/pull/475) by @Thomas-Boi. -- [new icon: testingicon (original, plain) [TESTING DO NOT MERGE]](https://github.com/devicons/devicon/pull/474) by @Thomas-Boi. -- [new icon: testingicon (original, plain) [TESTING DO NOT MERGE]](https://github.com/devicons/devicon/pull/473) by @Thomas-Boi. -- [Fix the ref issue of the checkout action and sqlalchemy ](https://github.com/devicons/devicon/pull/472) by @Thomas-Boi. -- [Added a script that will create a default icon fall back for all devicon classes](https://github.com/devicons/devicon/pull/469) by @Thomas-Boi. -- [Fixed an error with devicon.json](https://github.com/devicons/devicon/pull/468) by @Thomas-Boi. -- [new icon: uwsgi (original, plain)](https://github.com/devicons/devicon/pull/462) by @EnisMulic. -- [Added check script for the icons and fix icons with fill or viewBox issues](https://github.com/devicons/devicon/pull/460) by @Thomas-Boi. -- [Release v2.8.2](https://github.com/devicons/devicon/pull/457) by @amacado, @Thomas-Boi, @EnisMulic. -- [fix displaying svg code in devicon.dev](https://github.com/devicons/devicon/pull/455) by @amacado. -- [Change the peek workflow to use upload artifacts](https://github.com/devicons/devicon/pull/454) by @Thomas-Boi. -- [Release v2.8.1](https://github.com/devicons/devicon/pull/453) by @amacado, @EnisMulic. -- [new icon: testingicon (original, plain) [DO NOT MERGE]](https://github.com/devicons/devicon/pull/452) by @Thomas-Boi. -- [fix icon: bash (plain)](https://github.com/devicons/devicon/pull/451) by @EnisMulic. -- [fix icon: bash (plain), remove extra content](https://github.com/devicons/devicon/pull/450) by @EnisMulic. -- [new icon: testingicon (original, plain) [DO NOT MERGE] testing workflow from fork](https://github.com/devicons/devicon/pull/446) by @Thomas-Boi, @amacado. -- [new icon: testingicon (original, plain) [DO NOT MERGE] Testing Workflow: Amacado/feature/test bot peek](https://github.com/devicons/devicon/pull/445) by @Thomas-Boi, @amacado. -- [merge master back into development (after build)](https://github.com/devicons/devicon/pull/443) by @amacado. -- [bot:build new icons, icomoon.json and devicon.css](https://github.com/devicons/devicon/pull/442) by @amacado. -- [fix typo in github workflow](https://github.com/devicons/devicon/pull/441) by @amacado. -- [fix typo in imgur output](https://github.com/devicons/devicon/pull/440) by @amacado. -- [new icon: testingicon (original, plain) - TEST - DO NOT MERGE ](https://github.com/devicons/devicon/pull/421) by @dependabot[bot], @Thomas-Boi, @amacado, @rawdanowiczdev, @EnisMulic. -- [new icon: testingicon (original, plain) - TEST - DO NOT MERGE](https://github.com/devicons/devicon/pull/420) by @dependabot[bot], @Thomas-Boi, @amacado, @rawdanowiczdev, @EnisMulic. -- [new icon: testingicon (original, plain) - TEST](https://github.com/devicons/devicon/pull/419) by @dependabot[bot], @Thomas-Boi. -- [Updated CONTRIBUTING](https://github.com/devicons/devicon/pull/416) by @Thomas-Boi. From b85ba909deb10caeebeadc30415a058c9299c7ff Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Tue, 27 Apr 2021 17:14:07 -0700 Subject: [PATCH 18/22] Updated CONTRIBUTING --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 676f6b423..7820950c2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -320,7 +320,7 @@ As an example, let's assume you have created the svgs for Redhat and Amazon Web
  • Ensure code quality is up to standard
  • Comment on the PR so maintainers don't have to manually upload icon result. Used by peek-bot and build-bot.
  • Publishing a new release to npm; See #288
  • -
  • Creating a list of features that was added since last release. Note that this is limited to the last 100 PRs for now.
  • +
  • Creating a list of features that was added since last release. See this discussion for inception and limitations.
  • There are some bugs that the build scripts might run into. Listed below are the common ones and their solutions

    From 9b6847ab5321332cdacce0541c0b6d32f08efc37 Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Tue, 27 Apr 2021 17:23:28 -0700 Subject: [PATCH 19/22] Add set up steps for release message workflow --- .github/workflows/get_release_message.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/get_release_message.yml b/.github/workflows/get_release_message.yml index 04c87329a..105f42e83 100644 --- a/.github/workflows/get_release_message.yml +++ b/.github/workflows/get_release_message.yml @@ -5,6 +5,13 @@ jobs: name: Get Fonts From Icomoon runs-on: ubuntu-18.04 steps: + - uses: actions/checkout@v2 + + - name: Setup Python v3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Run the get_release_message.py env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 52fa4c4d4720e42b0c31ad2426ac3d80b0f9f1b5 Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Tue, 27 Apr 2021 17:46:42 -0700 Subject: [PATCH 20/22] Refactored peek workflow --- .github/scripts/icomoon_peek.py | 19 +++++-------------- .github/workflows/peek_icons.yml | 2 +- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/scripts/icomoon_peek.py b/.github/scripts/icomoon_peek.py index 100fe0551..2032c64be 100644 --- a/.github/scripts/icomoon_peek.py +++ b/.github/scripts/icomoon_peek.py @@ -20,13 +20,7 @@ def main(): raise Exception("No files need to be uploaded. Ending script...") # get only the icon object that has the name matching the pr title - err_messages = [] - filtered_icon = find_object_added_in_this_pr(new_icons, args.pr_title, err_messages) - - if filtered_icon is None: - # should have 1 error message if filtered_icon is None - raise Exception(err_messages[0]) - + filtered_icon = find_object_added_in_this_pr(new_icons, args.pr_title) print("Icon being checked:", filtered_icon, sep = "\n", end='\n\n') runner = SeleniumRunner(args.download_path, args.geckodriver_path, args.headless) @@ -44,15 +38,14 @@ def main(): runner.close() -def find_object_added_in_this_pr(icons: List[dict], pr_title: str, err_messages: List[str]): +def find_object_added_in_this_pr(icons: List[dict], pr_title: str): """ Find the icon name from the PR title. :param icons, a list of the font objects found in the devicon.json. :pr_title, the title of the PR that this workflow was called on. - :param err_messages, the error messages that will be displayed :return a dictionary with the "name" entry's value matching the name in the pr_title. - If none can be found, return None. + :raise If no object can be found, raise an Exception. """ try: pattern = re.compile(r"(?<=^new icon: )\w+ (?=\(.+\))", re.I) @@ -61,11 +54,9 @@ def find_object_added_in_this_pr(icons: List[dict], pr_title: str, err_messages: check_devicon_object(icon, icon_name) return icon except IndexError: # there are no match in the findall() - err_messages.append("Couldn't find an icon matching the name in the PR title.") - return None + raise Exception("Couldn't find an icon matching the name in the PR title.") except ValueError as e: - err_messages.append(str(e)) - return None + raise Exception(str(e)) def check_devicon_object(icon: dict, icon_name: str): diff --git a/.github/workflows/peek_icons.yml b/.github/workflows/peek_icons.yml index b39a5292f..c85d7393b 100644 --- a/.github/workflows/peek_icons.yml +++ b/.github/workflows/peek_icons.yml @@ -46,7 +46,7 @@ jobs: - name: Upload the err messages (created by icomoon_peek.py) uses: actions/upload-artifact@v2 - if: success() + if: always() with: name: err_messages path: ./err_messages.txt From ea662d30e39e6c84f37eb9f3572534b347bfc32b Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Tue, 27 Apr 2021 19:12:56 -0700 Subject: [PATCH 21/22] Added requests library --- .github/scripts/requirements.txt | 3 ++- .github/workflows/get_release_message.yml | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/scripts/requirements.txt b/.github/scripts/requirements.txt index 27bc3be5d..00691033d 100644 --- a/.github/scripts/requirements.txt +++ b/.github/scripts/requirements.txt @@ -1 +1,2 @@ -selenium==3.141.0 \ No newline at end of file +selenium==3.141.0 +requests==2.25.1 \ No newline at end of file diff --git a/.github/workflows/get_release_message.yml b/.github/workflows/get_release_message.yml index 105f42e83..292525e93 100644 --- a/.github/workflows/get_release_message.yml +++ b/.github/workflows/get_release_message.yml @@ -12,6 +12,11 @@ jobs: with: python-version: 3.8 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r ./.github/scripts/requirements.txt + - name: Run the get_release_message.py env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 001b136bf5e4bd3f6d81f129ba156066e1e442fe Mon Sep 17 00:00:00 2001 From: Thomas Bui Date: Tue, 27 Apr 2021 19:23:41 -0700 Subject: [PATCH 22/22] Reformat devicon object error messages --- .github/scripts/icomoon_peek.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/scripts/icomoon_peek.py b/.github/scripts/icomoon_peek.py index 2032c64be..9e242f10a 100644 --- a/.github/scripts/icomoon_peek.py +++ b/.github/scripts/icomoon_peek.py @@ -66,52 +66,52 @@ def check_devicon_object(icon: dict, icon_name: str): """ err_msgs = [] try: - if type(icon["name"]) != icon_name: - err_msgs.append("'name' value is not: " + icon_name) + if icon["name"] != icon_name: + err_msgs.append("- 'name' value is not: " + icon_name) except KeyError: - err_msgs.append("Missing key: 'name'.") + err_msgs.append("- missing key: 'name'.") try: for tag in icon["tags"]: if type(tag) != str: raise TypeError() except TypeError: - err_msgs.append("'tags' must be an array of strings, not: " + str(icon["tags"])) + err_msgs.append("- 'tags' must be an array of strings, not: " + str(icon["tags"])) except KeyError: - err_msgs.append("Missing key: 'tags'.") + err_msgs.append("- missing key: 'tags'.") try: if type(icon["versions"]) != dict: - err_msgs.append("'versions' must be an object.") + err_msgs.append("- 'versions' must be an object.") except KeyError: - err_msgs.append("Missing key: 'versions'.") + err_msgs.append("- missing key: 'versions'.") try: if type(icon["versions"]["svg"]) != list or len(icon["versions"]["svg"]) == 0: - err_msgs.append("Must contain at least 1 svg version in a list.") + err_msgs.append("- must contain at least 1 svg version in a list.") except KeyError: - err_msgs.append("Missing key: 'svg' in 'versions'.") + err_msgs.append("- missing key: 'svg' in 'versions'.") try: if type(icon["versions"]["font"]) != list or len(icon["versions"]["svg"]) == 0: - err_msgs.append("Must contain at least 1 font version in a list.") + err_msgs.append("- must contain at least 1 font version in a list.") except KeyError: - err_msgs.append("Missing key: 'font' in 'versions'.") + err_msgs.append("- missing key: 'font' in 'versions'.") try: if type(icon["color"]) != str or "#" not in icon["color"]: - err_msgs.append("'color' must be a string in the format '#abcdef'") + err_msgs.append("- 'color' must be a string in the format '#abcdef'") except KeyError: - err_msgs.append("Missing key: 'color'.") + err_msgs.append("- missing key: 'color'.") try: if type(icon["aliases"]) != list: - err_msgs.append("'aliases' must be an array.") + err_msgs.append("- 'aliases' must be an array.") except KeyError: - err_msgs.append("Missing key: 'aliases'.") + err_msgs.append("- missing key: 'aliases'.") if len(err_msgs) > 0: - message = "Error found in 'devicon.json' for '{}' entry: \n{}\n".format(icon_name, "\n".join(err_msgs)) + message = "Error found in 'devicon.json' for '{}' entry: \n{}".format(icon_name, "\n".join(err_msgs)) raise ValueError(message) return ""