Update verify-feature-promotion HTML output to sort entries and fix overflow#2793
Update verify-feature-promotion HTML output to sort entries and fix overflow#2793JoelSpeed wants to merge 2 commits intoopenshift:masterfrom
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe pull request modifies how HTML feature gate table variants are ordered and styled. The featuregate-test-analyzer command now wraps unsorted variant lists with ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.11.4)Error: build linters: unable to load custom analyzer "kubeapilinter": tools/_output/bin/kube-api-linter.so, plugin: not implemented Comment |
|
Hello @JoelSpeed! Some important instructions when contributing to openshift/api: |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
|
/testwith openshift/api/master/verify-feature-promotion #2772 |
|
/test verify-feature-promotion |
|
PR-Agent: could not fine a component named |
|
/test verify-feature-promotion |
|
PR-Agent: could not fine a component named |
0c8a526 to
c0a7c47
Compare
|
/test verify-feature-promotion |
|
PR-Agent: could not fine a component named |
c0a7c47 to
7480ccd
Compare
Review Summary by QodoStabilize HTML output sorting and fix table overflow
WalkthroughsDescription• Refactor job variant sorting to use centralized OrderedJobVariants method • Add comprehensive sorting criteria including NetworkStack, OS, and JobTiers • Add CSS padding to prevent table content from being cut off • Replace inline sorting logic with reusable sort implementation Diagramflowchart LR
A["buildHTMLFeatureGate<br/>function"] -->|"uses"| B["OrderedJobVariants<br/>sort method"]
B -->|"sorts by"| C["Topology, Architecture,<br/>NetworkStack, OS, JobTiers"]
D["HTML template"] -->|"adds CSS"| E["container-fluid<br/>padding-bottom"]
A -->|"generates"| D
File Changes1. tools/codegen/cmd/featuregate-test-analyzer.go
|
Code Review by Qodo
1. Optional not in sort
|
| if strings.Compare(a[i].OS, a[j].OS) < 0 { | ||
| return true | ||
| } else if strings.Compare(a[i].OS, a[j].OS) > 0 { | ||
| return false | ||
| } | ||
|
|
||
| if strings.Compare(a[i].JobTiers, a[j].JobTiers) < 0 { | ||
| return true | ||
| } else if strings.Compare(a[i].JobTiers, a[j].JobTiers) > 0 { | ||
| return false | ||
| } | ||
|
|
||
| return false |
There was a problem hiding this comment.
1. Optional not in sort 🐞 Bug ≡ Correctness
OrderedJobVariants.Less() never compares JobVariant.Optional, so two distinct variants that differ only by Optional are treated as equal and sort.Sort may emit them in a non-deterministic order when the input comes from UnsortedList(). This can break the PR goal of stable HTML/Markdown column ordering if optional/required variants share the same other fields.
Agent Prompt
### Issue description
`OrderedJobVariants.Less()` does not include `JobVariant.Optional` in its comparison chain. That means two distinct variants that only differ by `Optional` compare equal, and since inputs come from `UnsortedList()` the final ordering can still vary across runs.
### Issue Context
Both HTML and Markdown outputs sort variants derived from a set/map key list.
### Fix Focus Areas
- tools/codegen/cmd/featuregate-test-analyzer.go[621-668]
### Suggested fix
Add a final comparison for `Optional` (and keep it last so it only affects ties), e.g.:
- if `a[i].Optional != a[j].Optional`, return `!a[i].Optional && a[j].Optional` (non-optional first)
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
@JoelSpeed: 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. |
Fixes the ordering of the variants so that it's stable between runs, also adds some padding to the bottom of the content as currently it's being cropped
Proof of newest output in https://prow.ci.openshift.org/view/gs/test-platform-results/pr-logs/pull/openshift_api/2793/pull-ci-openshift-api-master-verify-feature-promotion/2039838674643849216