feat(eng-12002): Add metadata flag to push command#293
Open
BartoszBlizniak wants to merge 1 commit into
Open
Conversation
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
Adds push-time metadata flags to
cloudsmith push <format>so SBOM / BuildInfo / generic JSON can be attached in a single command instead of a separatecloudsmith metadata addfollow-up.New flags on every push subcommand:
--metadata-content-file PATH(or-for stdin)--metadata-content JSON--metadata-content-type MIME--metadata-source-identity TEXTFlow:
POST /v2/metadata/validate/before any S3 upload — malformed metadata can no longer leave orphan packages.create_package, attach metadata viaPOST /v2/metadata/.CLOUDSMITH_METADATA_FAILURE_MODE=warn(or0) to downgrade to a warning + copy-paste retry hint.metadata_attachmentin JSON output (success and error envelopes).Reuses shared metadata helpers from
cli/metadata_common.pyType of Change
Additional Notes
$CLOUDSMITH_METADATA_FAILURE_MODE=warnwill result in the package still being uploaded despite the metadata being invalid.Examples
Push:
Push with invalid metadata:
Push with invalid metadata and
$CLOUDSMITH_METADATA_FAILURE_MODEset towarn: