Add dry_run option to PipelineContext for scheduled pipeline execution policies
Why are we doing this work
As identified in #543105, we need better abstractions for handling scheduled pipeline execution policies (PEPs). Currently, we cannot pass scheduled PEP as current_policy because it's used as a flag to treat pipelines as virtual, and pipelines won't be persisted.
StopDryRun uses current_policy to ensure policy pipelines aren't persisted, but we're missing a proper dry_run abstraction that would allow us to:
- Keep scheduled PEP in
current_policyfor "real" pipelines - Properly handle variable precedence for scheduled PEPs
- Support the
variables_overrideoption for scheduled policies
Adding a dry_run option to ee/lib/gitlab/ci/pipeline/pipeline_execution_policies/pipeline_context.rb would provide the missing abstraction needed to distinguish between virtual policy pipelines and actual scheduled pipelines.
Relevant links
- Related issue: #543105 (Enforce variable precedence from scheduled PEP)
- MR introducing
variables_override: !186120 (merged) - Epic: &16430 (closed)
Edited by 🤖 GitLab Bot 🤖