The projects Stack declares the Nginx Proxy Manager URL into every deploy template's environment (THE-14) #35
No reviewers
Labels
No labels
needs-info
needs-triage
ready-for-agent
ready-for-human
review
merge-ready
review
needs-fix
review
needs-human
review
needs-operator
review
needs-review
review
waiting
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
olympus/infra-cockpit!35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "hermes/projects-stack-declares-npm-url"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
paperclip:THE-14
Summary
Second of two changes that put
NGINXPROXYMANAGER_URLinto every Semaphore deploy template's environment, so a deploy's Edge step can find the Nginx Proxy Manager. The first, #34, is onmainand its deploy went green: the deploy and the projects plan check already read the URL from a repository Variable and hand it to the projects Stack asTF_VAR_nginxproxymanager_url. This change makes the Stack declare that variable and write it into the fivedeployenvironments. It could not ride in #34: the plan check on a pull request ismain's workflow andmain's Makefile planning the head's Stack, so a Stack that requires the URL could only be planned oncemainhanded it over (the measurement is in #34's body). The Operator chose this route, the projects Stack, on card2f2af53bon THE-14, answered at 10:17:58Z.Every repository's environment carries both endpoints, as it already carried the Proxmox one: a repository whose deploy has no Edge ignores the URL, and a new repository stays one line in
variables.tf. The variable has no default, like the endpoint, so a plan made without the URL cannot be made. It is validated as a base URL because thenginxproxymanagerprovider documents itsurlas a protocol and a port with no path. The plan prints the value into the CI log, which is public, so the rule also refuses credentials (user:pw@), a query, a fragment and whitespace. Review round 1 found that the first version,^https?://[^/]+$, accepted all four; the loop's fixer closed it inf606f5eand4fb84fb, and the rule now reads^https?://[^/?#@[:space:]]+$. The reviewer's optional advisory is left as it is: an empty port (http://npm.lan:) still plans.It also carries the two documentation advisories from #34's review:
docs/deploy.mdsaid the projects plan check holds the key pair and the endpoint "and nothing else", andprojects-planandprojects-idsneed the URL exported as well. #34's head stayed untouched on purpose, because the board's confirmation card named it.On the live system the merge gives each of the five
semaphoreui_project_environment.deployobjects one more key, in place. This pull request'splan / projects-plan-checkplans it against PROD's state and reportsPlan: 0 to add, 5 to change, 0 to destroy.(run 112). The provider's schema agrees (semaphoreui/semaphore0.3.10: onlyproject_idforces a replacement).Evidence
main(97853e1)4fb84fb)make check, cleangit archiveexportokok, 0 FAIL, noBroken pipeok, 18 FAIL againstmain's Stack filesok, 0 FAILmain's tree is #34's head byte for byte (git diff --statbetween them is empty), so 242 is the figure the review measured. The 18 failures are all the new behaviour: the variable is not declared, the environment does not carry it, and eight malformed values (127.0.0.1:81,ftp://127.0.0.1:81, a trailing/, a path,user:pw@, a query, a fragment, a space in the host) are accepted, each of them failing twice (the refusal, and the Stack's own sentence).Mutants: 25 copies of the change, each breaking one claim, and each turns the suite red on an assertion that names it; none survives and none failed to apply. They are #34's 11, run again against this head, and 14 for the Stack: the validation accepting a path, a query, a fragment, credentials, whitespace, a bare
host:port, anything, or demandinghttps; the new variable or the endpoint given a default; the environment without the URL, wired to the wrong variable, commented out, or without the endpoint.The real Stack, planned offline the way the plan job plans it (
-refresh=false, an empty state so every object is a create, a placeholder Semaphore token):Plan: 40 to add, 0 to change, 0 to destroy(5 repositories, 8 objects each); all five environments carryNGINXPROXYMANAGER_URLandPROXMOX_VE_ENDPOINTError: No value for required variableError: Invalid value for variable, with the Stack's own sentenceThe rule, probed with the real
tofuon this head'svariables.tf, one plan per value, in a module that holds nothing else:http://127.0.0.1:81,https://npm.lan,http://npm.lan:8081,https://[::1]:81127.0.0.1:81,ftp://127.0.0.1:81,http://,http://127.0.0.1:81/,http://127.0.0.1:81/apihttp://user:pw@npm.lan:81,http://npm.lan?x=1,http://npm.lan#frag,http://npm lanhttp://npm.lan:,http://:81The live value passes the rule: the Variable on this repository is 21 bytes and matches
^https?://[^/?#@[:space:]]+$, checked locally with the value read and not printed.The live plan (
plan / projects-plan-check, run 112 at this head, the same as run 110 at the first):main's workflow, which hands over the URL, plans this Stack against PROD's state with the plan-only key. It reports the fivesemaphoreui_project_environment.deployobjects, one per repository, aswill be updated in-place, each gaining only"NGINXPROXYMANAGER_URL"while its other element stays; thenPlan: 0 to add, 5 to change, 0 to destroy.andplan-check: the plan destroys and replaces nothing.So the update is in place, as the schema says. That context is not required by the branch protection; it is green.Not observed: the deploy itself, which the merge is.
Merge Danger
Door: two-way. Revert the commit: the next deploy removes the key again, in place, and the Variable stays harmless.
Blast Radius: one deploy, and the five deploy templates' environments.
make semaphore-idlefound no task running and waited 0 s, snapshots of 143 and 145, both Guest applies0 added, 0 changed, 0 destroyed, the service layer, the projects Stack, andverifypassed. It restarted nothing: no handler ran, and the onlychangedtasks were the apt cache refresh.edgestep can run through Semaphore for the first time (the forge's will too, once it deploys on merge). That step has its own plan judge and its own snapshot, and it belongs to that merge, not to this one.— Hermes (agent-written)
Review started (round 1/5) on
2ad880da99— reading the diff now.review: repo=olympus/infra-cockpit pr=35 head=2ad880da99c1543971f67d42f51dbfe6aa127e22 round=1/5 verdict=fix
Recommendation: fix
Round 1 of 5: the thread carries no prior review. Spec: the PR body and THE-14 (Paperclip,
in_review), route (a). Standards:AGENTS.md,docs/deploy.md,docs/environment.md,scripts/tests/plan-check.sh, and the org ADRs atolympus/workshoporigin/main(0011, 0014). The PR body was rewritten at 13:40:17Z, after my first read. The change is the same; the evidence lines moved from "not observed" to observed, and I checked those lines below.Standards
semaphore/projects/variables.tf:38^https?://[^/]+$accepts userinfo.http://user:pw@npm.lan:81plans clean (rc=0,tofuat the worktree's mise pin). That breaksdocs/deploy.md:143("It holds no secret of any type") andsemaphore/projects/projects.tf:67("values only, never a secret"). It is not theoretical. The projects plan prints the env value into the CI log (plan / projects-plan-check, run 110, line 235:+ "NGINXPROXYMANAGER_URL" = "http://10.12.0.113:81"), and the repo is public (private: false). A password typed into the Variable would reach that log on every pull request's plan. Charter item 3, secrets hygiene in CI logs.variables.tf:38-39http://npm.lan:(empty port) plans clean (rc=0). The message at :39 promises "an optional port". Optional.Clearing S1 (smallest):
semaphore/projects/variables.tf:38:condition = can(regex("^https?://[^/?#@[:space:]]+$", var.nginxproxymanager_url)). I ran that exact regex through the head's own Stack in scratch. It refusesuser:pw@,?x=1,#fragand a space in the host. It acceptshttp://127.0.0.1:81,https://npm.lan,http://npm.lan:8081andhttps://[::1]:81.scripts/tests/plan-check.sh:356: addhttp://user:pw@127.0.0.1:81andhttp://127.0.0.1:81?x=1to the refusal list, so the suite pins it. Without that the regression is untested.Not charged (doc drift): AGENTS.md §Pull requests asks for
CP-<index>. The body carriespaperclip:THE-14, as merged #34 did, andolympus/workshopAGENTS.md §Issue tracker namespaperclip:<KEY>-<n>for company work. The repo's line is stale. That is for the repo's docs, not this PR.Smell baseline: Data Clumps on the endpoint pair is suppressed, because the repo endorses the mirror (
projects.tf:67-72,docs/environment.md). No other baseline smell in the hunks.Spec
nginxproxymanager_url, required, no defaultvariables.tf:33. Mutant m2 (default added) goes red.projects.tf:81. Mutant m1 (line dropped) and m4 (wrong variable) go red.Plan: 0 to add, 5 to change, 0 to destroy., fivewill be updated in-place.host[:port], no pathprojects-ids/projects-plan/projectsneed the URLmake -n) carry the refusal loop. Theprojects-plan-checkjob's env is the state pair, the PROXMOX endpoint and the NPM URL, which matchesdocs/deploy.md"and nothing else".No new Spec findings. The S1 gap contradicts the spec's own claim ("a base URL"), and it is charged once, under Standards.
Scope note: the URL goes into all five repositories' environments, not only those with an Edge step. That is the author's choice, argued in the body. I did not charge it.
Verified
make checkat2ad880dmise exec -- make checkin a clean worktreeok, 0 FAILscripts/tests/plan-check.sh.*: 4 red. m4 wrong variable: 1 red. Each names its assertion. I reproduced 4 of the 21 the author claims.tofuat the worktree's mise pin, headvariables.tfplan / projects-plan-checkrun 110 job 2, log fetchedpr-checks / check (pull_request)run 111main.forgejo/,Makefile,plan-check.py,guest/,runner/are unchanged).scripts/tests/plan-check.shchanged, which is a test of the gate, not one of its four boundaries. Not an escalation.Validation probe (head
variables.tf):http://127.0.0.1:81,https://npm.lan,http://npm.lan:8081,https://[::1]:81127.0.0.1:81,ftp://127.0.0.1:81,http://127.0.0.1:81/,http://http://user:pw@npm.lan:81http://npm.lan?x=1,http://npm.lan#frag,http://npm lanhttp://npm.lan:Could not verify
2f2af53b"answered stack at 10:17:58Z". It is cited in THE-104's CEO comment (10:57Z) and in THE-14's report, revision 28 (11:05Z). THE-14's live comment list (36 entries) has no entry at 10:17Z, and I did not read the card's own answer record. The route matches the ticket. The timestamp is unverified.projects-plan-checkis not required by branch protection":list_branch_protectionsrefused, because this account lacks admin on the repo. Unverified.Files
semaphore/projects/variables.tfscripts/tests/plan-check.shsemaphore/projects/projects.tf:81, in place per CI).docs/deploy.md:143is the documented rule S1 breaks.docs/environment.mdSummary
Acknowledged (round 1/5) — fixing now; what changed and how I verified it follows.
Fixed (round 1/5), head
4fb84fb, two new commits on2ad880d. The one BLOCKER (S1) is fixed. The ADVISORY (S2) is left alone, on purpose.Findings
semaphore/projects/variables.tf:38acceptedhttp://user:pw@host, and the plan prints the URL into the public CI log.f606f5e. The condition is now^https?://[^/?#@[:space:]]+$. The refusal list inscripts/tests/plan-check.shgainsuser:pw@,?x=1and#frag. The variable's comment and error text now say why.plan tests: 6 case(s) FAILED, eachthe value … is refused (rc was [0]). Green after:plan tests: every case passed., 114ok.4fb84fb.'http://npm lan:81'added to the refusal list.ok, 0 FAIL. Mutant:[:space:]removed from the class givesFAIL the value http://npm lan:81 is refused (rc was [0])plus its Stack-sentence assertion,2 assertions FAILED. Guard restored, and the file matches the commit.http://npm.lan:(an empty port) plans clean.Verification
The floor, on a clean
git archiveexport of4fb84fb, with no credential in the environment:ok267, FAIL 0. At2ad880dthe count was 259. The difference is the eight new assertions (6 + 2).every case passed:env tests,plan tests,plan workflow tests, andinstall-reinstall. Thetofu fmt -checkstep prints nothing.mise exec -- bash scripts/tests/plan-check.shran after each step, and its rc was 0, 1, 0, 1, 0 in that order (base, red, green, space mutant, restored).4fb84fb, read anonymously fromcommits/<sha>/status: statesuccess.pr-checks / check (pull_request)success in 38s.plan / projects-plan-checksuccess in 15s. That job validates the live Variable under the new condition.plan / guest-plan-checkandplan / runner-guest-plan-checkalso success.Not changed
2ad880d, as its own table says, so they are still true for that head. At4fb84fbthe figures are 267okformake checkand 116 for the plan suite.for url inlist mixes quoted and unquoted words; the quoted ones are the ones with@,?and#, and I kept the rest as they were. Spec: S1 is met. The variable is still required with no default, and it is written into all five environments.2ad880d. Nothing rewritten and nothing force-pushed. The push was2ad880d..4fb84fb, a fast-forward, and the ref reads back at4fb84fb.Label
review/needs-fix(org 23) moves toreview/needs-review(org 22). No other label is touched.Review started (round 2/5) on
4fb84fb926— reading the diff now.Round 1, answered. S1 was right, and the defect was mine:
^https?://[^/]+$letuser:pw@, a query, a fragment and whitespace through, and the plan prints the value into a public CI log. Efesto'sf606f5eand4fb84fbclose it. I pushed nothing in this round and left the branch to the loop.Checked on
4fb84fb, from a clean export:tofuon each head'svariables.tf, one plan per value. At2ad880d,http://user:pw@npm.lan:81,http://npm.lan?x=1,http://npm.lan#fragandhttp://npm lanplan (rc=0). At4fb84fball four are refused (rc=1), andhttp://127.0.0.1:81,https://npm.lan,http://npm.lan:8081andhttps://[::1]:81still plan.make check: 267ok, 0 FAIL, noBroken pipe(259 before). This head's suite againstmain's Stack files: 98ok, 18 FAIL, all of them the new behaviour.plan / projects-plan-check, run 112: fivewill be updated in-place,Plan: 0 to add, 5 to change, 0 to destroy.The live Variable (21 bytes) matches the new rule.S2 (an empty port,
http://npm.lan:) still plans, as Efesto left it. It carries no secret, so it stays out of this round.The body now describes
4fb84fb: the figures, the new rule, the probe table, and card2f2af53b(answered 10:17:58Z on THE-14), which chose this route. The head did not move.— Hermes (agent-written)
review: repo=olympus/infra-cockpit pr=35 head=4fb84fb926b39644ec33095747965df0b2752388 round=2/5 verdict=merge
Recommendation: merge
Round 2 of 5. The thread holds one prior review (id 716, round 1/5, head
2ad880d, REQUEST_CHANGES,dismissed: falseread before this POST), so this is round 2; the dispatch's count agrees. The state follows blockers only. The one advisory is below the three-advisory line.Verdict
semaphore/projects/variables.tf:40(f606f5e); refusal cases atscripts/tests/plan-check.sh:359-360(4fb84fb)Spec
Sources, in the order used:
updated_atmoved). The second read changes the evidence and the card sentence, not the requirements. Acceptance taken from it: the Stack declares the variable, required with no default; it is written into all five deploy environments in place; it is validated as a base URL.scripts/fetch-paperclip-issue.sh THE-14(GET /api/issues/THE-14200, documents 200). The ticket's own description is the B2 deploy-on-merge item and does not carry the URL route. The route is in its report document: revision 19 ("The fix I recommend for the URL") and revision 28 ("route (a), the cockpit Stack").nginxproxymanager_url, required, no defaultvariables.tf:35; mutant m6 (default added) red on "has no default"projects.tf:81; run 112 (#749) job 2 log: fivewill be updated in-place,Plan: 0 to add, 5 to change, 0 to destroy.host[:port], no pathvariables.tf:40; probe table under Verifiedhttps://variables.tf:20(endpoint, unchanged) vs:35(own variable)projects-ids/projects-plan/projectsneed the URLdocs/deploy.md:143,:176-178,:205;docs/environment.md:66;Makefile:281-289(projects_stack_initrefuses without it) and:437-472Scope: the five changed files are the Stack, its test, and the docs the body names. Nothing beyond the spec. Nothing the spec asks for is missing.
Standards
Sources:
AGENTS.md§Secrets, §Toolchain, §Docs;docs/deploy.md;docs/environment.md;olympus/workshopdocs/adr/atorigin/main(fetched this round): 0011, 0014; charter item 3 (secrets hygiene in CI logs).ADV-1, ADVISORY: the host part of the rule is not validated (carries round-1 S2)
semaphore/projects/variables.tf:40:^https?://[^/?#@[:space:]]+$. The delimiters are checked; the host is not.tofu1.12.6 against the head'svariables.tf:http://npm.lan:plans (rc 0). This is round-1 S2, still here.http://:81plans (rc 0). An empty host; the Stack's own sentence says "a host".http://S3cret-tokenplans (rc 0, "No changes"). A secret typed as the host passes, and the plan prints it: run 112's log prints the value (+ "NGINXPROXYMANAGER_URL" = "http://10.12.0.113:81").variables.tf:30-32says "no credential may ride in it". The rule refuses credential syntax (user:pw@), not a credential.^https?://[^/]+$(2ad880d:variables.tf:38) accepts every string the new one accepts in the host part, so these were admitted before this round. ADVISORY under the re-review rule.[^/?#@[:space:]:]+, or a bracketed IPv6 address) and a digits-only port; reword:30-32to say the rule refuses credential syntax. No regex closesS3cret-token, because it is a valid hostname. That part is closed by the comment's wording, not by the code.Baseline smells: Data Clumps on the endpoint pair (
projects.tf:70-81) is endorsed by the repo's mirror (docs/environment.md:65-66). Suppressed. No other smell in the hunks.Named, not charged (outside the counts):
docs/deploy.md:54saysvars.NGINXPROXYMANAGER_URLis "read by the projects job only", while.forgejo/workflows/deploy.yml:47gives the deploy job the same variable. That line is not in this diff (it comes from #34). Not charged.scripts/tests/plan-check.sh:50-51:assert_containspipesprintfintogrep -qunderpipefail, the race the author noted in revision 28. The line is not in this diff; bothmake checkruns here showed 0Broken pipe. Not charged.scripts/tests/plan-check.sh:358-360: mixed quoting in the refusal loop, already flagged by the author. Taste; no rule breaks. Not charged.Verified
git ls-remote origin refs/pull/35/head4fb84fb926b39644ec33095747965df0b2752388, equal to the dispatchgit diff 2ad880d 4fb84fbvariables.tf(regex,f606f5e),plan-check.sh(refusal list,4fb84fb)tofuongit show <rev>:semaphore/projects/variables.tf, 17 inputs2ad880d:user:pw@,?x,#frag, space, tab, newline all plan (rc 0).4fb84fb: all refused by the Stack's sentence. The five good shapes still plan at both headsmake checkat headmise exec -- make checkok, 0 FAIL, 0Broken pipe(two runs)scripts/tests/plan-check.shon the clean exportok, 0 FAILmake_mutants.py,run_wave.sh@: 2 FAIL. m4 no query/fragment: 4 FAIL. m5 env line dropped: 1 FAIL. m6 default added: 1 FAIL. Each red names its claimed refusal. 6 of the 25 the body claims were reproduced4fb84fbpr-checks / check(run 113, #750): success.plan / projects-plan-check(run 112, #749 job 2): success, 15s.guest-plan-checkandrunner-guest-plan-check: successfetch-run-job-log.shfor run 112,projects-plan-checkPlan: 0 to add, 5 to change, 0 to destroy.; fivewill be updated in-place, each adding onlyNGINXPROXYMANAGER_URL;plan-check: the plan destroys and replaces nothing.Makefile:281-289,:437-472;plan.yml:139-145;deploy.yml:47projects*target refuses without the URL; the check's env is the state pair, the endpoint and the URL, which matches "and nothing else"infra-tracker/npm/providers.tf:2-3,infra-forge/npm/edge/providers.tf:2-3(sibling clones at their last fetch, not live)provider "nginxproxymanager" {}readingNGINXPROXYMANAGER_URLfrom the environment;variables.tf:27-29is accurateolympus/workshoporigin/main,docs/adr/001197853e1.forgejo/**), required context names (pr-checks / check,plan / *), job names, and the recipes of the Make targets those jobs run.plan-check.sh, a test the gate runs, gained cases and loosened nothing (mutants red). Not an escalation. The board may overrule this readingProbe, real
tofuat the head'svariables.tf:http://127.0.0.1:81,https://npm.lan,http://npm.lan:8081,https://[::1]:81http://user:pw@npm.lan:81,http://npm.lan?x=1,http://npm.lan#frag,http://npm lan:81, tab, newline,http://npm.lan/,http://npm.lan/api,127.0.0.1:81,ftp://127.0.0.1:81,http://http://npm.lan:,http://:81,http://S3cret-tokenCould not verify
2f2af53band its answer at 10:17:58Z. Cited by the body and by report revision 28; the card's own record was not read.Summary