APP-4658 - Add path-mapping flags to version-promote and version-release#88
Merged
asafgabai merged 6 commits intoJun 21, 2026
Merged
Conversation
Add --map-in, --map-out, and --map-type flags to the promote and release
commands for regex-based artifact path transformations during promotion.
Usage:
jf at version-promote my-app 1.0.0 PROD \
--map-type=".*" --map-in="(.*)" --map-out="stable-release/$1"
Multiple mappings via semicolon separation:
--map-in="(.*);(.*\.jar)" --map-out="release/$1;jars/$1" --map-type=".*;maven"
The mappings are forwarded as modifications.mappings in the promotion
request body to be applied by the Bundle Handler Service.
Co-authored-by: Cursor <cursoragent@cursor.com>
- TestPromoteVersion_WithPathMappings: promotes with --map-in, --map-out, --map-type and verifies stage advances to DEV - TestPromoteVersion_WithPathMappings_InvalidRegex: verifies invalid regex in --map-in returns an error Co-authored-by: Cursor <cursoragent@cursor.com>
c00d934 to
b916905
Compare
- Reject --map-type when --map-in/--map-out are missing - Reject empty entries from trailing semicolons in all mapping flags - Remove unused BuildPathMappingsDescription function Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
asafgabai
reviewed
Jun 18, 2026
| } | ||
| } | ||
|
|
||
| if len(inputs) != len(outputs) { |
Collaborator
There was a problem hiding this comment.
The practice of requiring both list flags with the same length is very uncommon and makes the command much more complex to read and write.
Taking into account the fact that the length of --map-type can be smaller than the others making it even more confusing and unclear.
The existing --source-type-* flags show a cleaner approach:
--source-type-packages="type=npm, name=@gpizza/pizza-frontend, version=1.0.0, repo-key=tests-npm-local; type=npm, name=@gpizza/green-pizza, version=2.0.1"Another option is to limit the path mappings to 1 in the CLI (AFAIK that's the situation in Distribution's path mappings).
Consider discussing this with the product.
Replace --map-in, --map-out, --map-type with a single structured flag following the same pattern as --source-type-packages: --path-mapping="input=(.*), output=stable-release/$1, package-type=.*" Multiple mappings via semicolons: --path-mapping="input=(.*), output=release/$1; input=(.*\.jar), output=jars/$1, package-type=maven" Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
asafgabai
approved these changes
Jun 21, 2026
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
--map-in,--map-out, and--map-typeflags toversion-promoteandversion-releasecommandsmodifications.mappingsin the request body to the Bundle Handler ServiceUsage
Changes
model/promote_app_version_request.goPromotionPathMapping,PromotionModificationstypes andModificationsfield toCommonPromoteAppVersioncommands/flags.go--map-in,--map-out,--map-typeflag definitionscommands/version/version_utils.goParsePathMappings()functioncommands/version/promote_app_version_cmd.gocommands/version/release_app_version_cmd.gomodel/release_app_version_request.gomodificationsparameter in constructor*_test.goParsePathMappingsand updated existing testsTest plan
ParsePathMappingscovering: single/multiple mappings, partial package types, error cases (mismatched counts, missing flags)jf at version-promotewith--map-inand--map-outsends correct request bodyJira
APP-4658
Made with Cursor