Skip to content

fix: bind binary services to pre-linked projects on add#70

Merged
munezaclovis merged 2 commits intomainfrom
claude/issue-69-20260420-2129
Apr 21, 2026
Merged

fix: bind binary services to pre-linked projects on add#70
munezaclovis merged 2 commits intomainfrom
claude/issue-69-20260420-2129

Conversation

@munezaclovis
Copy link
Copy Markdown
Contributor

Fixes #69

When pv service:add mail runs, projects linked before the service existed have no Services.Mail flag set, so ProjectsUsingService returns nothing and their .env is never updated.

Fix by binding all linked Laravel projects to the service before running the env update step.

github-actions Bot and others added 2 commits April 20, 2026 21:37
When `pv service:add mail` (or s3) runs, projects that were linked before
the service existed have no Services.Mail flag set, so ProjectsUsingService
returns nothing and their .env is never updated.

Fix by calling bindBinaryServiceToAllProjects before updateLinkedProjectsEnvBinary
in addBinary, which marks all linked Laravel/laravel-octane projects as using
the service so the .env update step can find and update them.

Co-authored-by: Clovis <munezaclovis@users.noreply.github.com>
Address review feedback on #70:

- Return an error from bindBinaryServiceToAllProjects for unknown svcName so
  a future binary service added without updating the switch fails loudly at
  call time instead of silently skipping the retroactive-bind step. The
  ProjectServices fields and the cases here are a synchronization pair with
  no compile-time enforcement; the default case is the only guard.
- Add unit coverage for the unknown-service error path and assert no project
  Services mutation occurs when the service is unknown.
- Add an integration-level unit test chaining bind → ProjectsUsingService to
  lock the contract that motivates the fix for #69.
- Mirror mail-binary.sh's pre-link assertion in s3-binary.sh so the S3 path
  of the retroactive bind is covered end-to-end.
@munezaclovis munezaclovis merged commit 1e91e79 into main Apr 21, 2026
1 check passed
@munezaclovis munezaclovis deleted the claude/issue-69-20260420-2129 branch April 21, 2026 03:40
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.

Mail linking failing in 2c2 ci tests

1 participant