CNF-23812: Add OLM annotation lint workflow#760
Conversation
|
@sebrandon1: This pull request references CNF-23812 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sebrandon1 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
📝 WalkthroughWalkthroughAdds a pull-request GitHub Actions workflow and a Makefile target to run the OLM annotation linter against the repository root while excluding ChangesOLM Annotation Linting
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
01f77a4 to
93a6300
Compare
|
I really like the checking of annotations and deeper verification that this brings, but three questions:
|
|
Good questions! For:
I'll ping you when it's updated. |
|
@sebrandon1: This pull request references CNF-23812 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
e6ebea1 to
a8f5225
Compare
|
Okay I have created a |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/olm-annotation-lint.yml (1)
8-9: ⚡ Quick winConsider pinning actions to commit SHAs for supply chain security.
Using version tags like
@v6and@v1allows the underlying action code to change without notice if tags are moved. Pinning to immutable commit SHAs prevents unexpected changes and supply chain attacks.🔒 Example: pinning to commit SHA
- - uses: actions/checkout@v6 - - uses: openshift-kni/olm-annotation-lint@v1 + - uses: actions/checkout@ea960f4e5f8dc486d805e0d398e0b8d75443c3fc # v6 + - uses: openshift-kni/olm-annotation-lint@<commit-sha> # v1You can find the current commit SHA for each action version in their respective repositories.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/olm-annotation-lint.yml around lines 8 - 9, The workflow currently uses mutable tags for actions (uses: actions/checkout@v6 and uses: openshift-kni/olm-annotation-lint@v1); replace those tag references with the corresponding commit SHAs to pin each action to an immutable revision (e.g., uses: actions/checkout@<commit-sha> and uses: openshift-kni/olm-annotation-lint@<commit-sha>), locating the exact SHAs from each action's repository and updating the two uses lines in the workflow file.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/olm-annotation-lint.yml:
- Around line 8-9: The workflow currently uses mutable tags for actions (uses:
actions/checkout@v6 and uses: openshift-kni/olm-annotation-lint@v1); replace
those tag references with the corresponding commit SHAs to pin each action to an
immutable revision (e.g., uses: actions/checkout@<commit-sha> and uses:
openshift-kni/olm-annotation-lint@<commit-sha>), locating the exact SHAs from
each action's repository and updating the two uses lines in the workflow file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 9ec84720-b243-43a0-ba11-f2dfb45f41f6
📒 Files selected for processing (2)
.github/workflows/olm-annotation-lint.ymlMakefile
Add a GitHub Actions workflow that runs olm-annotation-lint v1.0.2 on pull requests to validate OLM annotations on Kubernetes resources. Add a make olm-annotation-lint target for local linting that auto-detects OS/arch, downloads the latest release binary to a temp file, runs it, and cleans up automatically.
58fdabf to
ec12495
Compare
|
@sebrandon1: This pull request references CNF-23812 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Summary
olm.*,operatorframework.io/*) on Kubernetes resources in the repomake olm-annotation-linttarget for running the linter locally — auto-detects OS/arch, downloads the latest release binary to a temp file, runs it, and cleans up automaticallyThis would have caught the invalid
olm.operatorframework.io/bundle-install-timeoutannotation that was removed in #759. Going forward, any PR introducing an unknown, mistyped, or misused OLM annotation will fail CI.Related to
What it checks
Local usage
No dependencies required — the binary is downloaded from the latest GitHub release and removed after execution.
Test plan
make olm-annotation-lintworks locally