feat(build): add CS_N_PATH to override custom service build context#93
Open
acamarata wants to merge 1 commit into
Open
feat(build): add CS_N_PATH to override custom service build context#93acamarata wants to merge 1 commit into
acamarata wants to merge 1 commit into
Conversation
Adds a BuildPath field to CustomService and a CS_N_PATH env var so
projects can point a custom service at a non-standard directory instead
of the default ./services/{name}. Absolute paths and '..' traversal are
rejected at parse time.
Used by web/backend to wire CS_1 (ping_api) to ./backend/services/ping_api
instead of the untracked legacy ./services/ping_api copy.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
BuildPathfield toCustomService(config/types.go) and parses a newCS_N_PATHenv var per custom service slot..traversal at parse time (security validation)buildCustomServicein compose/custom_services.go to useBuildPathwhen set, falling back to the default./services/{name}Motivation
web/backendreorganized ping_api intobackend/services/ping_api/but the compose generator kept hardcoding./services/{name}. The deployed prod container was building from an untracked legacy copy at./services/ping_api/that lacked billing, Stripe, license, dunning and CRM modules.CS_N_PATHletsweb/backendsetCS_1_PATH=./backend/services/ping_apiin.env.*and havenself buildgenerate the correct context path.Test plan
go test -mod=vendor ./internal/config/... -run TestCustomServices— all 6 tests passnself buildwithCS_1_PATH=./backend/services/ping_apigenerates compose with correctbuild.contextCS_1_PATH=/etc/secretsis rejected at parse time with clear errorCS_1_PATH=../../outsideis rejected at parse time with clear errorCS_1_PATHstill defaults to./services/ping_api(no regression)