bundle: reject and hide deployment_id/version_id on jobs and pipelines#5441
Draft
shreyas-goenka wants to merge 1 commit into
Draft
bundle: reject and hide deployment_id/version_id on jobs and pipelines#5441shreyas-goenka wants to merge 1 commit into
shreyas-goenka wants to merge 1 commit into
Conversation
Collaborator
|
Commit: 83b7584 |
1675d50 to
bb53a67
Compare
bb53a67 to
b3361d1
Compare
b3361d1 to
5c00e17
Compare
5c00e17 to
d755193
Compare
deployment_id and version_id on a job/pipeline deployment block are set by the CLI to track the bundle deployment in the Deployment Metadata Service. They are not user-configurable, so this change: - Errors at validation time if either is set in bundle configuration (new validate.ValidateDeploymentFields mutator). - Adds a hide_from_plan lifecycle annotation to the direct engine that removes a field from the plan diff (display only), and applies it to deployment.version_id for jobs and pipelines (version_id is set on every deploy, so showing it is pure noise). version_id also gets ignore_local_changes/ignore_remote_changes, which are what keep its churn from driving an update or showing as drift. deployment_id is intentionally left to show in the plan. - Removes deployment_id/version_id from the generated JSON schema. Co-authored-by: Isaac
d755193 to
83b7584
Compare
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.
Why
deployment_idandversion_idon a job/pipelinedeploymentblock are set by the CLI to identify the bundle deployment and its version in the Deployment Metadata Service. They are not user-configurable: a hand-set value would be overwritten at deploy time, andversion_idis set anew on every deploy. This PR makes that contract explicit.What
Reject on input. New
validate.ValidateDeploymentFieldsmutator errors ifdeployment_idorversion_idis set on any job or pipeline, pointing at the offending location:New
hide_from_planannotation (direct engine). Adds a lifecycle category that removes a field from the plan diff (display only — it does not by itself decide whether a change is applied). Applied todeployment.version_idfor jobs and pipelines.version_idalso getsignore_local_changes+ignore_remote_changes, which are what actually keep its per-deploy churn from driving an update or showing as drift.deployment_idis intentionally left out of all three — it is stable, so it still shows in the plan and a change to it is applied normally.Hide from JSON schema.
removeDeploymentFieldsstripsdeployment_id/version_idfrom the generated JSON schema (jobs.JobDeployment/pipelines.PipelineDeployment).apps.AppDeployment.deployment_idis unaffected.