-
Notifications
You must be signed in to change notification settings - Fork 146
Enable the OCM linter #1104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable the OCM linter #1104
Conversation
WalkthroughAdds an ocm-lint configuration, enables a custom Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Dev as Developer
participant Make as Makefile
participant GolangCI as golangci-lint (local/action)
participant OcmLint as ocm-lint
participant Config as .custom-gcl.yml
Dev->>Make: make lint
Make->>GolangCI: golangci-lint custom (reads .golangci.yml, loads ocmlogger)
GolangCI-->>Make: lint results
Make->>OcmLint: $(LOCAL_BIN_PATH)/ocm-lint run
OcmLint->>Config: load .custom-gcl.yml (resolve plugin module/import)
OcmLint-->>Make: ocm-lint results
Note right of Make: collect and report combined lint output
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
b35b51b to
e95b248
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (3)
.custom-gcl.yml(1 hunks).golangci.yml(1 hunks)Makefile(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Test (1.21, macos-latest)
- GitHub Check: Test (1.21, ubuntu-latest)
- GitHub Check: Test (1.21, windows-latest)
🔇 Additional comments (1)
.custom-gcl.yml (1)
1-10: Manual verification required for ocm-lint v2.1.6 configuration and plugin accessibility.Unable to definitively confirm from codebase or public sources:
- ocm-lint v2.1.6 availability — Web search yielded no clear results confirming this version exists as a published release
- Plugin module accessibility — No references to
github.com/openshift-online/ocm-sdk-go/lintersas a plugin endpoint were found in the repository- GCL configuration format — No
.custom-gcl.ymlfiles or GCL framework references exist in the codebase, suggesting this may be a new external toolThe review's path resolution concern (line 5:
./binvs$(LOCAL_BIN_PATH)) is valid and should be verified to ensure consistent behavior across different working directory contexts.Recommend: Test the configuration locally by running the tool with this configuration file to confirm version availability, plugin module resolution, and path behavior before merging.
e95b248 to
361f3e8
Compare
361f3e8 to
9cb6266
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
leadership/flag.go (1)
323-333: Precheck error handling/logging improved; consider aligning context usage.Including
process,flag-name, anderrin the precheck failure log is a clear improvement, and the combination ofschedule(ctx, f.retryInterval)+lower(ctx)on both error and!checkpaths makes the flag state explicit and conservative.One minor consistency point: here you log with
f.ctx, while the rest of this method and file mostly use the locally derivedctxthat adds theleadershipFlagvalue. Usingctxinstead off.ctxwould keep log context uniform and ensure any values injected intoctxare visible to the logger as well.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (5)
.custom-gcl.yml(1 hunks).github/workflows/check-pull-request.yaml(1 hunks).golangci.yml(1 hunks)Makefile(1 hunks)leadership/flag.go(3 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- .github/workflows/check-pull-request.yaml
- .custom-gcl.yml
- .golangci.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: Test (1.21, macos-latest)
- GitHub Check: Test (1.21, ubuntu-latest)
- GitHub Check: Test (1.21, windows-latest)
- GitHub Check: Generate
- GitHub Check: Lint
🔇 Additional comments (3)
Makefile (1)
97-101: Lint target chaining looks correct; please confirmocm-lintprovisioning.The updated recipe correctly chains
golangci-lint customandocm-lint runsoocm-lintonly executes on a successful custom lint run, and any failure ingolangci-lint --versionwill still fail thelinttarget.Please just verify that your
.custom-gcl.yml/ build flow reliably produces or installs$(LOCAL_BIN_PATH)/ocm-lintin both local and CI environments; otherwisemake lintwill fail on a missing binary.leadership/flag.go (2)
385-393: Including the error in the create-state log is helpful.The updated format string for the “create initial state” failure now logs the underlying error, which will make diagnosing database issues much easier. Arguments match the placeholders correctly.
466-470: Update-holder error log now has full context; looks good.Similarly, the “update holder” error path now includes the error value alongside process and flag name, which aligns with other error logs in this type and improves observability. Placeholder/argument usage is correct.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: oriAdler, ziccardi The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
I verified the changes locally: |
04dbb14
into
openshift-online:main
This PR contains 2 commits: