Skip to content

chore(ui): use ROX_BASE_URL if available - #23377

Open
porridge wants to merge 5 commits into
masterfrom
porridge/ui-start-target
Open

porridge wants to merge 5 commits into
masterfrom
porridge/ui-start-target

Conversation

@porridge

@porridge porridge commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Description

To make it easier to use roxie when developing UI.

Part of https://redhat.atlassian.net/browse/ROX-37563

User-facing documentation

Testing and quality

  • the change is production ready: the change is GA, or otherwise the functionality is gated by a feature flag
  • CI results are inspected

Automated testing

  • not modified any existing tests

How I validated my change

[ui]$ roxie deploy
[...]
00:01 ┌────────────────────────────────────────────────────────────┐
00:01 │ Deployment Configuration                                   │
00:01 ├────────────────────────────────────────────────────────────┤
00:01 │              Component: Central                            │
00:01 │           Cluster Type: Kind                               │
00:01 │              Image Tag: 5.1.x-231-gcd4e2f75dc              │
00:01 │     Kubernetes Context: kind-kind                          │
00:01 │               Exposure: none                               │
00:01 │        Port Forwarding: Enabled (localhost:8443)           │
00:01 └────────────────────────────────────────────────────────────┘
[...]
02:12 ✓ Resource deployment/central in namespace acs-central is ready
02:12 Resource deployment/central is now ready.
02:12 ✓ Port-forward active at https://127.0.0.1:8443
02:12 Fetching internal CA certificate from central-tls secret...
02:12 ✓ CA certificates saved to: /tmp/nix-shell.XmMtVq/nix-shell.z40lKD/roxie-deployer-1738785981/roxie-central-ca-950786242.pem
02:12 ✓ Central is ready at: 127.0.0.1:8443
02:12 ✓ Admin password: xxxxxxxxxxxxxxxxxxxx
02:12 Deploying SecuredCluster to namespace acs-sensor
[...]
02:33 ✓ SecuredCluster 'sensor-1229' is ready
02:33 🎉 Deployment complete!
02:33 ⏳ Waiting for Central to be ready at 127.0.0.1:8443 (timeout: 5m0s)
02:33 ✓ Central is ready and responding!
02:33 roxie manifest secret applied
02:33 No HAProxy available, skipping
02:33 Spawning sub-shell: /bin/bash

[roxie] Entering a subshell with ACS environment variables set.
[roxie]
[roxie] Environment is set up for talking to ACS Central. Examples:
[roxie]
[roxie]   * roxctl central whoami
[roxie]   * roxcurl /v1/clusters
[roxie]
[roxie] Note: Installing haproxy enables automatic HTTP access to Central through a forwarded local port

[ui]$ ulimit -n
4096
[ui]$ npm run start

> @stackrox/ui@0.0.0 start
> CI=true npm --prefix apps/platform run start


> @stackrox/platform-app@0.0.0 start
> vite serve

Falling back to basic SSL for development server
It is recommended to generate local certificates for secure development instead

  VITE v6.4.2  ready in 126 ms

  ➜  Local:   https://localhost:3000/
  ➜  Network: use --host to expose
Browserslist: browsers data (caniuse-lite) is 9 months old. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme

And accessing localhost:3000 works as expected (modulo untrusted cert warning).

@openshift-ci

openshift-ci Bot commented Oct 13, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Central YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a2d8bbbb-a022-4775-8694-3be38dbfab1f
📥 Commits

Reviewing files that changed from the base of the PR and between f6d059a and a61c987.

📒 Files selected for processing: 1
  • ui/apps/platform/README.md
🚧 Files skipped from review as they are similar to previous changes: 1
  • ui/apps/platform/README.md

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Summary

Summary by CodeRabbit

  • New Features

    • The development server now uses ROX_BASE_URL as the API proxy endpoint when UI_START_TARGET is unset. The default remains https://localhost:8000.
  • Documentation

    • Updated setup guidance to explain endpoint selection and that roxie sets ROX_BASE_URL automatically.
    • Added troubleshooting guidance with an example proxy connection-refused error.

The platform development proxy now uses ROX_BASE_URL when UI_START_TARGET is unset, before falling back to https://localhost:8000. The UI documentation describes this option and notes that roxie sets ROX_BASE_URL automatically.

Changes: Proxy target configuration

Layer / File(s) Summary
Proxy fallback and documentation
ui/apps/platform/src/setupProxy.js, ui/apps/platform/README.md, ui/README.md
The proxy checks ROX_BASE_URL after UI_START_TARGET and before the localhost default. The documentation describes the fallback and roxie environment behavior.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Suggested reviewers: dvail

Merge Risk: ⚪ Minimal · up to a61c9

No merge-blocking issue is identified; normal checks remain appropriate.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main code change: using ROX_BASE_URL as an available UI proxy target.
Description check Passed The description includes the required sections, explains the purpose, links the tracking issue, records documentation status, describes testing status, and provides detailed manual validation. The CI …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes the required sections, explains the purpose, links the tracking issue, records documentation status, describes testing status, and provides detailed manual validation. The CI inspection checkbox is not selected, but the description is otherwise sufficiently complete.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 51.97%. Comparing base (d40c053) to head (a61c987).
⚠️ Report is 84 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #23377    +/-   ##
========================================
  Coverage   51.96%   51.97%            
========================================
  Files        2911     2914     +3     
  Lines      183176   183753   +577     
========================================
+ Hits        95196    95500   +304     
- Misses      79666    79885   +219     
- Partials     8314     8368    +54     
Flag Coverage Δ
go-unit-tests 51.97% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🚀 Build Images Ready

Images are ready for commit a61c987. To use with deploy scripts:

export MAIN_IMAGE_TAG=5.1.x-234-ga61c9872c6

@porridge
porridge marked this pull request as ready for review October 14, 2026 06:22
@porridge
porridge requested a review from a team as a code owner October 14, 2026 06:22
@porridge

Copy link
Copy Markdown
Contributor Author

/retest

@red-hat-konflux

Copy link
Copy Markdown
Contributor

All PipelineRuns for this commit have already succeeded. Use /retest <pipeline-name> to re-run a specific pipeline or /test to re-run all pipelines.

@sachaudh sachaudh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice, this makes roxie and local UI dev a lot smoother. Looks like the startup in the description hit EMFILE before the dev server came up. Did you get a chance to try it against a roxie cluster once that was sorted?

Comment thread ui/apps/platform/README.md Outdated
and forward all API requests to `https://8.8.8.8:443`. _Note that the protocol (https) is required to
be set for this option._

Note that `roxie` sets `$ROX_BASE_URL` in the environment automatically.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this only kick in when npm run start runs inside the roxie subshell (or after sourcing the --envrc file)? Someone starting the dev server from another terminal might wonder why it still goes to localhost:8000.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, added a note that's hopefully helpful.

Comment thread ui/apps/platform/src/setupProxy.js Outdated
);

const proxy = proxyWithTarget(process.env.UI_START_TARGET || 'https://localhost:8000');
const proxy = proxyWithTarget(process.env.UI_START_TARGET || process.env.ROX_BASE_URL || 'https://localhost:8000');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: this line is past Prettier's 100 char width, and since setupProxy.js is in the ESLint ignores it won't get auto-flagged.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wrapped.

@porridge
porridge requested a review from sachaudh October 20, 2026 06:34
@porridge

Copy link
Copy Markdown
Contributor Author

PTAL @sachaudh

This branch has not been deployed

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants