From 485f9f0260a5f8c6d18dd588b23dc2e2fd8b873a Mon Sep 17 00:00:00 2001 From: Dominik Schubert Date: Thu, 14 Sep 2023 10:41:08 +0200 Subject: [PATCH] Slim down marker report issue template rendering (#9144) --- .github/bot_templates/MARKER_REPORT_ISSUE.md.j2 | 4 ++-- .github/workflows/marker-report-issue.yml | 6 ++++++ scripts/render_marker_report.py | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/bot_templates/MARKER_REPORT_ISSUE.md.j2 b/.github/bot_templates/MARKER_REPORT_ISSUE.md.j2 index 519a02e028d6c..75aaab56924b9 100644 --- a/.github/bot_templates/MARKER_REPORT_ISSUE.md.j2 +++ b/.github/bot_templates/MARKER_REPORT_ISSUE.md.j2 @@ -26,11 +26,11 @@ _Note_: The individual assignments here are based on the entries in the [CODEOWN ## unknown ({{ data.aggregated['aws_unknown'] }}) {% for item in data.owners_aws_unknown -%} -- [ ] `{{ item.pytest_node_id }}` ([file]({{ item.file_url }})) {{ " ".join(item.owners) }} +- [ ] `{{ item.pytest_node_id }}` {{ " ".join(item.owners) }} {% endfor %} ## needs_fixing ({{ data.aggregated['aws_needs_fixing'] }}) {% for item in data.owners_aws_needs_fixing -%} -- [ ] `{{ item.pytest_node_id }}` ([file]({{ item.file_url }})) {{ " ".join(item.owners) }} +- [ ] `{{ item.pytest_node_id }}` {{ " ".join(item.owners) }} {% endfor %} diff --git a/.github/workflows/marker-report-issue.yml b/.github/workflows/marker-report-issue.yml index 6db58626ac72a..18dc7717bd798 100644 --- a/.github/workflows/marker-report-issue.yml +++ b/.github/workflows/marker-report-issue.yml @@ -3,6 +3,11 @@ on: # only manual for now workflow_dispatch: inputs: + dryRun: + description: 'Execute a Dry-Run? A Dry-Run will not create any issues and only print the issue content in the logs instead' + required: false + type: boolean + default: false updateExistingIssue: description: 'Select the empty string "" to open duplicate issues, "true" to update duplicate issues and "false" to skip duplicate issues' required: false @@ -68,6 +73,7 @@ jobs: path: ./target/MARKER_REPORT_ISSUE.md - name: Create GH issue from template + if: inputs.dryRun != true uses: JasonEtco/create-an-issue@v2 env: GITHUB_TOKEN: ${{ secrets.PRO_ACCESS_TOKEN }} diff --git a/scripts/render_marker_report.py b/scripts/render_marker_report.py index 4d1504b8c19c4..d20f8a3defec7 100644 --- a/scripts/render_marker_report.py +++ b/scripts/render_marker_report.py @@ -69,7 +69,7 @@ def create_test_entry(entry, *, code_owners: CodeOwners, commit_sha: str, github return TestEntry( pytest_node_id=entry["node_id"], file_path=rel_path, - owners=[o[1] for o in code_owners.of(rel_path)] or ["CODEOWNER_MISSING"], + owners=[o[1] for o in code_owners.of(rel_path)] or ["?"], file_url=f"https://github.com/{github_repo}/blob/{commit_sha}/{rel_path}", )