Skip to content

[release-v1.22.x] SRVKP-12189: Remove TektonHub integration from pipelines task catalog and quick search#1137

Open
openshift-cherrypick-robot wants to merge 1 commit into
openshift-pipelines:release-v1.22.xfrom
openshift-cherrypick-robot:cherry-pick-1095-to-release-v1.22.x
Open

[release-v1.22.x] SRVKP-12189: Remove TektonHub integration from pipelines task catalog and quick search#1137
openshift-cherrypick-robot wants to merge 1 commit into
openshift-pipelines:release-v1.22.xfrom
openshift-cherrypick-robot:cherry-pick-1095-to-release-v1.22.x

Conversation

@openshift-cherrypick-robot

Copy link
Copy Markdown

This is an automated cherry-pick of #1095

/assign anwesha-palit-redhat

@openshift-ci-robot

openshift-ci-robot commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

@openshift-cherrypick-robot: Ignoring requests to cherry-pick non-bug issues: SRVKP-12189

Details

In response to this:

This is an automated cherry-pick of #1095

/assign anwesha-palit-redhat

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.

@openshift-ci

openshift-ci Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: openshift-cherrypick-robot
Once this PR has been reviewed and has the lgtm label, please assign anwesha-palit-redhat for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (4) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. ArtifactHub install URL missing 🐞 Bug ≡ Correctness
Description
ArtifactHub create/update now hard-fails when the task content URL is missing, but the ArtifactHub
catalog provider still calls create/update using selectedItem.attributes.selectedVersionContentUrl
which is not populated on that path, so installs/updates can fail at runtime.
Code

src/components/catalog/apis/artifactHub.ts[R108-112]

+  if (!url || typeof url !== 'string') {
+    return Promise.reject(
+      new Error('ArtifactHub task content URL is missing or invalid'),
+    );
+  }
Evidence
The provider CTA callback sources the URL from selectedVersionContentUrl, but the only code that
sets that attribute is the quick-search details panel; meanwhile the create/update APIs now
explicitly fail if the URL is missing or not a string.

src/components/catalog/apis/artifactHub.ts[101-164]
src/components/catalog/providers/useArtifactHubTasksProvider.tsx[57-104]
src/components/task-quicksearch/PipelineQuickSearchDetails.tsx[63-114]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`createArtifactHubTask` / `updateArtifactHubTask` now reject/throw when `url` is missing, but the ArtifactHub catalog item provider’s CTA callback still passes `selectedItem.attributes.selectedVersionContentUrl` (often unset), causing install/update to fail.

### Issue Context
The quick-search details panel populates `selectedVersionContentUrl` via `getArtifactHubTaskDetails`, but the catalog provider CTA callback does not.

### Fix Focus Areas
- src/components/catalog/providers/useArtifactHubTasksProvider.tsx[57-104]
- src/components/catalog/apis/artifactHub.ts[101-164]

### Expected fix
In the CTA callback in `normalizeArtifactHubTasks`, compute a valid `selectedVersionUrl` before calling `createArtifactHubTask`/`updateArtifactHubTask`:
- Prefer `selectedItem.attributes.selectedVersionContentUrl` when present and matches the selected version.
- Otherwise call `getArtifactHubTaskDetails(selectedItem, selectedVersion, isDevConsoleProxyAvailable)` and use `content_url`.
- If URL still missing, fail fast and surface an actionable error (and avoid resolving the pipeline-builder callback before the task import/update is actually started/validated).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. ArtifactHub search gated too early 🐞 Bug ☼ Reliability
Description
QuickSearchModalBody gates ArtifactHub search on artifactHubIntegrationStatus only and ignores the
hook’s loaded state, so searches executed while TektonConfig is still loading will omit ArtifactHub
results and won’t automatically refetch when the integration state becomes known.
Code

src/components/quick-search/QuickSearchModalBody.tsx[R169-172]

+        artifactHubIntegrationStatus
+          ? fetchArtifactHubTasks(value) // only fetch artifact hub tasks if the integration is enabled
+          : Promise.resolve([]), // if the integration is disabled, return an empty array
        searchCatalog(value),
Evidence
useHubIntegration returns [false,false] until TektonConfig is loaded, but QuickSearchModalBody
only reads the first element and therefore skips the ArtifactHub fetch during that window.

src/components/quick-search/QuickSearchModalBody.tsx[60-173]
src/components/catalog/catalog-utils.ts[155-175]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
ArtifactHub quick-search results can be missing if the user searches before `useHubIntegration()` finishes loading (it returns `[false,false]` until TektonConfig loads), because the search path only checks the first tuple value.

### Issue Context
This is a behavior change introduced by gating `fetchArtifactHubTasks` on `artifactHubIntegrationStatus`.

### Fix Focus Areas
- src/components/quick-search/QuickSearchModalBody.tsx[60-204]
- src/components/catalog/catalog-utils.ts[155-175]

