Skip to content

Fix vscode theme file verification in test/cli - #13810

Closed
szaidi-code wants to merge 1 commit into
omacom:quattrofrom
szaidi-code:fix/cli-test-theme
Closed

szaidi-code wants to merge 1 commit into
omacom:quattrofrom
szaidi-code:fix/cli-test-theme

Conversation

@szaidi-code

Copy link
Copy Markdown
Contributor

Summary

Fixes test/cli verification for omarchy-theme-set-vscode. The test previously checked for a symlink ([[ -L ... ]]), but bin/omarchy-theme-set-vscode writes a real file so file watchers can detect theme updates.

Changes

  • Update test/cli to verify regular file existence and content equality with cmp -s.

@betizzel

Copy link
Copy Markdown

Hi @szaidi-code

It looks like #13766 is fixing the same ./test/cli failure. I ran ./test/cli on both branches:

The second failure was hidden behind the first one before. The test still writes the .obsolete marker as local.omarchy-theme-1.0.0, but omarchy-theme-set-vscode now builds the extension version from the theme's contents (1.0.<cksum>), so the cleanup never matches that entry.

#13766 fixes the marker too, and it also checks that the theme file isn't a symlink.

Would you take a look at #13766 and see whether you agree it covers your fix? If it does, a +1 or review there would be great, and we can close this one so all the validation ends up on a single PR.

@sanjyay

sanjyay commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Independent community review

| This is an independent community review unaffiliated with the Omarchy team, intended to help prepare PRs for maintainer review.

Tested: test/cli VS Code theme assertions in an isolated Omarchy test environment.

Findings

This PR correctly identifies that bin/omarchy-theme-set-vscode writes a regular file rather than a symlink, fixing the not ok - vscode generated theme references current theme file failure.

However, resolving that assertion unmasks a secondary failure on the very next check:

ok - vscode generated light theme uses VS Code light uiTheme
ok - vscode generated theme matches current theme file
not ok - vscode generated theme clears obsolete extension marker

Root Cause

In test/cli, line 604 seeds .obsolete with a static version key:

echo '{"local.omarchy-theme-1.0.0":true}' >"$PI_TMPDIR/.vscode/extensions/.obsolete"

However, bin/omarchy-theme-set-vscode calculates the extension version from the theme file checksum:

GENERATED_EXTENSION_VERSION="1.0.$(cksum "$GENERATED_THEME" | cut -d' ' -f1)"

When register_generated_extension executes del(.[$key]), it looks for local.omarchy-theme-1.0.<cksum>. The seeded 1.0.0 entry remains in .obsolete, so the file is not empty and is not removed, triggering the assertion failure.

Recommendation

As noted earlier by @betizzel, PR #13766 by @SorenHJohansen addresses both stale assertions (the regular file check and the content-derived obsolete marker key) as well as asserting _watch: true, which allows ./test/cli to pass completely (115/115 ok). Consolidating validation behind #13766 would be the cleanest path forward.

If you'd prefer not to receive these independent reviews on your PRs, reply to this comment, and I won't review your future PRs.

@jandrusk

jandrusk commented Oct 1, 2026

Copy link
Copy Markdown

Triage (not posted): This correctly switches the vscode theme check from symlink to a real file, but #13766 already fixes the same test/cli failure and also covers the obsolete-extension-marker assertion that still fails on this branch (per community testing). Prefer landing #13766 (or rebasing this to match its full assertion set) so we do not merge a partial test fix.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for this. I read it against quattro beside #13766, which fixes the same test/cli failure, and I'm recommending #13766 to the maintainer rather than this one.

The symlink assertion here is fixed correctly: bin/omarchy-theme-set-vscode writes a real file now. But ./test/cli still fails at the next check, vscode generated theme clears obsolete extension marker. The test seeds .obsolete with local.omarchy-theme-1.0.0, and the script now sets the version to 1.0.<cksum of the theme> (bin/omarchy-theme-set-vscode:74) before cleanup runs, so the key it deletes never matches and the marker file is left behind. #13766 seeds the marker with the same content-derived version and also checks _watch. One more difference: [[ -f ... ]] is true for a symlink to a regular file, so the new check here would not catch the theme going back to being a symlink. #13766 adds ! -L for that.

I read both diffs and the script on quattro (Claude Opus 5.5), and Codex Medium compared the two separately and also picked #13766. It agreed with what earlier comments here already said, so treat that as agreement rather than an independent result. Codex raised the -f point on its own. Neither PR was run on a worker. Choosing between them is up to the maintainer.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thank you for this, @szaidi-code. #13766 got there first, and also fixes the obsolete-marker check this leaves alone, so this is closed in favour of it.

Closed at the maintainer's request. The review comment above has the details; it was done by Claude Opus 5.5 with Codex Medium as a second opinion, whose agreement is not independent.

@omarchybot omarchybot closed this Oct 3, 2026
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.

6 participants