Skip to content

Conversation

@its-mitesh-kumar
Copy link
Member

Summary

This PR updates the quickstart plugin documentation links to dynamically use the current RHDH version instead of hardcoded /latest.

Problem

Documentation links in the quickstart plugin currently point to /latest, which always redirects to the newest version. Users running older RHDH versions (e.g., 1.6, 1.7) see documentation that may not match their installed version.

Solution

  • Replace /latest with ${RHDH_DOCS_VERSION:-latest} placeholder in:

    • dynamic-plugins.default.yaml (lines 507, 527)
    • app-config.yaml (line 58)
  • Add build-time substitution in docker/Dockerfile that extracts the major.minor version from package.json and replaces the placeholder

  • Update e2e tests to validate URLs with regex pattern matching both /latest and versioned paths (e.g., /1.9/)

How It Works

Environment Documentation URL Version
Local development (yarn dev) latest (fallback)
Docker build Actual version from package.json (e.g., 1.9)

Which issue(s) does this PR fix

PR acceptance criteria

Please make sure that the following steps are complete:

  • GitHub Actions are completed and successful
  • Unit Tests are updated and passing
  • E2E Tests are updated and passing
  • Documentation is updated if necessary (requirement for new features)
  • Add a screenshot if the change is UX/UI related

How to test changes / Special notes to the reviewer

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
@openshift-ci
Copy link

openshift-ci bot commented Jan 16, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zaperex 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

@rhdh-qodo-merge
Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

RHDHBUGS-1959 - Partially compliant

Compliant requirements:

  • Update the quickstart documentation link so it does not hardcode /latest
  • Validate the change via automated testing updates where applicable

Non-compliant requirements:

  • Ensure links remain valid across future releases (e.g., when 1.8 is released, 1.7 users should not be sent to 1.8 docs)

Requires further human verification:

  • Confirm the built image renders quickstart links pointing to the correct major.minor documentation path for the running version (and that the linked pages exist).
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🔒 No security concerns identified
⚡ Recommended focus areas for review

Build-time Bug

The YAML links use the placeholder ${RHDH_DOCS_VERSION}, but the Dockerfile substitution searches for ${RHDH_DOCS_VERSION:-latest}. As written, the build-time sed replacement likely will not replace anything, leaving the placeholder in the shipped URL.

    link: https://docs.redhat.com/en/documentation/red_hat_developer_hub/${RHDH_DOCS_VERSION}/html/authentication_in_red_hat_developer_hub/
- title: Configure RBAC
  titleKey: steps.configureRbac.title
  icon: Rbac
  description: Assign roles and permissions to control who can view, create, or edit resources, ensuring secure and
    efficient collaboration.
  descriptionKey: steps.configureRbac.description
  cta:
    text: Manage access
    textKey: steps.configureRbac.ctaTitle
    link: /rbac
- title: Configure Git
  titleKey: steps.configureGit.title
  icon: Git
  description: Connect your Git providers, such as GitHub to manage code, automate workflows, and integrate with platform
    features.
  descriptionKey: steps.configureGit.description
  cta:
    text: Learn more
    textKey: steps.configureGit.ctaTitle
    link: https://docs.redhat.com/en/documentation/red_hat_developer_hub/${RHDH_DOCS_VERSION}/html/integrating_red_hat_developer_hub_with_github/
- title: Manage plugins
Incomplete Substitution

The Docker build step only applies substitution to dynamic-plugins.default.yaml. If the same placeholder is also present in other config files (as described in the PR summary), those won’t be replaced and may ship with unresolved placeholders.

# Replace ${RHDH_DOCS_VERSION:-latest} placeholder with actual version (major.minor) from package.json
RUN RHDH_DOCS_VERSION=$(node -p "require('./package.json').version.split('.').slice(0,2).join('.')") && \
  sed -i "s/\${RHDH_DOCS_VERSION:-latest}/$RHDH_DOCS_VERSION/g" dynamic-plugins.default.yaml
Test Coverage Gap

The e2e assertions were weakened from checking the full expected path (including /latest/...) to checking only the documentation base path. This could allow regressions where the link points to the wrong doc page or an incorrect version path, while still passing.

