Skip to content

CI: Refactor most yaml into python#84

Open
maheeraeron wants to merge 10 commits into
microsoft:mainfrom
maheeraeron:user/maheeraeron/python-ci
Open

CI: Refactor most yaml into python#84
maheeraeron wants to merge 10 commits into
microsoft:mainfrom
maheeraeron:user/maheeraeron/python-ci

Conversation

@maheeraeron

Copy link
Copy Markdown
Collaborator

Refactors away most of our YAML to be simple wrappers into python scripts. Allows us to invoke CI steps locally and verify things without much iteration.

@mebersol mebersol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[Copilot] Nice refactor — moving CI logic into testable Python with matrix.yml as the single source of truth and a local invoke_ci_locally.py is a real ergonomics win. A few inline comments:

  • release_common.py: load_release_config() is defined twice (duplicate block) — should be deleted.
  • CreateRelease.yml: the workflow_dispatch run-id resolution can emit an empty run_id and fail later in download-artifact; suggest a fast-fail guard.
  • stage_artifacts.py: flattening logs by basename can silently overwrite same-named logs from different subfolders.
  • Nits: missing trailing newline in release.yml and test_release.py.

None are blockers; the duplicate function and the run-id guard are the two worth addressing before merge.

Comment thread .github/workflows/CreateRelease/data/release.yml Outdated
Comment thread .github/workflows/Build/scripts/stage_artifacts.py Outdated
Comment thread .github/workflows/CreateRelease.yml
Comment thread .github/workflows/CreateRelease/scripts/release_common.py
@maheeraeron maheeraeron requested a review from mebersol June 17, 2026 22:10

@mebersol mebersol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[Copilot] Re-review pass (full diff). The earlier four comments still stand (duplicate load_release_config, empty run_id guard, log-flatten overwrite, trailing newlines). One additional diff-level observation added inline: the old workflow installed VC.ASAN and the new per-variant component lists drop it — likely intentional, flagged to confirm.

Otherwise the refactor looks solid: matrix parity with the old Platform-Build.yml (same 6 variants, AARCH64+VS2022 correctly excluded) is preserved and enforced by a unit test; build/release logic is now testable Python with matrix.yml/release.yml as single sources of truth; concurrency group + cancel-in-progress: false correctly serializes releases; and the workflow_run + head_branch == 'main' gating keeps fork-PR builds from triggering the privileged release job. Nice work.

Comment thread .github/workflows/Build/scripts/install_vs_components.py

@chris-oo chris-oo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

seems reasonable to me, but you probably want another set of reviews from someone more familiar with python



def _vs_install_path() -> Path:
vswhere = Path(r"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe")

@apop5 apop5 Jul 7, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is recreating the functionality provided in edk2-pytool-library pip module

https://github.com/tianocore/edk2-pytool-library/blob/4d0b5009580b1c43eb0ce275eaa2a0bcbcefe286/edk2toollib/windows/locate_tools.py#L93

Edk2-pytool-library would download a copy of vswhere (https://github.com/tianocore/edk2-pytool-library/blob/4d0b5009580b1c43eb0ce275eaa2a0bcbcefe286/edk2toollib/windows/locate_tools.py#L43) and use that, but this is relying on vshwere being installed at a specific location on the system, which makes this script very brittle

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.

4 participants