Add deployed-version info: VERSION_D at /static/VERSION_D (#813) - #1478
Merged
Conversation
…_D (#813) Implement the deployed-commit info feature for this DSpace 9 / Angular 20 (standalone) instance, mirroring dtq-dev's behaviour: - scripts/sourceversion.py generates src/static-files/VERSION_D.html (git hash, commit date, build-run link) at Docker build time. - .github/workflows/docker.yml: enable run_python_version_script (both image jobs) so the version file is produced by the reusable build. - New standalone static-page feature (component + routes + HtmlContentService + dsSafeHtml pipe) renders /static/<name> from static-files/<name>.html; content is fetched client-side (SSR-safe). VERSION_D is reachable at /static/VERSION_D. - angular.json registers src/static-files as a build asset. - app-routes.ts registers the /static route. - en/cs i18n: static-page.404.* strings. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…813) TUL/jcu had no src/static-files directory. The CI 'Add version' step redirects into src/static-files/VERSION_D.html and angular.json ships src/static-files as a build asset, both of which require the directory to exist. Commit a placeholder (overwritten at build time) to guarantee it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…no alias) (#813) - angular.json: restrict the static-files asset to VERSION_D.html so only /static/VERSION_D is served (not a full static-page set). - html-content.service.ts: drop the 'of as observableOf' alias (alias-imports rule). - app-routes.ts / static-page.component.ts: sort imports (simple-import-sort, sort-standalone-imports). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Remove issue-tracker references and extra explanatory comments from the frontend deployed-version files, aligning comment style with dtq-dev, and drop the redundant explicit 'standalone: true' on the pipe (default in Angular 20). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a build-generated “deployed version” page and a generic /static/:id route to render HTML assets from static-files, so deployments can expose commit/build metadata at /static/VERSION_D.
Changes:
- Add
scripts/sourceversion.pyand enable it in the reusable Docker build to generatesrc/static-files/VERSION_D.htmlduring image builds. - Add a new
static-pageroute + component and anHtmlContentServiceto fetchstatic-files/<name>.htmlclient-side with locale fallback. - Register the static asset + add i18n strings for a dedicated static-page 404 view.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/static-files/VERSION_D.html | Placeholder tracked file that will be regenerated at build time. |
| scripts/sourceversion.py | Generates the deployed commit/build HTML output for VERSION_D.html. |
| .github/workflows/docker.yml | Enables version-file generation via reusable Docker workflow inputs. |
| angular.json | Adds static-files content to Angular build assets. |
| src/app/app-routes.ts | Registers the /static route to lazy-load static-page routes. |
| src/app/static-page/static-page-routing-paths.ts | Route/path constants for the static-page feature. |
| src/app/static-page/static-page-routes.ts | Route config for /static/:id. |
| src/app/static-page/static-page.component.ts | Loads and renders static HTML content; sets 404 UI/state. |
| src/app/static-page/static-page.component.html | Template for loading/found/not-found states. |
| src/app/static-page/static-page.component.scss | Styles for the not-found view. |
| src/app/shared/html-content.service.ts | Fetches localized/fallback static HTML from static-files/. |
| src/app/shared/utils/clarin-safehtml.pipe.ts | Pipe used to render fetched HTML via [innerHTML]. |
| src/assets/i18n/en.json5 | Adds new static-page 404 strings (EN). |
| src/assets/i18n/cs.json5 | Adds new static-page 404 strings (CS). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why (issue #813)
Every customer should be able to see which commit is currently deployed (served at
/static/VERSION_D, as ondtq-dev). This is DSpace 9 / Angular 20 (standalone,@angular/ssr), so the feature is implemented natively for that stack rather than copied from the Angular-13/15dtq-devmodule.Changes
scripts/sourceversion.py— generatessrc/static-files/VERSION_D.htmlat Docker build time..github/workflows/docker.yml— enablerun_python_version_script/python_version_script_dest(both image jobs) so the reusable build produces the version file.src/app/static-page/*— new standalone component + routes that render/static/<name>fromstatic-files/<name>.html(content fetched client-side; SSR-safe).src/app/shared/html-content.service.ts—providedIn: 'root'service with locale fallback.src/app/shared/utils/clarin-safehtml.pipe.ts— standalonedsSafeHtmlpipe.angular.json— registersrc/static-filesbuild asset.src/app/app-routes.ts— register the/staticroute.en/csi18n —static-page.404.*strings.Verification
ng buildcompiles;/static/VERSION_Drenders the deployed-commit info.🤖 Generated with Claude Code