CICD Label Flowchart

This flowchart describes the logic for managing the CICD label in Cocoon for running presubmit CI.

No Yes Yes No No Yes Yes No Event: PR Opened Is Draft? Is Privileged? Create Awaiting Check Run Add CICD Label Start Presubmits State: Awaiting State: Running Event: CICD Label Added Resolve Awaiting Check Run Event: Changes Pushed Is Privileged? Remove CICD Label Has CICD Label?

Alternative State Machine Diagram (PlantUML)

@startuml
state PR {
  state Waiting
  Waiting : entry / Create Awaiting Check Run
  Waiting : exit / resolve(awaiting check)

  state Running
  Running: entry/ Start Presubmits

  state if_priv2 <<choice>>
  Running --> if_priv2: onPushed
  if_priv2 --> Running: isPrivileged && labeled(CICD)
  if_priv2 --> Waiting : default: remove(CICD)

  state if_draft <<choice>>
  PR --> if_draft: openned

  if_draft --> Waiting : isDraft
  if_draft --> Running: isPrivileged
  if_draft --> Waiting : default

  Waiting --> Running: labeled(CICD)
}
@enduml