ci(webclient): Multi version client /client/<slug>/#460
Conversation
…n=1 overlay The docs workflow runs on every push to main and release/* and was unconditionally writing the freshly-built web client to gh-pages /client/. Whichever branch deployed last won, so a release-branch backport could silently overwrite the canonical /client/ URL with an older build. Mirror the docs sphinx-multiversion layout: each ref lands at /client/<slug>/ (slashes -> dashes), and /client/index.html is a thin redirect to ./main/ so existing bookmarks keep working. Bundle now embeds teleop version, CloudXR SDK version, git ref, sha, and build time via webpack DefinePlugin; the values are logged on startup and exposed by an opt-in overlay (append ?showVersion=1 to the URL). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughThe pull request implements a build version identification system for the CloudXR WebXR client. Build metadata—including teleop version, git reference, git SHA, and build timestamp—is collected during webpack compilation and injected into the bundle as environment variables. A GitHub Action passes git context during the build. The deployment workflow now versioning builds into separate subdirectories by branch/tag slug, with a redirect maintained at the canonical path. At runtime, the client optionally displays this metadata in a dismissible overlay when the Sequence DiagramsequenceDiagram
participant GHA as GitHub Actions
participant WBP as Webpack Build Process
participant Bundle as Generated Bundle
participant Client as WebXR Client
participant Browser as Browser/DOM
GHA->>WBP: Pass CLIENT_GIT_REF, CLIENT_GIT_SHA
WBP->>WBP: Read VERSION file, package.json
WBP->>WBP: Execute git commands for ref/sha
WBP->>Bundle: Inject metadata via DefinePlugin<br/>(CLIENT_TELEOP_VERSION, etc.)
Client->>Client: Import BuildInfoOverlay module
Client->>Client: Log BUILD_INFO on startup
Client->>Client: Call mountBuildInfoOverlayIfRequested()
alt showVersion param present
Client->>Browser: Check for existing overlay element
Browser-->>Client: Not found
Client->>Browser: Create fixed-position overlay div
Client->>Browser: Populate with BUILD_INFO content
Client->>Browser: Attach dismiss click handler
Browser-->>Client: Overlay mounted and visible
else showVersion absent
Client->>Client: Skip overlay mounting
end
Browser->>Browser: User clicks overlay to dismiss
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value). Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@deps/cloudxr/webxr_client/webpack.common.js`:
- Line 27: Replace using the package.json version as the SDK value and instead
use the build-provided SDK_VERSION: update where PKG_VERSION and
CLIENT_SDK_VERSION are set in webpack.common.js to source the value from the
environment/build constant SDK_VERSION (falling back to package.json.version
only if SDK_VERSION is undefined), and apply the same change to the other
occurrences around the CLIENT_SDK_VERSION usage (the references at the later
block around lines 123-124) so the overlay and build-info use SDK_VERSION as the
source of truth.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 455b8a03-9219-4678-8914-bdda11080668
📒 Files selected for processing (5)
.github/actions/build-cloudxr-web-client/action.yml.github/workflows/docs.yamldeps/cloudxr/webxr_client/src/BuildInfoOverlay.tsxdeps/cloudxr/webxr_client/src/index.tsxdeps/cloudxr/webxr_client/webpack.common.js
The overlay had a click-to-dismiss handler, so a single tap (deliberate or stray) made it disappear. With ?showVersion=1 being an explicit opt-in, the overlay should stay until the URL changes. Drop the click handler and switch the element to pointer-events:none so it never intercepts clicks on the underlying UI either. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a `changes` job that diffs the push/PR ref against its base and exports two booleans (`docs`, `webapp`). `build-docs` and `build-app` are now conditional on the relevant flag, and `deploy-docs` tolerates either upstream being skipped — gh-pages `keep_files: true` keeps the previously deployed copy of whichever artifact wasn't rebuilt. Cuts ~minutes off PRs that touch only docs or only the web client. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…code Drop SSR guards and idempotency checks from BuildInfoOverlay (browser bundle, called once), inline the TELEOP_VERSION read in webpack, replace the multi-line comment blocks with one-liners, and condense the deploy-docs `if` clause via !cancelled(). No behavior change; bundle still ships the same metadata and overlay, verified headlessly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The overlay was reading CLIENT_SDK_VERSION from package.json.version,
which is the web-client app's own version and incidental to the actual
CloudXR SDK that gets linked. Use the build-provided SDK_VERSION
instead — same value the action derives from .env.default and that
`npm install ../nvidia-cloudxr-${SDK_VERSION}.tgz` consumes — so the
overlay always reflects what's really shipped, with package.json as
a local-dev fallback.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
for #450 |
And adds
?showVersion=1overlay in the web url.The docs workflow runs on every push to main and release/* and was unconditionally writing the freshly-built web client to gh-pages /client/. Whichever branch deployed last won, so a release-branch backport could silently overwrite the canonical /client/ URL with an older build. Mirror the docs sphinx-multiversion layout: each ref lands at /client// (slashes -> dashes), and /client/index.html is a thin redirect to ./main/ so existing bookmarks keep working.
Bundle now embeds teleop version, CloudXR SDK version, git ref, sha, and build time via webpack DefinePlugin; the values are logged on startup and exposed by an opt-in overlay (append ?showVersion=1 to the URL).
Summary by CodeRabbit
New Features
?showVersion=trueto the URL. The overlay remains visible across application modes and can be dismissed.Infrastructure