From 93ceb734055869deb17e5c0c7d455f847a7e6a8d Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 8 May 2025 22:12:51 +0000 Subject: [PATCH 1/9] fix: remove mentor count from stats if mentors are disabled Signed-off-by: Zack Koppert --- issue_metrics.py | 3 +++ markdown_writer.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/issue_metrics.py b/issue_metrics.py index a1b3f11..ab9cb91 100644 --- a/issue_metrics.py +++ b/issue_metrics.py @@ -281,6 +281,7 @@ def main(): # pragma: no cover search_query=search_query, hide_label_metrics=False, hide_items_closed_count=False, + enable_mentor_count=enable_mentor_count, non_mentioning_links=False, report_title=report_title, output_file=output_file, @@ -307,6 +308,7 @@ def main(): # pragma: no cover search_query=search_query, hide_label_metrics=False, hide_items_closed_count=False, + enable_mentor_count=enable_mentor_count, non_mentioning_links=False, report_title=report_title, output_file=output_file, @@ -370,6 +372,7 @@ def main(): # pragma: no cover search_query=search_query, hide_label_metrics=hide_label_metrics, hide_items_closed_count=hide_items_closed_count, + enable_mentor_count=enable_mentor_count, non_mentioning_links=non_mentioning_links, report_title=report_title, output_file=output_file, diff --git a/markdown_writer.py b/markdown_writer.py index e506a4f..ed0d05d 100644 --- a/markdown_writer.py +++ b/markdown_writer.py @@ -100,6 +100,7 @@ def write_to_markdown( search_query=None, hide_label_metrics=False, hide_items_closed_count=False, + enable_mentor_count=False, non_mentioning_links=False, report_title="", output_file="", @@ -168,6 +169,7 @@ def write_to_markdown( file, hide_label_metrics, hide_items_closed_count, + enable_mentor_count, ) # Write second table with individual issue/pr/discussion metrics @@ -243,6 +245,7 @@ def write_overall_metrics_tables( file, hide_label_metrics, hide_items_closed_count=False, + enable_mentor_count=False, ): """Write the overall metrics tables to the markdown file.""" if any( @@ -316,5 +319,6 @@ def write_overall_metrics_tables( file.write(f"| Number of items that remain open | {num_issues_opened} |\n") if not hide_items_closed_count: file.write(f"| Number of items closed | {num_issues_closed} |\n") - file.write(f"| Number of most active mentors | {num_mentor_count} |\n") + if enable_mentor_count: + file.write(f"| Number of most active mentors | {num_mentor_count} |\n") file.write(f"| Total number of items created | {len(issues_with_metrics)} |\n\n") From c45c5db5d6d8fbafdfff4bbae3d8950a110a0e76 Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Thu, 8 May 2025 15:25:56 -0700 Subject: [PATCH 2/9] fix: fix tests to reflect when mentor count should and shouldnt be in the markdown table Signed-off-by: Zack Koppert --- test_markdown_writer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test_markdown_writer.py b/test_markdown_writer.py index 3927106..e8f5b08 100644 --- a/test_markdown_writer.py +++ b/test_markdown_writer.py @@ -129,7 +129,6 @@ def test_write_to_markdown(self): "| --- | ---: |\n" "| Number of items that remain open | 2 |\n" "| Number of items closed | 1 |\n" - "| Number of most active mentors | 5 |\n" "| Total number of items created | 2 |\n\n" "| Title | URL | Author | Time to first response | Time to close |" " Time to answer | Time in draft | Time spent in bug | Created At |\n" @@ -240,7 +239,6 @@ def test_write_to_markdown_with_vertical_bar_in_title(self): "| --- | ---: |\n" "| Number of items that remain open | 2 |\n" "| Number of items closed | 1 |\n" - "| Number of most active mentors | 5 |\n" "| Total number of items created | 2 |\n\n" "| Title | URL | Author | Time to first response | Time to close |" " Time to answer | Time in draft | Time spent in bug | Created At |\n" @@ -369,6 +367,7 @@ def test_writes_markdown_file_with_non_hidden_columns_only(self): search_query="repo:user/repo is:issue", hide_label_metrics=True, hide_items_closed_count=True, + enable_mentor_count=True, non_mentioning_links=True, report_title="Issue Metrics", output_file="issue_metrics.md", From 992bf9db20811a4c35c4c49913926c5dde01bdde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 17:48:47 +0000 Subject: [PATCH 3/9] chore(deps): bump github/contributors in the dependencies group Bumps the dependencies group with 1 update: [github/contributors](https://github.com/github/contributors). Updates `github/contributors` from 1.5.7 to 1.5.8 - [Release notes](https://github.com/github/contributors/releases) - [Commits](https://github.com/github/contributors/compare/9e9ce8e51fe186c4d699ebb3d35c1f1fd755a357...6949781e2a2575cba21a80325c9dd6014f5c898b) --- updated-dependencies: - dependency-name: github/contributors dependency-version: 1.5.8 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies ... Signed-off-by: dependabot[bot] --- .github/workflows/contributor_report.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/contributor_report.yaml b/.github/workflows/contributor_report.yaml index 8c71042..1385546 100644 --- a/.github/workflows/contributor_report.yaml +++ b/.github/workflows/contributor_report.yaml @@ -27,7 +27,7 @@ jobs: echo "END_DATE=$end_date" >> "$GITHUB_ENV" - name: Run contributor action - uses: github/contributors@9e9ce8e51fe186c4d699ebb3d35c1f1fd755a357 # v1.5.7 + uses: github/contributors@6949781e2a2575cba21a80325c9dd6014f5c898b # v1.5.8 env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} START_DATE: ${{ env.START_DATE }} From 77d6a30b8655352dce42cc31ea8ceb3efe4cd312 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 May 2025 18:03:00 +0000 Subject: [PATCH 4/9] chore(deps): bump python from `21e39cf` to `914bf5c` Bumps python from `21e39cf` to `914bf5c`. --- updated-dependencies: - dependency-name: python dependency-version: 3.13-slim dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 51d286b..9f7709b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ #checkov:skip=CKV_DOCKER_2 #checkov:skip=CKV_DOCKER_3 -FROM python:3.13-slim@sha256:21e39cf1815802d4c6f89a0d3a166cc67ce58f95b6d1639e68a394c99310d2e5 +FROM python:3.13-slim@sha256:914bf5c12ea40a97a78b2bff97fbdb766cc36ec903bfb4358faf2b74d73b555b LABEL com.github.actions.name="issue-metrics" \ com.github.actions.description="Gather metrics on issues/prs/discussions such as time to first response, count of issues opened, closed, etc." \ com.github.actions.icon="check-square" \ From cbd7b777e7f774f8177edf5a891f5b051f38e961 Mon Sep 17 00:00:00 2001 From: Max Base Date: Tue, 13 May 2025 18:53:16 +0000 Subject: [PATCH 5/9] fix: occured -> occurred --- labels.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/labels.py b/labels.py index 81b9b4b..b9502b4 100644 --- a/labels.py +++ b/labels.py @@ -56,7 +56,7 @@ def get_label_metrics(issue: github3.issues.Issue, labels: List[str]) -> dict: # Calculate the time to add or subtract to the time spent in label based on the label events for event in label_events: - # Skip labeling events that have occured past issue close time + # Skip labeling events that have occurred past issue close time if issue.closed_at is not None and ( event.created_at >= datetime.fromisoformat(issue.closed_at) ): From d5b2446369861128eb25b2f1b76037047b9c47c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 17:27:21 +0000 Subject: [PATCH 6/9] chore(deps): bump the dependencies group with 2 updates Bumps the dependencies group with 2 updates: [super-linter/super-linter](https://github.com/super-linter/super-linter) and [github/codeql-action](https://github.com/github/codeql-action). Updates `super-linter/super-linter` from 7.3.0 to 7.4.0 - [Release notes](https://github.com/super-linter/super-linter/releases) - [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md) - [Commits](https://github.com/super-linter/super-linter/compare/4e8a7c2bf106c4c766c816b35ec612638dc9b6b2...12150456a73e248bdc94d0794898f94e23127c88) Updates `github/codeql-action` from 3.28.17 to 3.28.18 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/60168efe1c415ce0f5521ea06d5c2062adbeed1b...ff0a06e83cb2de871e5a09832bc6a81e7276941f) --- updated-dependencies: - dependency-name: super-linter/super-linter dependency-version: 7.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: github/codeql-action dependency-version: 3.28.18 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies ... Signed-off-by: dependabot[bot] --- .github/workflows/linter.yaml | 2 +- .github/workflows/scorecard.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml index 94418b6..9a7a3df 100644 --- a/.github/workflows/linter.yaml +++ b/.github/workflows/linter.yaml @@ -30,7 +30,7 @@ jobs: run: | pip install -r requirements.txt -r requirements-test.txt - name: Lint Code Base - uses: super-linter/super-linter@4e8a7c2bf106c4c766c816b35ec612638dc9b6b2 # v7.3.0 + uses: super-linter/super-linter@12150456a73e248bdc94d0794898f94e23127c88 # v7.4.0 env: DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 5074dcd..db4bd3c 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -42,6 +42,6 @@ jobs: path: results.sarif retention-days: 5 - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.24.9 + uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.24.9 with: sarif_file: results.sarif From 350de6249a1f18ade8601fa7cb711b4e0129a933 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 17:38:06 +0000 Subject: [PATCH 7/9] chore(deps): bump types-requests from 2.32.0.20250328 to 2.32.0.20250515 Bumps [types-requests](https://github.com/typeshed-internal/stub_uploader) from 2.32.0.20250328 to 2.32.0.20250515. - [Commits](https://github.com/typeshed-internal/stub_uploader/commits) --- updated-dependencies: - dependency-name: types-requests dependency-version: 2.32.0.20250515 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index b629065..919aec6 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -6,4 +6,4 @@ pylint==3.3.7 pytest==8.3.5 pytest-cov==6.1.1 types-pytz==2025.2.0.20250326 -types-requests==2.32.0.20250328 +types-requests==2.32.0.20250515 From 4dc710fcd784031740176699c03c6f0fbfea2c53 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 May 2025 17:42:21 +0000 Subject: [PATCH 8/9] chore(deps): bump types-pytz from 2025.2.0.20250326 to 2025.2.0.20250516 Bumps [types-pytz](https://github.com/typeshed-internal/stub_uploader) from 2025.2.0.20250326 to 2025.2.0.20250516. - [Commits](https://github.com/typeshed-internal/stub_uploader/commits) --- updated-dependencies: - dependency-name: types-pytz dependency-version: 2025.2.0.20250516 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 919aec6..3984740 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -5,5 +5,5 @@ mypy-extensions==1.1.0 pylint==3.3.7 pytest==8.3.5 pytest-cov==6.1.1 -types-pytz==2025.2.0.20250326 +types-pytz==2025.2.0.20250516 types-requests==2.32.0.20250515 From 3d10a9f519dd1a82cd1c92d319cfa4590a27a646 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 17:51:01 +0000 Subject: [PATCH 9/9] chore(deps): bump python from `914bf5c` to `56a1136` Bumps python from `914bf5c` to `56a1136`. --- updated-dependencies: - dependency-name: python dependency-version: 3.13-slim dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9f7709b..dd3fc58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ #checkov:skip=CKV_DOCKER_2 #checkov:skip=CKV_DOCKER_3 -FROM python:3.13-slim@sha256:914bf5c12ea40a97a78b2bff97fbdb766cc36ec903bfb4358faf2b74d73b555b +FROM python:3.13-slim@sha256:56a11364ffe0fee3bd60af6d6d5209eba8a99c2c16dc4c7c5861dc06261503cc LABEL com.github.actions.name="issue-metrics" \ com.github.actions.description="Gather metrics on issues/prs/discussions such as time to first response, count of issues opened, closed, etc." \ com.github.actions.icon="check-square" \