From 0a73c50ba9435ff644722223746b0ae43e77fa83 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Mon, 30 Sep 2024 11:29:46 -0700 Subject: [PATCH 1/5] Chore: use setup python to improve OSSF scorecard --- .github/workflows/linter.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index df37790..b72e692 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -23,12 +23,14 @@ jobs: # Full git history is needed to get a proper # list of changed files within `super-linter` fetch-depth: 0 + - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 + with: + python-version: '3.12' - name: Install dependencies run: | - python -m pip install --upgrade pip pip install -r requirements.txt -r requirements-test.txt - name: Lint Code Base - uses: super-linter/super-linter@b92721f792f381cedc002ecdbb9847a15ece5bb8 + uses: super-linter/super-linter@b92721f792f381cedc002ecdbb9847a15ece5bb8 # v7.1.0 env: DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d51517fb549584adadc901795886f9ab63589883 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Mon, 30 Sep 2024 11:57:32 -0700 Subject: [PATCH 2/5] chore: run prettier Signed-off-by: Zack Koppert --- .github/workflows/linter.yaml | 2 +- config.py | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index b72e692..1015481 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -25,7 +25,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 with: - python-version: '3.12' + python-version: "3.12" - name: Install dependencies run: | pip install -r requirements.txt -r requirements-test.txt diff --git a/config.py b/config.py index b45093a..7f22ac6 100644 --- a/config.py +++ b/config.py @@ -22,11 +22,13 @@ class EnvVars: Environment variables Attributes: + enable_mentor_count (bool): If set to TRUE, compute number of mentors gh_app_id (int | None): The GitHub App ID to use for authentication gh_app_installation_id (int | None): The GitHub App Installation ID to use for authentication gh_app_private_key_bytes (bytes): The GitHub App Private Key as bytes to use for authentication gh_token (str | None): GitHub personal access token (PAT) for API authentication ghe (str): The GitHub Enterprise URL to use for authentication + heavily_involved_cutoff (str): If set, defines the cutoff after which heavily involved commentors in hide_author (bool): If true, the author's information is hidden in the output hide_items_closed_count (bool): If true, the number of items closed metric is hidden in the output hide_label_metrics (bool): If true, the label metrics are hidden in the output @@ -35,23 +37,25 @@ class EnvVars: hide_time_to_first_response (bool): If true, the time to first response metric is hidden in the output ignore_users (List[str]): List of usernames to ignore when calculating metrics labels_to_measure (List[str]): List of labels to measure how much time the lable is applied - enable_mentor_count (bool): If set to TRUE, compute number of mentors - min_mentor_comments (str): If set, defines the minimum number of comments for mentors max_comments_eval (str): If set, defines the maximum number of comments to look at for mentor evaluation - heavily_involved_cutoff (str): If set, defines the cutoff after which heavily involved commentors in - search_query (str): Search query used to filter issues/prs/discussions on GitHub + min_mentor_comments (str): If set, defines the minimum number of comments for mentors non_mentioning_links (bool): If set to TRUE, links do not cause a notification in the desitnation repository - report_title (str): The title of the report output_file (str): The name of the file to write the report to + report_title (str): The title of the report + search_query (str): Search query used to filter issues/prs/discussions on GitHub + sort_by_author (bool): If true, the report will be sorted by author + sort_by_time_to_close (bool): If true, the report will be sorted by time to close """ def __init__( self, + enable_mentor_count: bool, gh_app_id: int | None, gh_app_installation_id: int | None, gh_app_private_key_bytes: bytes, gh_token: str | None, ghe: str | None, + heavily_involved_cutoff: str, hide_author: bool, hide_items_closed_count: bool, hide_label_metrics: bool, @@ -60,14 +64,14 @@ def __init__( hide_time_to_first_response: bool, ignore_user: List[str], labels_to_measure: List[str], - enable_mentor_count: bool, - min_mentor_comments: str, max_comments_eval: str, - heavily_involved_cutoff: str, - search_query: str, + min_mentor_comments: str, non_mentioning_links: bool, - report_title: str, output_file: str, + report_title: str, + search_query: str, + sort_by_author: bool, + sort_by_time_to_close: bool, ): self.gh_app_id = gh_app_id self.gh_app_installation_id = gh_app_installation_id From 93590cae4d788d28fc8db9f1f971b5f0fd83a3d2 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Mon, 30 Sep 2024 12:00:56 -0700 Subject: [PATCH 3/5] revert back to unalphabetized params --- config.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/config.py b/config.py index 7f22ac6..b43ea2b 100644 --- a/config.py +++ b/config.py @@ -22,13 +22,11 @@ class EnvVars: Environment variables Attributes: - enable_mentor_count (bool): If set to TRUE, compute number of mentors gh_app_id (int | None): The GitHub App ID to use for authentication gh_app_installation_id (int | None): The GitHub App Installation ID to use for authentication gh_app_private_key_bytes (bytes): The GitHub App Private Key as bytes to use for authentication gh_token (str | None): GitHub personal access token (PAT) for API authentication ghe (str): The GitHub Enterprise URL to use for authentication - heavily_involved_cutoff (str): If set, defines the cutoff after which heavily involved commentors in hide_author (bool): If true, the author's information is hidden in the output hide_items_closed_count (bool): If true, the number of items closed metric is hidden in the output hide_label_metrics (bool): If true, the label metrics are hidden in the output @@ -37,25 +35,23 @@ class EnvVars: hide_time_to_first_response (bool): If true, the time to first response metric is hidden in the output ignore_users (List[str]): List of usernames to ignore when calculating metrics labels_to_measure (List[str]): List of labels to measure how much time the lable is applied - max_comments_eval (str): If set, defines the maximum number of comments to look at for mentor evaluation + enable_mentor_count (bool): If set to TRUE, compute number of mentors min_mentor_comments (str): If set, defines the minimum number of comments for mentors + max_comments_eval (str): If set, defines the maximum number of comments to look at for mentor evaluation + heavily_involved_cutoff (str): If set, defines the cutoff after which heavily involved commentors in + search_query (str): Search query used to filter issues/prs/discussions on GitHub non_mentioning_links (bool): If set to TRUE, links do not cause a notification in the desitnation repository - output_file (str): The name of the file to write the report to report_title (str): The title of the report - search_query (str): Search query used to filter issues/prs/discussions on GitHub - sort_by_author (bool): If true, the report will be sorted by author - sort_by_time_to_close (bool): If true, the report will be sorted by time to close + output_file (str): The name of the file to write the report to """ def __init__( self, - enable_mentor_count: bool, gh_app_id: int | None, gh_app_installation_id: int | None, gh_app_private_key_bytes: bytes, gh_token: str | None, ghe: str | None, - heavily_involved_cutoff: str, hide_author: bool, hide_items_closed_count: bool, hide_label_metrics: bool, @@ -64,14 +60,14 @@ def __init__( hide_time_to_first_response: bool, ignore_user: List[str], labels_to_measure: List[str], - max_comments_eval: str, + enable_mentor_count: bool, min_mentor_comments: str, + max_comments_eval: str, + heavily_involved_cutoff: str, + search_query: str, non_mentioning_links: bool, - output_file: str, report_title: str, - search_query: str, - sort_by_author: bool, - sort_by_time_to_close: bool, + output_file: str, ): self.gh_app_id = gh_app_id self.gh_app_installation_id = gh_app_installation_id @@ -239,3 +235,4 @@ def get_env_vars(test: bool = False) -> EnvVars: report_title, output_file, ) + From d58e46dd88d1dd2dbe6215b90d30be21bf0f3705 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Mon, 30 Sep 2024 12:08:37 -0700 Subject: [PATCH 4/5] remove extra line return --- config.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config.py b/config.py index b43ea2b..7cb753d 100644 --- a/config.py +++ b/config.py @@ -234,5 +234,4 @@ def get_env_vars(test: bool = False) -> EnvVars: non_mentioning_links, report_title, output_file, - ) - + ) From ca5596f9c83a26425de97fe6cc0468aa30e5e511 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Mon, 30 Sep 2024 12:09:35 -0700 Subject: [PATCH 5/5] chore: remove end of line whitespace --- config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.py b/config.py index 7cb753d..b45093a 100644 --- a/config.py +++ b/config.py @@ -234,4 +234,4 @@ def get_env_vars(test: bool = False) -> EnvVars: non_mentioning_links, report_title, output_file, - ) + )