Skip to content

Update the VS Code theme CLI checks for the copied theme file - #13065

Closed
en3r0 wants to merge 1 commit into
omacom:quattrofrom
en3r0:fix-vscode-theme-cli-test
Closed

en3r0 wants to merge 1 commit into
omacom:quattrofrom
en3r0:fix-vscode-theme-cli-test

Conversation

@en3r0

@en3r0 en3r0 commented Sep 23, 2026 •

Copy link
Copy Markdown

Summary

#10134 (merged 2026-09-23) changed omarchy-theme-set-vscode to write omarchy-color-theme.json as a real file instead of a symlink into current/theme, and to derive the extension version from the theme content (1.0.<cksum>). Both changes were deliberate: they let VS Code's _watch reload fire, and they invalidate VS Code's theme cache.

test/cli wasn't updated, so ./test/cli now fails on quattro:

  1. not ok - vscode generated theme references current theme file: the check still expects a symlink.
  2. not ok - vscode generated theme clears obsolete extension marker: this one was hidden behind the first. The test seeds .obsolete with local.omarchy-theme-1.0.0, but the script removes only the marker for the version it installs, which is no longer 1.0.0.

Changes

Test only; the script is unchanged:

  • The theme file must be a regular file (not a symlink) with contents identical to current/theme/vscode-theme.json.
  • The .obsolete fixture marks the version the script will actually compute, so the "clears obsolete marker" check keeps testing the removal path.

Tests

./test/cli now passes: 112 ok, exit 0. Before this change it stopped at the first failure above.

cc @Macho0x, as a follow-up to #10134.

🤖 Generated with Claude Code

Fixes #13131

omacom#10134 made omarchy-theme-set-vscode write a real theme file with a
content-derived extension version, but test/cli still expected a symlink and
seeded the obsolete marker with version 1.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jandrusk

Copy link
Copy Markdown

LGTM — matches omarchy-theme-set-vscode after #10134 (real file copy + 1.0.<cksum> version). Seeding .obsolete with the computed version is the right fix.

(Formal approve isn't available from my account on this repo; treat this as an approval from review.)

@llstrk

llstrk commented Sep 24, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Verified: No issue found in the changed test. The description of the base failures matches the current bin/omarchy-theme-set-vscode, and the updated checks exercise the copied theme file and the content-derived obsolete marker.

Complete ./test/cli run (isolated) Exit Result
Base 28ceaae 1 86 ok, then not ok - vscode generated theme references current theme file
Head test with the base's 1.0.0 marker seed restored 1 87 ok, then not ok - vscode generated theme clears obsolete extension marker (the seeded 1.0.0 key is no longer the key the script removes)
Head d96671a 0 112 ok, 0 not ok

Verified: In disposable copies of the head with one script change each, the head suite fails on the pre-#10134 script (symlink plus constant 1.0.0), on a symlink with the new version scheme, on a copied file with different contents, and on a constant 1.0.0 version. The test and the script compute the version from the same file with the same cksum | cut -d' ' -f1 pipeline.

Optional test improvement: The suite never asserts the version written to the generated package.json, which is the version VS Code uses to build extension keys. A diagnostic variant that assigns GENERATED_EXTENSION_VERSION after the package.json heredoc still passes all 112 checks:

Diagnostic script variant package.json version Removed .obsolete key Head ./test/cli
Unchanged head script 1.0.<cksum> 1.0.<cksum> 112 ok
Version assigned after package.json is written 1.0.0 1.0.<cksum> 112 ok (not detected)

This line, placed after the registration check, passes on the head script and fails on that variant:

jq -e --arg version "$vscode_theme_version" '.version == $version' "$PI_TMPDIR/.vscode/extensions/omarchy-theme/package.json" >/dev/null || fail "vscode generated extension version follows the theme content"

Seeding the pre-#10134 symlink before the run would also cover the upgrade path: without the rm -f before the copy, the suite still passes, while an existing install writes through the old symlink and truncates current/theme/vscode-theme.json to 0 bytes.


Review information

Test scope: Source review of test/cli and bin/omarchy-theme-set-vscode at head and base. Complete ./test/cli runs at head and base in a sandbox with private HOME, TMPDIR and XDG directories, stubbed editor and desktop commands, and GNU coreutils 9.11. The script variants above are diagnostic copies, not proposed code. No VS Code-family editor was launched, so theme reload and cache invalidation in a running editor were not observed.

AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 3, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and tested at d96671a; nothing found. Fixes #13131.

Where it ran: ./test/cli on a disposable Omarchy worker VM. On quattro (821ae58) it fails at vscode generated theme references current theme file. At this head it passes (112 ok), and merged with current quattro it also passes (117 ok). With the .obsolete seed put back to 1.0.0, it fails at vscode generated theme clears obsolete extension marker, so the new seed is what keeps the removal path tested.

Review: The new checks match bin/omarchy-theme-set-vscode as #10134 left it. -f with ! -L rejects the old symlink, cmp -s rejects a stale copy, and the seed uses the same cksum pipeline the script uses for the version. The change touches the test only, which is what the problem needs. Codex Medium reviewed it as a second opinion, found no defects, and agreed it is proportionate. Independence is not guaranteed, because the reviewer can read this session's transcript.

Related: #13133, #13766 and #13810 fix the same failing test. #13133 makes the same change, opened a day later. #13766 also asserts _watch in package.json. #13810 keeps the 1.0.0 seed, so ./test/cli would still fail at the obsolete-marker check. This one is the earliest complete fix. Choosing between them is up to the maintainer.

Nothing is left for the author. This waits on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 4, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

quattro now carries this fix, so nothing is left for this pull request to add. #14259 (0e7d6c2, merged 2026-10-04) changed the same lines of test/cli, and that is why this one no longer merges. It seeds .obsolete with the 1.0.<cksum> version bin/omarchy-theme-set-vscode computes, rejects a symlink, and cmps the copy against current/theme/vscode-theme.json.

Where it ran: ./test/cli on quattro at d9b970d, on a disposable Omarchy worker VM, passes (117 ok, exit 0), including all four VS Code theme checks. Nothing was rebased or pushed here.

Review: I compared this diff with quattro's version line by line. The only thing this one asserts that quattro's does not is the explicit -f. cmp already fails on a missing file or a directory, and the script always writes the destination with a plain redirect, so -f catches no regression that could actually happen. Codex Medium reviewed it as a second opinion, reached the same conclusion with line references into test/cli and the script, and recommended closing this as superseded by #14259. Independence is not guaranteed, because the reviewer can read this session's transcript.

Thank you for tracking down both failures, including the obsolete-marker one hidden behind the first. This now waits on the maintainer, recommending it be closed as superseded. #13131 is fixed on quattro by the same commit, and so are the competing #13133 and #13766.

@en3r0 en3r0 closed this Oct 10, 2026
@en3r0
en3r0 deleted the fix-vscode-theme-cli-test branch October 10, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test/cli vscode assert expects a symlink that 977e0fcd replaced with a real file

4 participants