SRVKP-11799: tekton hub integration removal from pipelines console-plugin#1135
SRVKP-11799: tekton hub integration removal from pipelines console-plugin#1135arvindk-softwaredev wants to merge 1 commit into
Conversation
|
@arvindk-softwaredev: This pull request references SRVKP-11799 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this: Instructions 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 openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: arvindk-softwaredev 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 |
Code Review by Qodo
1. Browse community tasks. missing locales
|
| if (item.attributes.selectedVersionForContentUrl !== version) { | ||
| return null; | ||
| } | ||
|
|
||
| return item.attributes.selectedVersionContentUrl ?? null; |
There was a problem hiding this comment.
2. Selected version url regresses 🐞 Bug ≡ Correctness
getSelectedVersionUrl now returns a URL only when attributes.selectedVersionForContentUrl matches the requested version, but no code in the PR sets selectedVersionForContentUrl and the updated test sets only selectedVersionContentUrl. This makes getSelectedVersionUrl return null for the new test fixture and causes PipelineQuickSearch to always fall back to getArtifactHubTaskDetails on CTA clicks.
Agent Prompt
### Issue description
`getSelectedVersionUrl()` now requires `item.attributes.selectedVersionForContentUrl === version` but no call site sets `selectedVersionForContentUrl`. As a result, the helper always returns `null` for items that only populate `selectedVersionContentUrl` (including the updated unit test), and the PipelineQuickSearch CTA path always triggers an extra ArtifactHub details fetch.
### Issue Context
- `PipelineQuickSearchDetails` sets `selectedVersionContentUrl` from ArtifactHub details responses, but does not record which version that URL corresponds to.
- The updated unit test expects `getSelectedVersionUrl()` to return the URL when only `selectedVersionContentUrl` is set.
### Fix Focus Areas
- src/components/task-quicksearch/pipeline-quicksearch-utils.ts[103-115]
- src/components/task-quicksearch/PipelineQuickSearchDetails.tsx[61-74]
- src/components/task-quicksearch/PipelineQuickSearchDetails.tsx[89-105]
- src/components/task-quicksearch/PipelineQuickSearch.tsx[128-142]
- src/components/task-quicksearch/__tests__/pipeline-quicksearch-utils.spec.ts[244-266]
### What to change
1. Whenever setting `selectedVersionContentUrl`, also set `selectedVersionForContentUrl` to the version it was fetched for (both initial-load and dropdown-change paths).
2. In `PipelineQuickSearch.tsx`, after fetching `details.content_url`, persist it back onto the item (`selectedVersionContentUrl` + `selectedVersionForContentUrl`) so subsequent clicks can reuse it.
3. Update the unit test to set `selectedVersionForContentUrl` along with `selectedVersionContentUrl` (or adjust `getSelectedVersionUrl` semantics if you intentionally don’t want the guard).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
addressed in latest commit
fb7d9bf to
7978623
Compare
|
Code review by qodo was updated up to the latest commit 7978623 |
| const target = e.target as HTMLElement; | ||
| const modalBody = ref.current?.parentElement; | ||
| /*Fix to avoid modal close on select of version dropdown*/ | ||
| if (target.closest?.('.opp-quick-search-details__version-dropdown')) |
There was a problem hiding this comment.
nit: let us update the classname to something specific to OSP console plugin ?
There was a problem hiding this comment.
updated to use id selector specific to OSP console plugin
7978623 to
0918a6c
Compare
Summary
Removed all Tekton Hub integration code and consolidate the community task catalog to exclusively use Artifact Hub as the external task source.
Tekton Hub has been deprecated and this PR cleans up all references, APIs, types, models, and test data associated with it, replacing them with Artifact Hub equivalents where applicable.
Changes
Removed
Updated
useHubIntegration(renamed from useTektonHubIntegration) now returns [boolean, boolean] (integration status + loaded state), preventing Artifact Hub fetches before the TektonConfig is loadedPipelineQuickSearchcallback simplified — removed Tekton Hub branching; Artifact Hub tasks now lazily fetch content_url via getArtifactHubTaskDetails when a selected version URL isn't already cachedPipelineQuickSearchDetails— added detailsLoaded state to disable the CTA button while Artifact Hub details are being fetched; removed the "Read more" hub link; fixed the useEffect cleanup (returned proper cleanup function instead of commented-out code)QuickSearchModalBody— fixed outside-click handler to ignore clicks inside the version dropdown (prevents accidental modal close)quick-search-utils— reordered spread in handleCta so callbackProps overrides defaults (ensures the correct selectedVersion is passed)PipelineQuickSearchVersionDropdown— replaced TektonHubTaskVersion type with a generic local TaskVersion typegetSelectedVersionUrl— now checks selectedVersionForContentUrl matches the requested version before returning the cached URL (prevents stale URL usage)findInstalledTask— only matches tasks annotated as installed from Artifact Hub (removed Tekton Hub annotation check)isInstalledNamespaceTask— annotation check updated from Tektonhub to ArtifactHubHUB_INTEGRATION_KEYconstant moved to src/consts.ts for shared accessScreen Recordings
SRVKP-11799-part1.mov
SRVKP-11799-part2.mov