Ma77Ball opened a new pull request, #5849:
URL: https://github.com/apache/texera/pull/5849
### What changes were proposed in this PR?
- Add DeploymentVersionService (provided in root): checkForUpdate() fetches
a cache-busted /assets/version.json and reports true only when its buildNumber
is a non-empty string that differs from the compiled Version.buildNumber;
start() polls every 5 minutes and, on the first detected change, shows one
sticky dismissible notification (NotificationService.blank with nzDuration 0)
asking the user to refresh.
- Extend build-version.js to also emit src/assets/version.json
({buildNumber, version}) alongside version.prod.ts (gitignored, regenerated per
build).
- Wire the poll in AppComponent, skipped when Version.buildNumber is the
"dev" placeholder so dev/test builds do not poll.
- Malformed manifests (missing, empty, non-string buildNumber, null body)
and transport failures (network error, 404, 500) are treated as "no update" so
a bad manifest never triggers a false prompt.
### Any related issues, documentation, discussions?
Closes: #5836
### How was this PR tested?
- Run `yarn test --include='**/deployment-version.service.spec.ts'` from
frontend/, expect 15 passing cases: update detected (differing build), no
update (same build), malformed manifests (missing/empty/non-string buildNumber,
null body), transport failures (network error, 404, 500), the request carries a
cache-busting query param, promptReload shows exactly one sticky notification,
and the polling path prompts once on update, never prompts while unchanged, and
stops after the first update.
- Manual: build the frontend (yarn build) and confirm
dist/assets/version.json exists with the build number; serve it, then replace
version.json with a different buildNumber and within the poll interval expect a
single "New version available" notification; reload clears it.
### Was this PR authored or co-authored using generative AI tooling?
Co-authored with Claude Opus 4.8 in compliance with ASF
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]