fix gmail packaging gaps for binary installs (PNX-171)#18
Merged
Conversation
- thread ctx.solracHome through gmail client via createGmailClientApi factory; paths root under $SOLRAC_HOME/integrations/gmail/ instead of hardcoded ~/.solrac/gmail - add `solrac gmail-auth <alias>` subcommand so curl-pipe binary installs can bootstrap OAuth without a source checkout; banner prints resolved home + gmail dir, missing-credentials error links to Google Cloud Console - move scripts/gmail-auth.ts to src/integrations-builtin/gmail/auth-cli.ts so it ships in the compiled binary; single path for source + binary - update USAGE.md with new flow + migration note for pre-PNX-171 layout
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.
Summary
Spun out of PNX-168 (Bun packaging). Two gaps surfaced verifying v0.3.0-rc1 on a clean machine:
~/.solrac/gmail/path ignoredSOLRAC_HOME, so operators with a non-default home couldn't use gmail at all.scripts/gmail-auth.ts). The curl-pipe binary install shipssolraconly — nobun, no scripts — leaving binary-install operators with no way to mint per-account token files.Why
The integration runtime worked fine in rc1 (deps bundled, self-gates correctly) — only the bootstrap UX and path resolution were broken. This blocks gmail in any non-default deployment and on every curl-pipe install.
Changes
ctx.solracHomeonIntegrationContext— blessed integrations now resolve paths under$SOLRAC_HOME/integrations/<name>/. Forward-compatible namespace for future blessed integrations (Slack, Linear, etc.).createGmailClientApi(solracHome)factory insrc/integrations-builtin/gmail/client.tsreplaces module-level path constants. State is per-instance, not module-global.solrac gmail-auth <alias>subcommand (newsrc/integrations-builtin/gmail/auth-cli.ts) — ships in the compiled binary. Banner prints resolvedsolracHome+gmailDir. Missing-credentials error links to the specific Google Cloud Console URLs.loadConfigdispatch inmain.tsso subcommands run before env validation — fresh installs can authenticate gmail before configuring the bot.scripts/gmail-auth.ts— single path through the subcommand.USAGE.md(new flow + pre-PNX-171 migration note),INSTALL.md(CLI subcommands table).Impact
~/.solrac/gmail/to$SOLRAC_HOME/integrations/gmail/. Migration is doc-only (onemvcommand, no auto-migrate). rc1 is rc — adoption is low.createIntegrationContext()signature change: now takessolracHome: string. Updated all callers (smoke harnesses, tests).scripts/gmail-auth.tsgone: any operator docs/runbooks referencing it need to switch tosolrac gmail-auth <alias>.Test plan
npm run typecheck— cleanbun test— 722 pass / 0 failbun test src/integrations-builtin/gmail/client.test.ts— 8 new path-resolution tests passbun src/main.ts gmail-auth— usage errorbun src/main.ts gmail-auth "bad alias!"— validation errorSOLRAC_HOME=/tmp/solrac-test bun src/main.ts gmail-auth ieee— banner + GCP URL hint on missing credentialssolrac gmail-auth <alias>opens browser and writes tokens to$SOLRAC_HOME/integrations/gmail/mv ~/.solrac/gmail $SOLRAC_HOME/integrations/gmailfollowed by restart loads accounts as before