fix(branding): repair branded CodeQ build broken by upstream drift#11
Open
Kenny-Heitritter wants to merge 1 commit into
Open
fix(branding): repair branded CodeQ build broken by upstream drift#11Kenny-Heitritter wants to merge 1 commit into
Kenny-Heitritter wants to merge 1 commit into
Conversation
Two pre-existing bugs surfaced after the upstream sync, both of which broke branded (CodeQ) builds: 1. External scoped package @gitlab/opencode-gitlab-auth was renamed to @gitlab/codeq-gitlab-auth by the opencode->productName replacement, causing 'bun install' to 404 and the build to fail. Exclude scoped packages (negative lookbehind for @<scope>/) and -gitlab-auth. 2. The CLI logo transform injected a logo() that references a 'const LOGO' array which upstream removed (logo now comes from ./logo glyphs), so the branded binary crashed at startup with 'LOGO is not defined'. Guard the CLI + TUI logo transforms to no-op when the expected structures are absent, preserving the upstream logo instead of crashing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two pre-existing bugs in
branding/apply.tsthat broke branded (CodeQ) builds after the recent upstream sync (feat/upstream-sync-opus-4-6). Both were found while verifying a brandedbun run build --singleon macOS arm64 — the branded build failed to compile, and once worked around, the binary crashed at startup.Bug 1 — external package renamed → build fails
The
opencode -> codeqproduct-name replacement also rewrote the external scoped package@gitlab/opencode-gitlab-auth→@gitlab/codeq-gitlab-auth(inplugin/index.tsimport +packages/opencode/package.json).bun installthen 404s on the nonexistent package and the build aborts:Fix: add a negative lookbehind for scoped packages (
@<scope>/) and exclude-gitlab-authfrom the product-name regex, so external@scope/opencode-*packages are preserved (matches the existing@opencode-aiexclusion intent).Bug 2 —
LOGO is not defined→ branded binary crashes at startupThe CLI logo transform injects a
logo()that iterates aconst LOGOarray, but upstream removed that array (the logo now comes from./logoasglyphs.left/right). Theconst LOGO = [...]replacement no-ops while the injectedlogo()still referencesLOGO, so the branded binary crashes immediately:Fix: guard both the CLI (
ui.ts) and TUI (logo.tsx) logo transforms — if the expectedLOGO/LOGO_LEFT/LOGO_RIGHTstructures are absent, skip the rewrite and keep the upstream logo (cosmetic loss of the purple-Q branding, but a working binary). Resilient to future upstream logo changes.Verification (macOS arm64)
On this branch (off
dev, no other changes):bun branding/apply.ts qbraid→ both structures preserved (no@gitlab/codeq..., no brokenLOGO).bun run build --single→ brandedcodeqbinary builds cleanly../dist/codeq-darwin-arm64/bin/codeq --version→ boots without crashing (previously crashed).codeq models qbraid(clean config) → lists models, logo renders.Notes
./logoglyph structure if desired (cosmetic only).🤖 Generated with opencode