Fix Check Workflow Events CI job - #1901
Conversation
The "Check Workflow Events" job fails on every PR for two reasons that are independent of the PR under review: 1. pr_review.yml declares the `pull_request_target` event, which the job flags with "please remove!" and exits 1. The event is intentional and required: pr_review.yml runs the opensearch-build code-diff analyzer/reviewer, which needs the BEDROCK_ACCESS_ROLE secret and `pull-requests: write` permission to comment on pull requests, including those from forks. That is exactly the use case `pull_request_target` exists for. The workflow was onboarded (opensearch-project#1841) after the checker (opensearch-project#1128) and was never added to the allowlist alongside backport.yml and copy-linked-issue-labels.yml. Add pr_review.yml to that allowlist instead of removing the event. 2. backwards_compatibility_tests_workflow.yml contains a stray ` }}'"` fragment (plus a blank line) accidentally introduced by the version bump in opensearch-project#1896, right after the Restart-Upgrade job's test command. It breaks YAML parsing ("bad file ... did not find expected key"), which the checker surfaces via yq. The parallel Rolling-Upgrade job has no such fragment. Remove the stray lines; the run block is otherwise unchanged. Validated locally by parsing every .github/workflows/*.yml file (all parse cleanly) and simulating the checker's allowlist logic (0 non-allowlisted pull_request_target files, exit 0). Signed-off-by: Martin Gaievski <gaievski@amazon.com>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 8c63c96.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
PR Reviewer Guide 🔍(Review updated until commit 8c63c96)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 8c63c96
Previous suggestionsSuggestions up to commit 38b22fe
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1901 +/- ##
=========================================
Coverage 83.43% 83.43%
Complexity 3898 3898
=========================================
Files 291 291
Lines 13844 13844
Branches 2304 2304
=========================================
Hits 11551 11551
Misses 1458 1458
Partials 835 835 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Signed-off-by: Heemin Kim <heemin@amazon.com>
|
Persistent review updated to latest commit 8c63c96 |
Description
The Check Workflow Events CI job (
.github/workflows/check-workflow-events.yml) currently fails on every PR, for two reasons that are independent of the PR under review:pr_review.ymlusespull_request_target(the actualexit 1). The checker prints'pr_review.yml' workflow file contains 'pull_request_target' event, please remove!and exits 1. This event is intentional and required —pr_review.ymlruns theopensearch-buildcode-diff analyzer/reviewer, which needs theBEDROCK_ACCESS_ROLEsecret andpull-requests: writepermission to comment on PRs (including those from forks). That is exactly whatpull_request_targetis for. The workflow was onboarded in Onboard code diff analyzer/reviewer and issue dedupe workflows (neural-search) #1841 (after the checker was added in Add check workflow events related checks #1128) and was simply never added to the allowlist alongsidebackport.ymlandcopy-linked-issue-labels.yml.→ Fix: add
pr_review.ymlto the checker's allowlist (do not remove the event, which would break the feature and its secret/permission model).backwards_compatibility_tests_workflow.ymlfails YAML parsing. The checker logsbad file 'backwards_compatibility_tests_workflow.yml': yaml: ... did not find expected key. A stray}}'"fragment (plus a blank line) was accidentally introduced by the version bump in Increment version to 3.8.0-SNAPSHOT #1896, right after the Restart-Upgrade job's test command. The parallel Rolling-Upgrade job has no such fragment.→ Fix: remove the stray lines. The
runblock is otherwise unchanged.Check List
--signoff.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.