feat: sort label result#1076
Conversation
|
/cc @Skisocks |
|
Hi @TSnowden-1311. Thanks for your PR. I'm waiting for a jenkins-x-plugins member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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 jenkins-x/lighthouse repository. |
|
/cc @msvticket |
|
/ok-to-test |
|
/test pr |
|
Failing tests @TSnowden-1311 |
|
/test pr |
|
/test pr |
msvticket
left a comment
There was a problem hiding this comment.
This is not a problem I have seen, but if you say so... This will of course make for one big spurious diff after upgrade of jx-gitops.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: msvticket 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 |
|
@TSnowden-1311: The following test failed, say
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 jenkins-x/lighthouse repository. I understand the commands that are listed here. |
Changes
Add a sort in UpdateTagInYamlFiles after labels are added to keep result order consistent
Context
We see a lot of noise in PRs due to reordering of labels.. This is caused by the following scenarios
Scenario 1 — OUTPUT_DIR wiped (change outside helmfiles/)
get-selectors-and-clean.sh detects the change and runs rm -rf ${OUTPUT_DIR}///. Source-repository files are gone. jx gitops repository create writes fresh files — no pipeline label. post-build runs jx gitops label across all files, finds no existing label, calls addField which appends to the bottom.
before wipe (label at top)
labels:
gitops.jenkins-x.io/pipeline: 'namespaces'
owner: spring-financial-group
repository: acme
after post-build (label at bottom)
labels:
owner: spring-financial-group
repository: acme
gitops.jenkins-x.io/pipeline: 'namespaces'
Scenario 2 — OUTPUT_DIR not wiped (helmfiles-only change, selector run)
Source-repository files persist. jx gitops repository create runs — if spec changed, yamls.SaveFile serialises labels alphabetically, label sorts back to top. post-build finds the label, updates in-place.
before (label at bottom from scenario 1)
labels:
owner: spring-financial-group
repository: acme
gitops.jenkins-x.io/pipeline: 'namespaces'
after yamls.SaveFile alphabetical sort (label at top)
labels:
gitops.jenkins-x.io/pipeline: 'namespaces'
owner: spring-financial-group
repository: acme
Result — pipeline run flips the label across all 344 source-repository files, creating ~700 meaningless diff lines per chore: regenerated commit.