feat(deploy): per-stage .deployignore semantics + --force flag#201
Open
mattcarranza10 wants to merge 1 commit into
Open
feat(deploy): per-stage .deployignore semantics + --force flag#201mattcarranza10 wants to merge 1 commit into
mattcarranza10 wants to merge 1 commit into
Conversation
Match the per-stage skip logic from the api repo's
scripts/deploy/check_deploy_ignore.sh and add a --force flag so manual
local deploys can bypass the skip when needed.
.deployignore is now interpreted as:
- missing -> deploy
- empty/whitespace only -> skip every stage (legacy blunt behaviour)
- has content -> one stage per line, case-insensitive; skip
when the current stage matches a listed one
Previously any .deployignore file caused a blunt skip for every stage,
so services that opted into auto-deploy v2 with a stage-scoped
.deployignore (e.g. igaming with "dev") could not be deployed via
draft to any environment.
The skip log now reports the matched stage and reminds the user about
--force, e.g. "Skipping <path>: stage \"dev\" listed in .deployignore
(use --force to override)".
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Description
Bring the
draft deploy:*commands in line with the per-stage.deployignoresemantics that CI uses (scripts/deploy/check_deploy_ignore.shin the api repo, introduced in api#6426) and add a--forceflag so engineers can still trigger a manual local deploy when a stage is otherwise skipped.Motivated by
igaming,igaming-bff, andigaming-live: those services ship a.deployignorecontainingdevto silence the legacy auto-redeploy on push tomain, butdraft deploy:devwas reading the file with the old blunt semantics ("file present → skip everything"), so even manual local dev deploys viadraftwere no-ops while still printing[SUCCESS].No new dependencies.
Task Context
What is the current behavior?
internal/actions/deploy/service.go::validateServiceDir(and the same call infunction.go) treats any.deployignoreas a hard skip for the service, regardless of stage. As a result:draft deploy:dev igaming-bff(and the equivalentdeploy:func:dev) silently skips withSkipping <path>: .deployignore foundand the run still terminates as a[SUCCESS]..deployignore(e.g. contentdev) is not honoured — every stage gets blocked, not just the listed one.What is the new behavior?
.deployignoreis now interpreted exactly like CI:A new
--forceflag ondeploy:dev,deploy:prod,deploy:feature,deploy:func:dev,deploy:func:prod, anddeploy:func:featurebypasses the.deployignorecheck entirely (theserverless.ymlexistence check still runs).The skip log message now reports the matched stage and the override hint, e.g.:
Additional Context
internal/actions/deploy/deployignore.go::shouldSkipForStage(absPath, stage) (skip bool, reason string, err error).validateServiceDirwas narrowed to a pureserverless.ymlexistence check so that--forcecan bypass the skip without bypassing the structural validation.DeployServiceandDeployFunctiongained aforce boolparameter; the cobra layer wires--forcethrough..deployignoreand for services with an empty.deployignore(they still skip every stage, matching the CI script).services/igaming-bff/.deployignore(and the other igaming services) — contentdev. After this PR,draft deploy:dev igaming-bffwill skip with a clear stage-scoped message and--forcewill deploy;draft deploy:prod igaming-bffwill deploy without prompting.Checklist
go build ./...go vet ./...revive -config revive.toml -formatter friendly ./internal/actions/deploy/... ./cmd/commands/deploy/....deployignore(planned post-merge once a release ships).🤖 Generated with Claude Code