Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
106 changes: 98 additions & 8 deletions .github/scripts/ci_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,22 @@ def literal(node: ast.expr | None) -> Any:
"registry-casework",
"registry-caseworkctl",
"registry-coordinator",
"registry-session",
})
# One job builds these CI-profile binaries for every job that runs them,
# instead of each job building its own. Each consumer job is selected by one
# of CI_BINARY_CONSUMERS, and the builder runs whenever any of them does, and
# in the full sweep, which proves the build on its own.
CI_BINARY_PACKAGES = (
"registry-rstack",
"registry-session",
"registry-breg",
"registry-bregctl",
"registry-casework",
"registry-caseworkctl",
)
CI_BINARIES = ("rstack", "registry-session", "breg", "bregctl", "casework", "caseworkctl")
CI_BINARY_CONSUMERS: tuple[str, ...] = ("reference_host_smoke",)
# The shared dependency gate owns the list of development runner hosts; it
# is read as data, and test_ci_changes.py holds it equal to the gate's own.
_dev_runner_gate = literal_assignments(
Expand Down Expand Up @@ -275,6 +290,30 @@ def literal(node: ast.expr | None) -> Any:
# The journey scripts, their tables, the realm and the per-product inputs.
JOURNEY_INPUTS = ("products/platform/journeys/**",)

# The managed Scheduling task-authority journey: the ThunderID own-provider
# journey with an rstack dev Scheduling runtime bound to one live Casework task
# authority. Scheduling, the shared task-grant code that Scheduling links (the
# reverse-dependency closure reaches it), the rstack dev runner, Casework as
# the grant issuer and the ThunderID fixture select it, and so do the harness
# files the run reads. It runs in the ThunderID leg of the acceptance journeys.
SCHEDULING_MANAGED_JOURNEY_PACKAGES = frozenset(
{
"registry-casework",
"registry-caseworkctl",
"registry-rstack",
"registry-rstack-dev",
"registry-thunderid-tooling",
}
)
SCHEDULING_MANAGED_JOURNEY_INPUTS = (
"products/platform/journeys/own-provider.sh",
"products/platform/journeys/lib.sh",
"products/platform/journeys/projects/composed_fixtures.py",
"products/platform/journeys/expected-failures-thunderid.yaml",
"products/scheduling/scripts/run_managed_task_authority_journey.py",
"crates/registry-thunderid-tooling/thunderid-version.json",
)

# The token fixture corpus, read by the corpus test in
# registry-platform-testing and by the token characterisation test of every
# runtime that verifies a token. The corpus is not a crate, so its path names
Expand Down Expand Up @@ -411,11 +450,23 @@ def literal(node: ast.expr | None) -> Any:
"clients/typescript/generate-project.ts",
"clients/typescript/generate-service.ts",
"clients/typescript/package*.json",
"clients/typescript/registry-generate.js",
"clients/typescript/preview/**",
"products/platform/examples/service-previews/**",
"products/platform/scripts/test-service-previews.mjs",
"deploy/examples/business-registration/edge.yaml",
"deploy/examples/business-registration/session.yaml",
# The end-to-end export check serves the exported bundle with this host.
"deploy/examples/business-registration/host.mjs",
"deploy/examples/business-registration/package.json",
"deploy/examples/business-registration/package-lock.json",
"deploy/examples/business-registration/tests/build-host-client.mjs",
)

# registry-rstack-dev pins the digest of this shared bundle fixture, and the
# reference host's own test pins the same value.
SHARED_PREVIEW_BUNDLE = "deploy/examples/business-registration/tests/bundle/"

# The TypeScript clients generate from these OpenAPI documents, verify the
# shared Standard Webhooks vectors, and check the documents against what the
# clients assume.
Expand Down Expand Up @@ -1543,6 +1594,8 @@ def classify(
# Cross-product commitments select the two owning product gates
# explicitly below; each gate compiles and exercises its router.
pass
elif path.startswith(SHARED_PREVIEW_BUNDLE):
seeds.add("registry-rstack-dev")
elif path.startswith(("crates/", "products/")):
# A new or moved Rust package must not silently escape the test matrix.
force_all = True
Expand Down Expand Up @@ -1855,10 +1908,21 @@ def classify(
or bool(affected & BREG_EVIDENCE_COMPOSITION_PACKAGES)
)

acceptance_journeys = integration and (
scheduling_managed_journey = integration and (
complete
or any(matches(path, *JOURNEY_INPUTS) for path in paths)
or bool(affected & JOURNEY_PACKAGES)
or any(matches(path, *SCHEDULING_MANAGED_JOURNEY_INPUTS) for path in paths)
or bool(affected & (SCHEDULING_PACKAGES | SCHEDULING_MANAGED_JOURNEY_PACKAGES))
)

# The managed journey runs in the ThunderID leg, so selecting it selects
# the acceptance journeys.
acceptance_journeys = scheduling_managed_journey or (
integration
and (
complete
or any(matches(path, *JOURNEY_INPUTS) for path in paths)
or bool(affected & JOURNEY_PACKAGES)
)
)

# Running dev_run for a host change does not make the harness itself
Expand Down Expand Up @@ -1934,12 +1998,34 @@ def classify(

outputs = {
"full_sweep": full_sweep,
# The operator tests read the successor warnings bregctl prints.
"deployment": complete
or any(
path.startswith("deploy/") or path == "crates/registry-bregctl/src/apply_lifecycle.rs"
for path in paths
),
or any(matches(
path,
"deploy/**",
# The operator tests read the successor warnings bregctl prints.
"crates/registry-bregctl/src/apply_lifecycle.rs",
# The reference host wrapper loads the holder binding from source.
"clients/typescript/holder-function.ts",
"clients/typescript/core.ts",
"clients/typescript/version.ts",
"clients/typescript/generated-client-version.ts",
"clients/typescript/package.json", # Sets the module type for those imports.
) for path in paths),
"reference_host_smoke": complete
or bool(affected & (RSTACK_DEV_HARNESS_PACKAGES | {
"registry-session", "registry-breg", "registry-bregctl",
"registry-casework", "registry-caseworkctl",
}))
or any(matches(
path,
"deploy/examples/business-registration/**",
"clients/typescript/*.ts",
"clients/typescript/tsconfig*.json",
"products/casework/examples/standalone-decision/**",
"products/platform/scripts/prepare-service-preview-locks.mjs",
".github/workflows/ci.yml",
*SERVICE_PREVIEW_INPUTS,
) for path in paths),
"rust": bool(affected),
"rust_matrix": {"include": matrix},
"rust_packages": sorted(rust_packages),
Expand Down Expand Up @@ -1975,6 +2061,7 @@ def classify(
"scheduling_postgres": (
integration or "registry-platform-activation" in affected
) and bool(affected & (SCHEDULING_PACKAGES | {"registry-platform-dispatch"})),
"scheduling_managed_journey": scheduling_managed_journey,
"messaging_contracts": bool(affected & MESSAGING_PACKAGES),
"messaging_postgres": bool(affected & MESSAGING_PACKAGES),
"documents_contracts": bool(affected & DOCUMENTS_PACKAGES),
Expand Down Expand Up @@ -2002,6 +2089,9 @@ def classify(
"acceptance_journeys": acceptance_journeys,
"identifiers": identifiers,
}
outputs["ci_binaries"] = full_sweep or any(
outputs[consumer] for consumer in CI_BINARY_CONSUMERS
)
return outputs


Expand Down
Loading
Loading