Skip to content

Add core PhaseGraph DAG container for OpenHTF phases. - #1336

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test_985831084
Open

copybara-service[bot] wants to merge 1 commit into
masterfrom
test_985831084

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Add core PhaseGraph DAG container for OpenHTF phases.

  • Introduce PhaseGraph (a PhaseCollectionNode) whose phases form a DAG: a prerequisites map declares which phases must finish before another may start, and phases with no unmet prerequisites may run concurrently.
  • Add PhaseDependency(prerequisites, dependents) and PhaseGraph.from_dependencies() to build a graph from explicit dependencies; PhaseGraph.parallel() builds the degenerate graph with no dependencies (all phases eligible to run concurrently).
  • Require unique phase names, detect cycles via a deterministic topological sort, and validate prerequisites in the constructor. Only phases may be nodes for now; collection nodes raise PhaseWrapError.
  • Keep the prerequisites map synchronized with phase names across with_args(), with_plugs(), load_code_info(), apply_to_all_phases(), and copy(); include prerequisites in _asdict().
  • Export PhaseGraph and PhaseDependency at the top-level openhtf module.

@google-cla

google-cla Bot commented Oct 7, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

- Introduce PhaseGraph (a PhaseCollectionNode) whose phases form a DAG: a prerequisites map declares which phases must finish before another may start, and phases with no unmet prerequisites may run concurrently.
- Add PhaseDependency(prerequisites, dependents) and PhaseGraph.from_dependencies() to build a graph from explicit dependencies; PhaseGraph.parallel() builds the degenerate graph with no dependencies (all phases eligible to run concurrently).
- Require unique phase names, detect cycles via a deterministic topological sort, and validate prerequisites in the constructor. Only phases may be nodes for now; collection nodes raise PhaseWrapError.
- Keep the prerequisites map synchronized with phase names across with_args(), with_plugs(), load_code_info(), apply_to_all_phases(), and copy(); include prerequisites in _asdict().
- Export PhaseGraph and PhaseDependency at the top-level openhtf module.

PiperOrigin-RevId: 985831084
@copybara-service copybara-service Bot changed the title Add core PhaseGraph DAG container with topological sorting and node transforms. Add core PhaseGraph DAG container for OpenHTF phases. Oct 16, 2026

This branch has not been deployed

No deployments
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.

0 participants