Skip to content

fix(homebrew): overwrite generated gateway config during migration - #3752

Merged
drew merged 1 commit into
mainfrom
codex/3746-homebrew-config-migration
Sep 27, 2026
Merged

drew merged 1 commit into
mainfrom
codex/3746-homebrew-config-migration

Conversation

@drew

@drew drew commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator

🏗️ build-from-issue-agent

Summary

Fix Homebrew post_install migration for the two exact legacy gateway configs. Homebrew's guarded Pathname#write rejects existing files, so the migration now uses atomic_write while first-install creation remains unchanged.

Related Issue

Closes #3746

Changes

  • Use gateway_config.atomic_write only when an existing config matches a formula-generated schema-v1 default.
  • Tighten the generated-formula test to require exactly one first-install write and a migration atomic_write.
  • Record the migration invariant in architecture/build.md.

Deviations from Plan

None.

Testing

  • Focused formula test: uv run pytest python/openshell/release_formula_test.py::test_generate_homebrew_formula_uses_channel_urls_and_exact_version -q
  • mise run pre-commit
  • mise run test (includes 257 Python tests and the Rust and TypeScript suites)
  • mise run ci — blocked by unrelated Go gateway tests on this host: /etc/openshell/gateways/default adds a system gateway to cases that expect an empty list. A first run also encountered stale golangci-lint cache entries from a deleted worktree; a clean-cache rerun got past lint and reached the Go test failure.

Checklist

  • Conventional commit with DCO signoff
  • Documentation updated in architecture/build.md
  • No e2e files changed; macOS Homebrew post_install was not run on this Linux host

Closes #3746

Use Homebrew atomic_write for exact legacy config migrations and keep the first-install write distinct in the formula test.

Signed-off-by: Drew Newberry <anewberry@nvidia.com>
@drew
drew enabled auto-merge September 27, 2026 18:55
@drew
drew added this pull request to the merge queue Sep 27, 2026
Merged via the queue into main with commit d1a19c7 Sep 27, 2026
73 checks passed
@drew
drew deleted the codex/3746-homebrew-config-migration branch September 27, 2026 19:06
@drew drew added this to the OpenShell 0.1.2 milestone Sep 28, 2026
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.

fix(homebrew): post_install cannot migrate legacy gateway.toml because Pathname#write refuses to overwrite

2 participants