// URL version is replaced at build time from package.json (e.g., "1.9")
await uiHelper.verifyButtonURL(
  "Learn more",
  "docs.redhat.com/en/documentation/red_hat_developer_hub/",
  { exact: false },
);
await uiHelper.clickButtonByText("Configure RBAC");
await uiHelper.verifyButtonURL("Manage access", "/rbac");
await uiHelper.clickButtonByText("Configure Git");
// URL version is replaced at build time from package.json (e.g., "1.9")
await uiHelper.verifyButtonURL(
  "Learn more",
  "docs.redhat.com/en/documentation/red_hat_developer_hub/",
  { exact: false },
📄 References
  1. No matching references available

@rhdh-qodo-merge
Copy link

PR Type

Enhancement


Description

  • Replace hardcoded /latest with dynamic ${RHDH_DOCS_VERSION} placeholder in documentation URLs

  • Add Docker build-time substitution to extract major.minor version from package.json

  • Update e2e tests to use flexible URL matching for versioned documentation paths


File Walkthrough

Relevant files
Enhancement
dynamic-plugins.default.yaml
Replace hardcoded latest with dynamic version placeholder

dynamic-plugins.default.yaml

  • Replace /latest with ${RHDH_DOCS_VERSION} placeholder in
    authentication setup link (line 509)
  • Replace /latest with ${RHDH_DOCS_VERSION} placeholder in Git
    configuration link (line 529)
+2/-2     
Dockerfile
Add build-time version substitution logic                               

docker/Dockerfile

  • Add build-time variable extraction of major.minor version from
    package.json
  • Use sed to replace ${RHDH_DOCS_VERSION:-latest} placeholder with
    actual version in dynamic-plugins.default.yaml
+4/-0     
Tests
quick-start.spec.ts
Update e2e tests for flexible URL matching                             

e2e-tests/playwright/e2e/plugins/quick-start.spec.ts

  • Update authentication documentation URL test to use flexible matching
    without version suffix
  • Update Git configuration documentation URL test to use flexible
    matching without version suffix
  • Add comments explaining that URL version is replaced at build time
    from package.json
+4/-2     

@sonarqubecloud
Copy link

@rhdh-qodo-merge
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Fix incorrect placeholder in sed command

Correct the sed command in the Dockerfile to use the placeholder
${RHDH_DOCS_VERSION} instead of ${RHDH_DOCS_VERSION:-latest} to match the
target file.

docker/Dockerfile [125-126]

 RUN RHDH_DOCS_VERSION=$(node -p "require('./package.json').version.split('.').slice(0,2).join('.')") && \
-  sed -i "s/\${RHDH_DOCS_VERSION:-latest}/$RHDH_DOCS_VERSION/g" dynamic-plugins.default.yaml
+  sed -i "s/\${RHDH_DOCS_VERSION}/$RHDH_DOCS_VERSION/g" dynamic-plugins.default.yaml
  • Apply / Chat
Suggestion importance[1-10]: 10

__

Why: The suggestion correctly identifies a critical bug where the sed command uses a placeholder that doesn't exist in the target file, which would cause the PR's core functionality to fail.

High
Fail build on empty version

Add a check in the Dockerfile to ensure the RHDH_DOCS_VERSION variable is not
empty and fail the build if it is.

docker/Dockerfile [125-126]

 RUN RHDH_DOCS_VERSION=$(node -p "require('./package.json').version.split('.').slice(0,2).join('.')") && \
+  [ -n "$RHDH_DOCS_VERSION" ] || (echo "ERROR: unable to determine docs version" >&2; exit 1) && \
   sed -i "s/\${RHDH_DOCS_VERSION:-latest}/$RHDH_DOCS_VERSION/g" dynamic-plugins.default.yaml
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: This suggestion improves the robustness of the Docker build by adding a check to ensure the version was extracted correctly, preventing silent failures.

Low
General
Assert full dynamic URL

Improve the E2E test by dynamically importing the version from package.json and
asserting the full, versioned URL to ensure the replacement was successful.

e2e-tests/playwright/e2e/plugins/quick-start.spec.ts [45-50]

-// URL version is replaced at build time from package.json (e.g., "1.9")
+import pkg from '../../../package.json';
+const docsVersion = pkg.version.split('.').slice(0,2).join('.');
 await uiHelper.verifyButtonURL(
   "Learn more",
-  "docs.redhat.com/en/documentation/red_hat_developer_hub/",
+  `https://docs.redhat.com/en/documentation/red_hat_developer_hub/${docsVersion}/html/authentication_in_red_hat_developer_hub/`,
   { exact: false },
 );
  • Apply / Chat
Suggestion importance[1-10]: 7

__

Why: The suggestion correctly points out that the E2E test is weakened and proposes a robust way to verify the dynamic version replacement is working as expected.

Medium
  • More

@its-mitesh-kumar its-mitesh-kumar changed the title feat(quickstart): Dynamic version in documentation URLs feat(quickstart): dynamic version of rhdh in documentation links Jan 16, 2026
@github-actions
Copy link
Contributor

The image is available at:

/test e2e-ocp-helm

@openshift-ci
Copy link

openshift-ci bot commented Jan 16, 2026

@its-mitesh-kumar: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-ocp-helm 0cd92f7 link true /test e2e-ocp-helm

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

-e "s/(\"Last Commit\": \"(.+)\")/\1, \"Build Time\": \"$now\"/" && \
cat packages/app/src/build-metadata.json; echo

# Replace ${RHDH_DOCS_VERSION:-latest} placeholder with actual version (major.minor) from package.json
Copy link
Member

Choose a reason for hiding this comment

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

if doing this in docker/Dockerfile should do the same in .rhdh/docker/Dockerfile too... but there we have metadata which defines the version of RHDH. Why do you need a different version here for the DOCS of the RHDH version? Surely they're the same since the docs use the same value in https://github.com/redhat-developer/red-hat-developers-documentation-rhdh/blob/main/artifacts/attributes.adoc#L16 ?

await uiHelper.verifyButtonURL(
"Learn more",
"https://docs.redhat.com/en/documentation/red_hat_developer_hub/latest/html/integrating_red_hat_developer_hub_with_github/",
"docs.redhat.com/en/documentation/red_hat_developer_hub/",
Copy link
Member

Choose a reason for hiding this comment

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

why remove the https:// and the suffix to the actual page?

Copy link
Member

@nickboldt nickboldt left a comment

Choose a reason for hiding this comment

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

changes to DPDY will be overwritten by the downstream plugin-catalog repo processes and the GH action https://github.com/redhat-developer/rhdh/actions/workflows/update-dynamic-plugins-default.yaml

Updating the docker/Dockerfile without also updating the .rhdh/docker/Dockerfile is a bad idea.

link: https://docs.redhat.com/en/documentation/red_hat_developer_hub/${RHDH_DOCS_VERSION}/html/integrating_red_hat_developer_hub_with_github/
- title: Manage plugins
titleKey: steps.managePlugins.title
icon: Plugins
Copy link
Member

Choose a reason for hiding this comment

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

The DPDY file (dynamic-plugins.default.yaml) file is generated downstream in the https://gitlab.cee.redhat.com/rhidp/rhdh-plugin-catalog/-/blob/rhdh-1-rhel-9/build/scripts/generateDynamicPluginsDefaultYaml.py

If you would like to embed a version, we can do it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants