MGMT-24400: Document TestVersion API and usage guidance#10426
Conversation
|
@bluesort: This pull request references MGMT-24400 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 sub-task 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. |
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (3)
WalkthroughThis PR updates documentation to clarify OCP version handling in assisted-service tests. Subsystem tests must reference OCP versions via ChangesOCP Version Testing Documentation
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bluesort The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.cursor/skills/assisted-service-writing-unit-tests/SKILL.md (1)
23-23: ⚡ Quick winStandardize on
common.TestVersion()wording across this skill.These lines mix
TestVersion()andcommon.TestVersion(). Use the fully-qualified form everywhere to keep rule-checking and copy/paste guidance unambiguous.Suggested edits
-| OCP version in tests | Use hardcoded strings or `common.TestDefaultConfig` — do not use `TestVersion()` | +| OCP version in tests | Use hardcoded strings or `common.TestDefaultConfig` — do not use `common.TestVersion()` |-## OCP Versions: Use Hardcoded Strings, Not TestVersion() +## OCP Versions: Use Hardcoded Strings, Not common.TestVersion()-| Using `TestVersion()` | Wrong abstraction for non-subsystem tests | Use hardcoded strings or `common.TestDefaultConfig` | +| Using `common.TestVersion()` | Wrong abstraction for non-subsystem tests | Use hardcoded strings or `common.TestDefaultConfig` |-- [ ] No `TestVersion()` usage — use hardcoded strings or `common.TestDefaultConfig` +- [ ] No `common.TestVersion()` usage — use hardcoded strings or `common.TestDefaultConfig`Also applies to: 138-140, 179-179, 188-188
🤖 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 @.cursor/skills/assisted-service-writing-unit-tests/SKILL.md at line 23, Replace all occurrences of the unqualified symbol TestVersion() with the fully-qualified common.TestVersion() in the SKILL.md content so wording is consistent; search for every instance of "TestVersion()" (including the ones noted near the OCP version guidance and the other occurrences) and update them to "common.TestVersion()" to standardize examples and rule-checking guidance.docs/dev/testing.md (1)
88-88: ⚡ Quick winUse fully-qualified API in this exception example.
This line should use
common.TestVersion().Latest()for consistency with the rest of the docs and to avoid ambiguous copy/paste usage.Suggested edit
-**Unit tests** may use hardcoded version strings since versions are not pulled from real sources. The one exception is `TestDefaultConfig` in `internal/common/test_configuration.go`, which uses `TestVersion().Latest()` to conveniently track the latest available version. +**Unit tests** may use hardcoded version strings since versions are not pulled from real sources. The one exception is `TestDefaultConfig` in `internal/common/test_configuration.go`, which uses `common.TestVersion().Latest()` to conveniently track the latest available version.🤖 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 `@docs/dev/testing.md` at line 88, Update the example text to use the fully-qualified API by replacing the ambiguous call TestVersion().Latest() with common.TestVersion().Latest() in the docs; specifically locate the sentence describing TestDefaultConfig in internal/common/test_configuration.go and change the example usage to common.TestVersion().Latest() so it matches the rest of the docs and avoids copy/paste ambiguity.
🤖 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 @.cursor/skills/assisted-service-writing-unit-tests/SKILL.md:
- Line 23: Replace all occurrences of the unqualified symbol TestVersion() with
the fully-qualified common.TestVersion() in the SKILL.md content so wording is
consistent; search for every instance of "TestVersion()" (including the ones
noted near the OCP version guidance and the other occurrences) and update them
to "common.TestVersion()" to standardize examples and rule-checking guidance.
In `@docs/dev/testing.md`:
- Line 88: Update the example text to use the fully-qualified API by replacing
the ambiguous call TestVersion().Latest() with common.TestVersion().Latest() in
the docs; specifically locate the sentence describing TestDefaultConfig in
internal/common/test_configuration.go and change the example usage to
common.TestVersion().Latest() so it matches the rest of the docs and avoids
copy/paste ambiguity.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2374a784-a650-4e60-aead-8acbccc7b2f9
📒 Files selected for processing (3)
.cursor/skills/assisted-service-writing-unit-tests/SKILL.mddocs/dev/test-versions.mddocs/dev/testing.md
Document the TestVersion() builder API, scope (subsystem tests vs unit tests), usage patterns, and regeneration workflow. Add a summary section to the existing testing.md pointing to the new doc. Assisted-by: Claude Code <noreply@anthropic.com>
Assisted-by: Claude Code <noreply@anthropic.com>
|
@bluesort: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
List all the issues related to this PR
What environments does this code impact?
How was this code tested?
Checklist
docs, README, etc)Reviewers Checklist
Summary by CodeRabbit
TestVersion()and use hardcoded values or defaultsTestVersion()behavior for subsystem tests, including supported fluent APIs, constraint selection semantics, and release/artifact lookup rules