Skip to content

feat(up): pipeline release version constrains#187

Open
project-defiant wants to merge 10 commits intodevfrom
pipeline-version
Open

feat(up): pipeline release version constrains#187
project-defiant wants to merge 10 commits intodevfrom
pipeline-version

Conversation

@project-defiant
Copy link
Copy Markdown
Collaborator

@project-defiant project-defiant commented May 1, 2026

Context

  • Adds PipelineRunConfig Pydantic model (src/orchestration/models/run_config.py) that validates run_name against the pattern <prefix>/(platform|ppp)-YYMM-N (e.g. sz/platform-2605-1),
    rejects past dates, and rejects invalid month numbers (outside 01–12)

    • Removes release_name from unified_pipeline.yaml — all URI derivation and downstream version labelling is now driven by a single run_name field; GCS bucket constants moved to
      utils/common.py
    • Replaces the dev_uri or release_uri conditional pattern with a single release_uri property on both PipelineRunConfig and UnifiedPipelineConfig; is_dev flag remains explicit in the YAML
      with a clear description

    release_uri behaviour

    • is_dev: true (default) → gs://open-targets-pipeline-runs/<run_name>
    • is_dev: falsegs://open-targets-pre-data-releases/<flavor>-<YYMM>

    A secondary label release_name (<flavor>-<YYMM>) is derived from run_name and passed to PTS as ot_release and to Gentropy as l2g_training_version.

    Test Plan

    • uv run pytest passes (72 tests, 1 expected xfail)
    • Set run_name to a past date (e.g. sz/platform-2603-1) — UnifiedPipelineConfig instantiation raises ValidationError
    • Set run_name to an invalid format (e.g. sz/platform-2605) — raises ValidationError
    • Set run_name to an invalid month (e.g. sz/platform-2699-1) — raises ValidationError
    • Set valid run_name with is_dev: truerelease_uri resolves to gs://open-targets-pipeline-runs/<run_name>
    • Set is_dev: falserelease_uri resolves to gs://open-targets-pre-data-releases/<flavor>-<YYMM>

    Closes Enforce pipeline run version in orchestration issues#4326

@project-defiant project-defiant changed the title Pipeline version feat(up): pipeline release version constrains May 1, 2026
@project-defiant project-defiant marked this pull request as ready for review May 1, 2026 16:48
@project-defiant project-defiant requested a review from Copilot May 1, 2026 16:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a single, validated run_name-driven versioning/output-location model for Unified Pipeline runs, replacing the prior dev_uri or release_uri pattern and removing the separate release_name field from the YAML config.

Changes:

  • Add PipelineRunConfig (Pydantic) to validate run_name and derive release_uri / release_name.
  • Update Unified Pipeline config + step URI builders to rely on a single release_uri.
  • Add tests and expand documentation describing run_name, is_dev, and derived labels.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_run_config.py Adds unit tests for PipelineRunConfig validation and URI/name derivation.
src/orchestration/models/run_config.py New Pydantic model implementing run_name validation and release_uri / release_name derivation.
src/orchestration/dags/config/unified_pipeline.py Switches to PipelineRunConfig and consistently passes release_uri / derived release_name into templates.
src/orchestration/dags/config/unified_pipeline.yaml Replaces release_name with documented run_name + is_dev behavior.
src/orchestration/utils/common.py Centralizes GCS bucket root constants used for URI construction.
src/orchestration/models/step.py Removes dev_uri or release_uri fallback; uses release_uri only.
src/orchestration/operators/differs/manifest_artifact_differ.py Docstring update reflecting release_uri usage.
docs/unified_pipeline/config.md Documents run_name format, is_dev behavior, and derived release_name.
docs/unified_pipeline/README.md Updates release-run guidelines to include setting run_name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_run_config.py
Comment on lines +10 to +20
_CURRENT_YYMM = datetime.now().strftime("%y%m")


def _future_yymm() -> str:
now = datetime.now()
if now.month == 12:
return f"{(now.year + 1) % 100:02d}01"
return f"{now.year % 100:02d}{now.month + 1:02d}"


_FUTURE_YYMM = _future_yymm()
# N — revision number, starting from 1 (increment if re-running the same release)
#
# Examples: 'sz/platform-2605-1', 'abc/ppp-2606-2'
run_name: 'sz/platform-2605-1'
Comment on lines +41 to +49
yymm = int(match.group(3))
current_yymm = int(datetime.now().strftime("%y%m"))
if yymm < current_yymm:
raise ValueError(
f"run_name date '{match.group(3)}' is in the past "
f"(current: {current_yymm:04d}). "
"Update run_name to the current or a future YYMM to avoid "
"overwriting an existing release."
)
Comment on lines +18 to +21
| `flavor` | `platform` for a public Platform release, `ppp` for a Partner Preview release | `platform` |
| `YYMM` | Two-digit year + two-digit month of the release. Must be the current month or later — past dates are rejected to prevent overwriting existing releases. | `2605` |
| `N` | Revision number, starting from 1. Increment if re-running the same release. | `1` |

Comment on lines +5 to +8
# YYMM — two-digit year + two-digit month of the release (e.g. '2605' for May 2026)
# must be the current month or later, to prevent overwriting existing releases
# N — revision number, starting from 1 (increment if re-running the same release)
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce pipeline run version in orchestration

3 participants