[Konflux] Fix Latest Releases not shown when applications field is omitted or uses wildcard patterns.#2873
Conversation
Move globToRegex and matchesApplicationPattern from konflux-backend to konflux-common so both frontend and backend can reuse them.
…s wildcards The frontend was requiring the applications field to be present and non-empty, silently discarding configs when it was omitted. It was also doing literal string matching instead of glob pattern matching.
Add changesets with the changes made for konflux and konflux-backend plugins.
Code Review by Qodo
1. Missing fetch-all regression test
|
Changed Packages
|
Review Summary by QodoFix Latest Releases display with omitted or wildcard applications
WalkthroughsDescription• Move glob pattern matching utilities to shared common package • Fix Latest Releases card not showing when applications field omitted • Support wildcard patterns in application filtering logic • Add comprehensive tests for pattern matching functionality Diagramflowchart LR
A["konflux-backend<br/>kubernetes.ts"] -->|"remove duplicate<br/>pattern logic"| B["konflux-common<br/>patterns.ts"]
B -->|"export utilities"| C["konflux-common<br/>index.ts"]
C -->|"import<br/>matchesApplicationPattern"| D["konflux<br/>LatestReleasesList"]
C -->|"import<br/>matchesApplicationPattern"| E["konflux-backend<br/>kubernetes.ts"]
D -->|"handle omitted &<br/>wildcard patterns"| F["Latest Releases<br/>Display Fixed"]
File Changes1. workspaces/konflux/plugins/konflux-common/src/patterns.ts
|
Run 'yarn build:api-reports:only' to update api references.
|
milantaky
left a comment
There was a problem hiding this comment.
Left a small nit, otherwise releases show as expected with no applications, pattern, and exact name:)
|
|
||
| const sortedReleases = safeToSorted(filteredReleases, compareFn); | ||
|
|
||
| if (!sortedReleases?.length) return null; |
There was a problem hiding this comment.
nit: I think this check isn't necessary since the length is checked on filteredReleases and the sort function doesn't remove any items :)
There was a problem hiding this comment.
good catch! in theory it does not need, but I did that check just to "shut up Typescript" :D



Hey, I just made a Pull Request!
Description
In this PR we're fixing a bug where the "Latest Releases" card (shown in Overview tab) was not showing any release when the
applicationsfield was omitted or used wildcard patterns.Fixes https://redhat.atlassian.net/browse/KFLUXUI-1230
How to test it?
konflux-ci.dev/clusterseither have anapplicationsfield that uses wildcard patterns or ommit theapplicationsfield. Example:OverviewtabKonflux Latest ReleasesUI component should show the latest release given your configVisual references
Before:
konflux-plugin-latest-release-ISSUE.mov
After:
konflux-plugin-latest-release-FIX.mov
✔️ Checklist