Skip to content

test: add CI check for frontend auth provider visibility - #358

Open
Fortune-Ndlovu wants to merge 1 commit into
redhat-developer:devfrom
Fortune-Ndlovu:test/validate-sign-in-page
Open

Fortune-Ndlovu wants to merge 1 commit into
redhat-developer:devfrom
Fortune-Ndlovu:test/validate-sign-in-page

Conversation

@Fortune-Ndlovu

@Fortune-Ndlovu Fortune-Ndlovu commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

This PR adds a CI step that verifies the frontend-injected config (<script type="backstage.io/config">) exposes at least one auth provider after RHDH starts.

Jira: https://redhat.atlassian.net/browse/RHDHBUGS-4049

@openshift-ci
openshift-ci Bot requested review from gazarenkov and rm3l October 23, 2026 13:45
@rhdh-qodo-merge

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Validate guest authentication in Compose CI

🧪 Tests 🕐 10-20 Minutes


AI Description

• Check guest authentication after the homepage becomes available in Compose CI.
• Fail the run when the refresh endpoint errors or returns no Backstage identity token.
Diagram

graph TD
  CI["Compose CI"] --> Start["Start RHDH"] --> Home["Homepage check"] --> Auth["Guest refresh API"] --> Token{"Token present?"}
  Token -->|Yes| Pass["Continue tests"]
  Token -->|No| Fail["Fail run"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Rely on the loaded-plugins validation
  • ➕ Its existing script already requests and checks a guest identity token.
  • ➖ It runs later and can exit without checking authentication when no plugins are selected for validation.
  • ➖ An auth failure would be reported within an unrelated plugin check.

Recommendation: Keep the dedicated early check: it makes guest authentication a direct CI requirement and gives failures a clear location. This verifies the backend guest endpoint, not the sign-in page UI itself.

Files changed (1) +7 / -0

Tests (1) +7 / -0
action.yamlAdd a guest-auth smoke check after homepage readiness +7/-0

Add a guest-auth smoke check after homepage readiness

• Adds a composite-action step that requests the guest refresh endpoint and requires a non-null Backstage identity token. The step follows the existing homepage check and respects SKIP_TEST, so applicable Compose runs fail before later validations if guest authentication is unavailable.

.github/actions/rhdh-local-compose-test/action.yaml

@rhdh-qodo-merge

rhdh-qodo-merge Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🔗 Cross-repo conflicts (1)



View low (1)
🟡 **Low**
1. Guest auth check may reject RHDH 🔗 Cross-repo conflict
Description
The new curl request sends Accept but omits X-Requested-With: XMLHttpRequest when calling the
RHDH guest refresh endpoint. RHDH’s test client sends that header and its unit test identifies it as
required, so the check may fail against a working provider.
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 guest refresh request omits the header identified as required by RHDH's test client.
## Fix Focus Areas
- .github/actions/rhdh-local-compose-test/action.yaml[301-301]
- tests/validate-loaded-plugins.sh[145-148]
## Recommended Fix
Add `-H "X-Requested-With: XMLHttpRequest"` to the new curl request. Check the existing guest-refresh request in the plugin validation script for the same compatibility requirement.

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

Dismiss ↗ | View ↗



Resolved findings
1. Sign-in failures pass the check ✓ Resolved
Description
The new CI step treats a token from /api/auth/guest/refresh as proof that the RHDH sign-in page
offers a provider, but that endpoint checks only the backend guest provider, not the frontend
signInPage selection. If the frontend omits or fails to render the guest option, the step can
remain green—even when the page says “No authentication providers are configured”—while the later
loaded-plugins check also obtains and uses a token from the same endpoint.
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 backend guest token does not establish that RHDH displays a usable sign-in provider, and the existing loaded-plugins validation already obtains a guest token.

## Fix Focus Areas
- .github/actions/rhdh-local-compose-test/action.yaml[296-301]
- .github/actions/rhdh-local-compose-test/action.yaml[310-312]
- configs/app-config/app-config.yaml[1-7]
- tests/validate-loaded-plugins.sh[148-156]

## Recommended Fix
Add a browser-level check that loads the sign-in page, verifies the guest option is presented, and completes sign-in; alternatively, validate the effective frontend provider selection alongside the backend token. Configure `signInPage` explicitly for guest if that is the intended provider, and keep the new endpoint check only if it provides coverage distinct from the existing loaded-plugins validation.

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



@rhdh-qodo-merge

Copy link
Copy Markdown
Contributor

Important

The /generate_labels command by Qodo was deprecated on the 1st of October 2026 and is no longer available. We recommend switching to the latest Qodo review capabilities. Learn more

@Fortune-Ndlovu
Fortune-Ndlovu force-pushed the test/validate-sign-in-page branch 3 times, most recently from 67d9fd6 to a3615de Compare October 23, 2026 14:07
Comment thread .github/actions/rhdh-local-compose-test/action.yaml Fixed
@Fortune-Ndlovu
Fortune-Ndlovu force-pushed the test/validate-sign-in-page branch from a3615de to 33d3ca8 Compare October 23, 2026 14:12
@Fortune-Ndlovu Fortune-Ndlovu changed the title test: add sign-in page auth provider validation to CI fix: enable guest auth sign-in and add CI validation for RHDH 2.x Oct 23, 2026
@Fortune-Ndlovu
Fortune-Ndlovu force-pushed the test/validate-sign-in-page branch from 33d3ca8 to bce9719 Compare October 23, 2026 14:23
@Fortune-Ndlovu

Copy link
Copy Markdown
Member Author

/agentic_review

@Fortune-Ndlovu
Fortune-Ndlovu force-pushed the test/validate-sign-in-page branch from bce9719 to 70f1799 Compare October 23, 2026 15:39
@Fortune-Ndlovu Fortune-Ndlovu changed the title fix: enable guest auth sign-in and add CI validation for RHDH 2.x test: add CI check for frontend auth provider visibility Oct 23, 2026
Adds a step that verifies the frontend-injected config exposes at least
one auth provider after RHDH starts. This catches regressions where the
sign-in page shows 'No authentication providers are configured' even
though the backend is healthy.

Ref: https://redhat.atlassian.net/browse/RHDHBUGS-3962

Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
@Fortune-Ndlovu
Fortune-Ndlovu force-pushed the test/validate-sign-in-page branch from 70f1799 to 9780b0f Compare October 23, 2026 15:40
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants