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:

  1. Keep scheduled PEP in current_policy for "real" pipelines
  2. Properly handle variable precedence for scheduled PEPs
  3. Support the variables_override option 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

Edited by 🤖 GitLab Bot 🤖