Repository navigation
fix(site): the demo generator puts the apply link in literally and reads files only; the README says the sample's dates are those of the last deploy; the Docker claim guard matches more phrasings - #897
Merged
Conversation
…ads files only; the README says the sample's dates are those of the last deploy
…ntity-spaced phrases, docker pull and Docker Hub, says what it misses, and pins its skips and floors
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.
Summary
Three nits from the review of the sample dashboard change (#891), and the nits from the review of the Docker claim guard (#896), folded in because both are small and in
scripts/.A URL in the apply link can no longer be read as a replacement pattern.
build-demo.mjsput the design-partner URL into the pages withreplaceAll(placeholder, applyForm), where a string replacement reads$&,$1,$$,$`and$'. The URL comes fromsellable.jsonand holds none today; it now goes in through a function (() => applyForm), which is literal. Test:TestDemoGeneratorKeepsDollarSignsInTheApplyLinkrenders a template with a URL that holds all five and requires the output to be the URL unchanged (the URL is passed through the environment: the first version of my test put it in a JavaScript template literal, and the backtick in it made the test itself fail to run).A folder under
demo-templates/whose name ends in.htmlis not a page. The generator now reads files only (withFileTypes,isFile()), and has a--templates <dir>option (defaultdemo-templates) so this can be tested:TestDemoGeneratorReadsFilesOnlyFromTheTemplatesgenerates from a temporary folder holding a file and a folder namedfolder.htmland requires exactly one output page, with its dates moved. The links test (TestDemoPagesResolveFromTheirTemplates) has the same folder case for/demo/folder.html, which pins the!st.IsDir()check.The dates are those of the last deploy, and the docs say so.
website/README.mdhas a "The sample dashboard" section: how the pages are generated, that the dates move to the build day (UTC), that they stay as they are until the site is built again, so the sample ages between deploys, and that a scheduled rebuild would keep it fresh and is not set up. The pages already say that the dates move with each build.The Docker claim guard matches more phrasings and says what it misses (
scripts/site_docker_claim_test.go): "Docker image(s)", "container image(s)" and now "OCI image(s)", with a space, a hyphen, a line break, or between the words;docker pull; "Docker Hub"; andghcr.io/. The header says what it still does not catch: a phrase split by markup (<b>Docker</b> image), other HTML entities, other languages and other wordings ("pull the image from GHCR"). Before changing it I checked that the wider pattern matches nothing in the scanned places today. The reviewer's other points: the skips ofdocs/prdanddocs/evidenceand the two sanity floors (at least 30 files read, at least 5 workflow files found) were not pinned by any test; the temporary-tree test now plants a claim in both folders, which must not be reported, and the floors are a function with a table test. A typo in a comment ("anghcr.io") is fixed.No CHANGELOG bullet: nothing here is visible to a user of the CLI, the agent or the site's content (the generator output is identical for the real URL); it is a robustness change, a test and a README section.
Checked
prdandevidenceskips, each floor, and each part of the wider pattern:oci, , the hyphen,docker pull,docker hub), each file restored from acpbackup, each killed by the test meant for it (the nine:TestDockerClaimsUnderReadsEveryRoot,TestDockerGuardFloors,TestDockerImageClaimPattern). The four generator mutants: the string replacement back (the dollar-sign test), folders read as pages and--templatesignored (the files-only test), theIsDircheck dropped (the links test).scripts/pass (the gate below); no new ignored or generated file is involved.make ci-localand the disclosure scan: see the head.Not checked / limits
Test plan
go test ./scripts/, mutants abovemake ci-local, disclosure scan clean