Skip to content

fix: point the site art record at a commit that exists - #24

Merged
lemarier merged 2 commits into
mainfrom
david/site-art-record
Sep 17, 2026
Merged

lemarier merged 2 commits into
mainfrom
david/site-art-record

Conversation

@lemarier

Copy link
Copy Markdown
Contributor

Two follow-ups to #22, one of which is broken on main right now.

The record names a commit nobody can resolve. #22 recorded brand commit 03aeae1, the head of the branch it packaged from. origin89hq/brand#15 was squash-merged as 4c36b2e and its branch deleted, so 03aeae1 is unreachable and node scripts/site-art.mjs --check --brand fails against any fresh brand clone. A record pointing at a commit that does not exist is the exact failure the record was added to prevent. Both scripts are byte for byte identical at 4c36b2e, so the record moves there and verifies again.

--repoint <commit> --brand DIR performs that move: it reads both recorded scripts at the candidate commit, requires their hashes to match what the record already holds, and only then rewrites brand.commit. The image hashes never change. Pointed at a commit that predates or rewrites the scripts it refuses and leaves the record untouched. The README now covers this as the step after the brand PR merges, since any squash merge will strand the packaged commit.

checkRecord walked the overlap of the directory and the record, so two cases passed that should not have: dropping a view from both sides left matching subsets, and a stray file whose record entry omitted render passed because VIEWS[name] and entry.render were both undefined, sending the comparison through to a sha256 that matched. It now requires both sides to hold exactly the three views. Found by CodeRabbit on #22, after that PR had merged.

Validation: just check on this branch, plus --check and --check --brand against the committed record, which now resolves 4c36b2e. Each new guard was mutation-tested — reverting it fails its own test and nothing else.

checkRecord walked the overlap of the directory and the record, so dropping a
view from both left matching subsets and passed, and a stray file whose entry
omitted `render` passed too: VIEWS[name] and entry.render were both undefined,
so the comparison fell through to a sha256 that matched. It now requires both
sides to hold exactly the three views.
#22 recorded brand commit 03aeae1, the head of the branch it packaged from.
That branch was squash-merged as 4c36b2e and deleted, so the recorded commit is
unreachable and `--check --brand` fails against any fresh brand clone: the
record names a commit nobody can resolve, which is the failure the record exists
to prevent. Both scripts are byte for byte the same at 4c36b2e.

--repoint moves the record onto another commit, but only one holding the
recorded scripts unchanged, so a squash merge no longer strands it.
Copilot AI lite review requested due to automatic review settings September 17, 2026 20:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

📝 Walkthrough

Walkthrough

The site art script now requires directory, record, and VIEWS entries to match and validates recorded render sources and SHA-256 hashes. It adds repoint support for updating the brand commit only when rendering scripts match. The CLI, documentation, recorded commit, and tests were updated.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: 🔵 Low · up to 6344e

Maintainers with an unfetched brand checkout can be unable to repoint the record after merge. Fetch the remote before resolving the target commit.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: updating the site art record to reference an existing, reachable commit.
Description check ✅ Passed The description accurately explains the reachable commit update, the new repoint operation, record validation fixes, documentation changes, and validation performed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI

Comment @coderabbitai help to get the list of available commands.

@lemarier
lemarier merged commit e7a9a46 into main Sep 17, 2026
2 of 3 checks passed
@lemarier
lemarier deleted the david/site-art-record branch September 17, 2026 20:39

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Quiet mode is enabled, so only the most important comments were posted inline. Other review comments are grouped below.

🟡 Other comments (1)
apps/website/src/assets/art/README.md-65-65 (1)

65-65: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Fetch origin/main before resolving the commit.

If $BRAND was fetched before the merge, local origin/main can still select the pre-merge commit. repoint then rejects that commit when its scripts do not match the recorded hashes, so the documented workflow fails instead of updating the record.

Proposed fix
+git -C "$BRAND" fetch origin
 node scripts/site-art.mjs --repoint "$(git -C "$BRAND" rev-parse origin/main)" --brand "$BRAND"

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Advanced

Run ID: 7b8ad3d7-d46e-4989-acfb-e187477550b2

📥 Commits

Reviewing files that changed from the base of the PR and between 47ddfca and 6344ee4.

📒 Files selected for processing (4)
  • apps/website/scripts/site-art.mjs
  • apps/website/src/assets/art/README.md
  • apps/website/src/assets/art/site-art.json
  • apps/website/test/site-art.test.mjs

Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants