Add deployed-version info: VERSION_D at /static/VERSION_D (#813) - #1477
Merged
Conversation
…_D (#813) Port the deployed-commit info feature from dtq-dev so this instance can show which commit is currently deployed: - 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 runs the version script before the image build. - Static-page module + HtmlContentService serve /static/<name> from static-files/. - ClarinSafeHtmlPipe (dsSafeHtml) ported and registered in SharedModule (needed by the static-page template). - angular.json registers src/static-files as a build asset. - app-routing.module.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>
Only the deployed-version info page should be served, not a full LINDAT-style static-page set. Restrict the angular.json asset to VERSION_D.html so nothing else under src/static-files becomes web-accessible. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a mechanism to expose the currently deployed commit/build information via a generated static file (/static/VERSION_D) and introduces a generic Angular route/module for rendering static HTML assets under /static/<name>.
Changes:
- Generate
src/static-files/VERSION_D.htmlduring the GitHub Actions Docker workflow usingscripts/sourceversion.py. - Add a
/staticroute and a newstatic-pagefeature module +HtmlContentServiceto fetch and render static HTML assets (with i18n 404 messaging). - Register a SafeHtml pipe in
SharedModuleand add build asset configuration for static files.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/static-files/VERSION_D.html | Placeholder file to be overwritten at build time with deployed version info |
| .github/workflows/docker.yml | Adds workflow step to generate VERSION_D.html before Docker build |
| scripts/sourceversion.py | New generator script emitting git/build/release info as HTML |
| angular.json | Registers static-files assets for inclusion in the build output |
| src/app/app-routing.module.ts | Adds lazy-loaded /static route |
| src/app/static-page/static-page.module.ts | New module wiring for static-page feature |
| src/app/static-page/static-page-routing.module.ts | Child routes for static-page rendering |
| src/app/static-page/static-page-routing-paths.ts | Constants for static routing/static asset paths |
| src/app/static-page/static-page.component.ts | Component that loads static HTML and handles relative-link navigation |
| src/app/static-page/static-page.component.html | Template rendering static HTML with loading and 404 states |
| src/app/static-page/static-page.component.scss | Styles placeholder for static-page component |
| src/app/static-page/static-page.component.spec.ts | Unit tests for static-page behavior (loading, 404 state, link rewriting) |
| src/app/shared/html-content.service.ts | New service to fetch static HTML with locale + SSR-aware URL composition |
| src/app/shared/html-content.service.spec.ts | Unit tests for HtmlContentService locale/namespacing behavior |
| src/app/shared/utils/clarin-safehtml.pipe.ts | New pipe used by template to render HTML via [innerHTML] |
| src/app/shared/shared.module.ts | Registers the new SafeHtml pipe in SharedModule |
| src/assets/i18n/en.json5 | Adds static-page 404 strings (EN) |
| src/assets/i18n/cs.json5 | Adds 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 branch had none of the mechanism, so the full feature is ported fromdtq-dev.Changes
scripts/sourceversion.py— generatessrc/static-files/VERSION_D.html(git hash, commit date, build-run + release links) at Docker build time..github/workflows/docker.yml— new Add version step runs the script before the image build.src/app/static-page/*+src/app/shared/html-content.service.ts— static-page module that renders/static/<name>fromstatic-files/<name>.html.src/app/shared/utils/clarin-safehtml.pipe.ts—dsSafeHtmlpipe (required by the template) registered inSharedModule.angular.json— registersrc/static-filesbuild asset.src/app/app-routing.module.ts— register the/staticroute.en/csi18n —static-page.404.*strings.Verification
ng buildcompiles;dist/browser/static-files/VERSION_D.htmlis produced./static/VERSION_Drenders the deployed-commit info.🤖 Generated with Claude Code