Change default sort order of CI/CD component inputs
What does this MR do and why?
Component inputs were sorted by input-name length instead of
their order in the YAML spec:inputs: block. The spec jsonb column
reorders object keys by length, so the name-keyed inputs hash lost its
order on persistence.
Inputs are now stored as an ordered array instead, since jsonb preserves array element order. Publishing the components now records the declared order in a server-owned spec['inputs_order'] array, and the GraphQL resolver orders the inputs by it. The inputs object itself is unchanged. This MR only adds a sibling key, so there is no new-vs-legacy shape to migrate away from later.
In a follow-up MR, we will implement the backfill mechanism, see Backfill existing CI/CD Catalog component input... (#619182)
References
Screenshots or screen recordings
| Sorted by length | Sorted by order in yaml file |
|---|---|
![]() |
![]() |
How to set up and validate locally
- In any project, add a component template under
templates/whosespec:inputs:are intentionally out of length order, e.g.:
spec:
inputs:
bazbazbaz:
foo:
barbar:
---
image: alpine- Enable
Settings → CI/CD → Catalogresource, then publish a release (tag) so a version is created. - Open
Explore → CI/CD Catalog → your componentand confirm the Inputs table lists them in YAML order (bazbaz,foo,barbar) not by name length.
MR acceptance checklist
MR Checklist ( @nwittstruck)
- Changelog entry added, if necessary
- Documentation created/updated via this MR
- Documentation reviewed by technical writer or follow-up review issue created
- Tests added for this feature/bug
- Tested in all supported browsers
- Conforms to the code review guidelines
- Conforms to the merge request performance guidelines
- Conforms to the style guides
- Conforms to the javascript style guides
- Conforms to the database guides
Related to #550261 (closed)

