Order workflows alphabetically in credential revoke dialog#4955
Open
elias-ba wants to merge 2 commits into
Open
Order workflows alphabetically in credential revoke dialog#4955elias-ba wants to merge 2 commits into
elias-ba wants to merge 2 commits into
Conversation
The query behind the "this credential is in use by the following workflows" confirmation had no explicit ordering, so with a distinct select the workflow names came back in an arbitrary, unstable order. Add an order-by so the dialog lists them alphabetically and predictably.
Security Review ✅
|
Add unit tests for project_workflows_using_credentials/1, which had no coverage, exercising grouping, credential filtering, and the sorted result. Keep the credential dialog test order-insensitive, since the ordering guarantee belongs to the query, not the rendered view. Move the changelog note to Changed: the previous order was left to the database rather than being broken, so this makes the alphabetical sort explicit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Small cleanup, not a user-visible fix.
The query behind the credential revoke-access dialog ("this credential is in use by the following workflows: ...") selects distinct workflow names with no explicit ordering, so the order was left to the database. In practice it already comes out alphabetical as a side effect of how the distinct is executed, but that is an implementation detail, not a guarantee. This adds an explicit order-by so the alphabetical order is guaranteed rather than incidental.
It also adds unit tests for
project_workflows_using_credentials/1, which previously had none, covering how it groups results by project, filters by credential, and returns the names sorted.Note: a test cannot meaningfully prove the order-by is doing anything, because the database sorts on its own at test-scale data. The added tests assert the function's contract (grouping, filtering, sorted result); they are not a regression guard for the ordering specifically.
Closes #4954
Validation steps
Additional notes for the reviewer
AI Usage
Please disclose whether you've used AI anywhere in this PR (it's cool, we just
want to know!):
You can read more details in our
Responsible AI Policy
Pre-submission checklist
/reviewwith Claude Code):owner,:admin,:editor,:viewer)