fix: bind binary services to pre-linked projects on add#70
Merged
munezaclovis merged 2 commits intomainfrom Apr 21, 2026
Merged
fix: bind binary services to pre-linked projects on add#70munezaclovis merged 2 commits intomainfrom
munezaclovis merged 2 commits intomainfrom
Conversation
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.
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 #69
When
pv service:add mailruns, projects linked before the service existed have noServices.Mailflag set, soProjectsUsingServicereturns nothing and their .env is never updated.Fix by binding all linked Laravel projects to the service before running the env update step.