### Expected fix
- Destructure both values: `const [enabled, loaded] = useHubIntegration();`
- If `!loaded`, either (a) delay artifact hub fetch until loaded and then re-run the current search term, or (b) treat “unknown” as enabled but cancel/redo once loaded.
- Ensure when `loaded` transitions to `true`, the current `searchTerm` is re-executed so ArtifactHub results appear without requiring extra typing.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Missing new i18n key 🐞 Bug ⚙ Maintainability
Description
The catalog description now references the new i18n key "Browse community tasks." but only the
English locale defines it; other locales still contain the removed TektonHub string, so non-English
UIs will display an untranslated fallback.
Code

console-extensions.json[R1466-1470]

    "properties": {
      "type": "Community",
      "title": "%plugin__pipelines-console-plugin~Community%",
-      "catalogDescription": "%plugin__pipelines-console-plugin~Browse tekton hub tasks.%"
+      "catalogDescription": "%plugin__pipelines-console-plugin~Browse community tasks.%"
    },
Evidence
The extension references the new key and English defines it, but at least Spanish still has only the
old TektonHub key in the same section, demonstrating the new key is not propagated.

console-extensions.json[1464-1470]
locales/en/plugin__pipelines-console-plugin.json[84-90]
locales/es/plugin__pipelines-console-plugin.json[84-90]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
A new translation key is referenced from `console-extensions.json`, but it is only present in the `en` locale.

### Issue Context
Non-English locale JSON files still include the old TektonHub-specific string key and do not include the new "Browse community tasks." key.

### Fix Focus Areas
- console-extensions.json[1464-1470]
- locales/en/plugin__pipelines-console-plugin.json[84-90]
- locales/es/plugin__pipelines-console-plugin.json[84-90]

### Expected fix
- Add "Browse community tasks." to all supported locale files (es/fr/ja/ko/zh, etc.) with appropriate translations.
- Optionally remove the unused "Browse tekton hub tasks." key from non-en locales for cleanliness (or leave it if other branches still reference it).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

4. TaskSidebar key may collide 🐞 Bug ☼ Reliability
Description
TaskSidebar’s remount key is created by concatenating multiple fields without separators, which can
collide for different selections (edge case) and prevent the intended remount, leaving stale sidebar
state.
Code

src/components/pipeline-builder/PipelineBuilderForm.tsx[R202-207]

+              // Intentional remount when selection changes
+              key={
+                selectedTask?.resource?.metadata?.name +
+                selectedTask?.taskIndex +
+                String(selectedTask?.isFinallyTask)
+              }
Evidence
The current key is derived from a concatenated string of multiple fields, and without delimiters
different tuples can stringify to the same value, which would break React’s key-based remount logic.

src/components/pipeline-builder/PipelineBuilderForm.tsx[199-207]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The TaskSidebar `key` is built by string concatenation without delimiters, making collisions possible (e.g., name/index combinations that stringify to the same value), which can prevent the intended remount.

### Issue Context
This key is explicitly relied on for “Intentional remount when selection changes”.

### Fix Focus Areas
- src/components/pipeline-builder/PipelineBuilderForm.tsx[199-207]

### Expected fix
Use a non-ambiguous key format, e.g.:
- Template with delimiters: ```${name ?? ''}::${taskIndex}::${isFinallyTask ? 'finally' : 'task'}```
- Or `JSON.stringify([name, taskIndex, isFinallyTask])`.
This preserves the remount behavior while eliminating accidental collisions.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment on lines +108 to +112
if (!url || typeof url !== 'string') {
return Promise.reject(
new Error('ArtifactHub task content URL is missing or invalid'),
);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Artifacthub install url missing 🐞 Bug ≡ Correctness

ArtifactHub create/update now hard-fails when the task content URL is missing, but the ArtifactHub
catalog provider still calls create/update using selectedItem.attributes.selectedVersionContentUrl
which is not populated on that path, so installs/updates can fail at runtime.
Agent Prompt
### Issue description
`createArtifactHubTask` / `updateArtifactHubTask` now reject/throw when `url` is missing, but the ArtifactHub catalog item provider’s CTA callback still passes `selectedItem.attributes.selectedVersionContentUrl` (often unset), causing install/update to fail.

### Issue Context
The quick-search details panel populates `selectedVersionContentUrl` via `getArtifactHubTaskDetails`, but the catalog provider CTA callback does not.

### Fix Focus Areas
- src/components/catalog/providers/useArtifactHubTasksProvider.tsx[57-104]
- src/components/catalog/apis/artifactHub.ts[101-164]

### Expected fix
In the CTA callback in `normalizeArtifactHubTasks`, compute a valid `selectedVersionUrl` before calling `createArtifactHubTask`/`updateArtifactHubTask`:
- Prefer `selectedItem.attributes.selectedVersionContentUrl` when present and matches the selected version.
- Otherwise call `getArtifactHubTaskDetails(selectedItem, selectedVersion, isDevConsoleProxyAvailable)` and use `content_url`.
- If URL still missing, fail fast and surface an actionable error (and avoid resolving the pipeline-builder callback before the task import/update is actually started/validated).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-code-review qodo-code-review Bot added documentation Improvements or additions to documentation enhancement New feature or request Tests labels Jun 22, 2026
@anwesha-palit-redhat anwesha-palit-redhat requested review from arvindk-softwaredev and removed request for pratap0007 and vdemeester June 22, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold documentation Improvements or additions to documentation enhancement New feature or request Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants