Skip to content
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

Sort artifact changesets by name. #3485

Merged
merged 2 commits into from
Sep 11, 2024
Merged

Conversation

mitchell-as
Copy link
Contributor

@mitchell-as mitchell-as commented Sep 10, 2024

StoryDX-3028 Requirement ordering is consistent

Unfortunately, it's not as simple as sorting buildplan artifacts once and you're done. For example, the DiffArtifacts() function creates a map of artifacts, which is inherently unsorted, so we have to sort it after the fact. (It doesn't matter whether or not the incoming artifacts are sorted.) Other functions throughout the codebase have the capability to do something similar (if they do not already). We could either:

  1. Identify and rewrite all functions that utilize artifacts, ingredients, and requirements to be mindful of sort order, and keep this in mind for all future functions we write.
  2. Sort as needed, attempting to capture the largest number of use cases at as high a level as possible.

This PR chooses option 2, which sorts the DiffArtifacts() output. This results in CVE lists, change summary lists, and state upgrade lists outputting sorted lists of artifacts.

@mitchell-as mitchell-as requested a review from Naatan September 11, 2024 18:26
@mitchell-as mitchell-as marked this pull request as ready for review September 11, 2024 18:26
Copy link
Member

@Naatan Naatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your solution. Handling this at a low level and accepting there might still be edge cases was basically the approach of the story anyway.

@mitchell-as mitchell-as merged commit e3bcadd into version/0-47-0-RC1 Sep 11, 2024
7 of 8 checks passed
@mitchell-as mitchell-as deleted the mitchell/dx-3028 branch September 11, 2024 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants