Repository navigation
feat(promotion): add promotion environments - #44
Merged
Merged
Conversation
n8n 2.46 replaced /promotions/connections with /promotions/environments. Add 'n8n promotion environment' list, get, create, update, delete, connect, disconnect, and project list|add|remove for the 10 phase-35 operations. Connection commands are unchanged for older instances. - Environment IDs are validated as UUIDs, settings against the direction, all before any request. - create/update drop read-only fields from 'get --output json' documents (id, provider, checkout, timestamps, remote.repositoryPath; plus scope and direction on update) and name them on stderr. - update, delete, disconnect, and project remove confirm; non-interactive runs need --yes, and update --input - always needs --yes. - A bare 404 from environment commands hints at 'promotion connection' (pre-2.46); connection commands hint at 'promotion environment'. - Manifest: phase 35 implemented; deliveredThrough raised to 35. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 tasks done
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.
What / why
n8n 2.46.4 replaced
/promotions/connectionswith/promotions/environments. This PR addsn8n promotion environment ...for the 10 phase-35 operations. Thepromotion connectioncommands stay unchanged because older instances still serve them (their manifest ops stayretired). Environment apply, apply/continue, promote and the project-scopedconfigId→environmentIdchange are left for the phase-36 follow-up.Changes
internal/n8n/promotion_environment.go): list (scope, direction and providerId filters, cursor), create, get, update, delete, connect, disconnect, and project list/add/remove. Environment IDs must be UUIDs (specformat: uuid). Settings are a direction union: applybranchName, promotebaseBranchName+ requiredcreateBranchOnPromotion. They are checked against the direction before any request.internal/cli/promotion_environment.go):promotion environment list|get|create|update|delete|connect|disconnectandproject list|add|remove. Flags, output, pagination (--all) and--input file|-work the same way as inpromotion connection.Not sent (read-only): ...), so aget --output jsondocument can be fed back:id, provider, checkout, createdAt, updatedAt, remote.repositoryPath. On update,scopeanddirectionare dropped too, and the document's direction is used first to check the settings shape.update,delete,disconnectandproject removeprompt when interactive and refuse without--yesbefore any request.update --input -always needs--yes.connect(safe to repeat),createandproject adddon't prompt, the same as their connection equivalents.n8n promotion connection). Connection commands say the reverse (n8n promotion environment). Only hint text is added; 503 handling and connection behaviour are unchanged.promotiongroup help now covers environments for 2.46+ and connections for older instances. Docs regenerated.implementedwith command paths, availability untouched.deliveredThroughraised to 35.Verification
make checkpasses locally (with the n8n 2.46.4openapi.upstream.ymlpresent;TestManifestMatchesSpec/upstreamandTestPhaseCountspass)make docsrun if CLI help changed (docs/README.md updated)v*tag or release commit in this PR (maintainer releases separately)Notes for reviewer
Idempotency-Keyon environment create/connect/project add, but their connection equivalents don't use--idempotency-key, so it isn't added here. Connect is idempotent anyway, and a duplicate create or link gets a 409.updatenow prompts. This differs fromconnection update: an environment update can replace settings, which was the promptingconfig setin the connection model, and can leave the checkout stale.🤖 Generated with Claude Code