GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(pm-stack): aggregator install.sh restarts on change and self-verifies deployed version (#1150) by dezren39 · Pull Request #2432 · developing-today/code Conversation
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 56 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ee6ab236e
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return { | ||
| status: "ok", | ||
| mode: inputs.mode, | ||
| version: inputs.version ?? resolveBuildVersion(), |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Include the build marker in the actual health API response
Adding version to HealthView does not expose it through /api/health: the handler in src/server.ts:712–727 constructs a separate response body by selectively copying fields and never copies view.version. Consequently, even a successfully restarted deployment cannot report its build marker, and the new installer verification always times out and exits 1 before reaching the quota-gatherer installation. Wire the marker into the API response and cover it with an HTTP-level assertion rather than only testing buildHealth().
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the follow-up commit: the /api/health handler in src/server.ts now serializes version: view.version into the response body (placed before sections/services), and test/api-health-comments.test.ts gained an HTTP-level assertion — a server booted with PM_AGG_BUILD_VERSION=test-build-1150 answers /api/health with "version": "test-build-1150" (18 pass across health + api-health-comments tests on the laptop). Thanks — buildHealth-only coverage would indeed have shipped a marker the API never emitted.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| [ -f "$DST/.deploy-tree-hash" ] && DST_HASH="$(cat "$DST/.deploy-tree-hash")" | ||
| BUILD_VERSION="${DEPLOY_COMMIT:-tree:${SRC_HASH}}" | ||
| live_version() { | ||
| curl -s --max-time 3 "http://127.0.0.1:4870/api/health" | grep -o '"version":"[^"]*"' | head -n 1 | cut -d'"' -f4 || true |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Parse the version from the server's pretty-printed JSON
The extraction pattern requires "version":"..." with no whitespace, but the server's json() helper in src/server.ts:189–190 serializes responses using JSON.stringify(body, null, 2), producing "version": "...". Even after the missing API field is added, this parser will still return an empty string, causing deployment verification to fail and preventing unchanged deployments from taking the no-op path. Use a JSON parser or otherwise handle the response's actual formatting.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in the follow-up commit: live_version() no longer greps for a fixed "version":"..." string — it parses the response as JSON with bun (already a hard dependency of install.sh: JSON.parse(await Bun.stdin.text()).version), so the pretty-printed "version": "..." format is handled. Verified on the laptop against a sample pretty-printed body; the no-op path and the post-restart verification both use this parser.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
… JSON in install.sh (#1150, Codex P1s on PR 2432)
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: f85e92914c
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if [ "$SRC_HASH" = "$DST_HASH" ] && systemctl --user is-active --quiet pm-aggregator.service && [ "$(live_version)" = "$BUILD_VERSION" ]; then | ||
| CHANGED=0 |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Include configuration changes in the deployment no-op check
When the source commit and package files are unchanged, rerunning the installer with a different TAILNET_IP, updated SOPS credentials, or an updated service unit now skips those changes entirely. The CHANGED branch encloses both .env rendering and service-unit installation, but the hash covers none of those inputs. A mocked installer run confirmed that changing the tailnet address and unit still reports successful verification while retaining the old installed values. Include these deployment inputs in change detection, or update configuration independently and restart when it changes.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed in d16655c: change detection now hashes the deployment inputs the tree hash cannot see — TAILNET_IP, the SOPS file and the unit file (deploy_inputs_hash), and stores them in $DST/.deploy-inputs-hash. A no-op now requires both the tree hash and the inputs hash to match, so changing the tailnet address, rotating a credential in the SOPS file, or editing the unit re-renders .env, re-copies the unit and restarts. The SOPS file is hashed as ciphertext, so nothing is decrypted or printed during detection; a missing file hashes as 'absent' so the first run that gains one is also a change. Verified with a harness: identical runs give the same inputs hash, and changing TAILNET_IP, the SOPS content or the unit each changes it. bash -n passes.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…1150, PR #2432 Codex P2) The tree hash covered only the copied package files, so rerunning the installer with a different TAILNET_IP, a rotated SOPS credential file or an edited service unit skipped .env rendering and the unit copy entirely while reporting a successful verification. Hash the deployment inputs the tree cannot see - the tailnet bind address, the SOPS ciphertext and the unit file - and require both hashes to match before treating the run as a no-op. The SOPS file is hashed as ciphertext, so no value is decrypted or printed during change detection.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
fix(pm-stack): aggregator install.sh does not restart a running service - deploys silently no-op
There was an error while loading. Please reload this page.