Skip to content

Add status conditions and observedGeneration#4535

Open
Okabe-Junya wants to merge 1 commit into
actions:masterfrom
Okabe-Junya:Okabe-Junya/feature/status-conditions-observedgeneration
Open

Add status conditions and observedGeneration#4535
Okabe-Junya wants to merge 1 commit into
actions:masterfrom
Okabe-Junya:Okabe-Junya/feature/status-conditions-observedgeneration

Conversation

@Okabe-Junya

@Okabe-Junya Okabe-Junya commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

What

  • Add status.observedGeneration and a standard "Ready" condition to AutoscalingRunnerSet, EphemeralRunnerSet, EphemeralRunner, and AutoscalingListener.
  • Every status write stamps observedGeneration
    • "Ready" condition is updated on phase/readiness transitions. phase is unchanged for backward compatibility.
  • (CRD regenerated with make manifests)

Why

The resources expose only a free-form "phase" string, so clients cannot tell whether the status reflects the latest spec or wait for readiness in a standard way. With this change, k wait --for=condition=Ready and generation == status.observedGeneration checks work, per the k8s API conventions for status.

@Okabe-Junya

Copy link
Copy Markdown
Contributor Author

Just noticed that some files are not marked as “generated” in gitattribute. Let me create another PR to fix this

@Okabe-Junya

Copy link
Copy Markdown
Contributor Author

Just noticed that some files are not marked as “generated” in gitattribute. Let me create another PR to fix this

#4536

@Okabe-Junya
Okabe-Junya force-pushed the Okabe-Junya/feature/status-conditions-observedgeneration branch from 2478def to 5b57f1f Compare July 25, 2026 19:50
@Okabe-Junya Okabe-Junya changed the title [WIP] Add status conditions and observedGeneration Add status conditions and observedGeneration Jul 25, 2026
@Okabe-Junya
Okabe-Junya marked this pull request as ready for review July 25, 2026 19:55
Copilot AI review requested due to automatic review settings July 25, 2026 19:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the controller-managed CRD statuses to follow Kubernetes conventions by adding status.observedGeneration and a standard Ready condition for the actions.github.com API resources, enabling clients to reliably detect spec/status convergence and use kubectl wait --for=condition=Ready.

Changes:

  • Add and stamp status.observedGeneration on status updates across the relevant controllers.
  • Introduce a shared setReadyCondition helper and wire Ready condition updates into reconciliation/status transitions.
  • Regenerate CRDs (config + Helm chart CRD bundles) and update deep-copy generation for new status fields.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
controllers/actions.github.com/ephemeralrunnerset_controller.go Stamp ObservedGeneration, set Ready condition, and patch status only when it changes.
controllers/actions.github.com/ephemeralrunnerset_controller_test.go Extend tests to validate ObservedGeneration and Ready condition behavior.
controllers/actions.github.com/ephemeralrunner_controller.go Add ObservedGeneration stamping and Ready condition updates for runner lifecycle transitions.
controllers/actions.github.com/conditions.go Add shared helper to set/truncate Ready status condition.
controllers/actions.github.com/autoscalingrunnerset_controller.go Centralize status updates, add ObservedGeneration and Ready condition management.
controllers/actions.github.com/autoscalingrunnerset_controller_test.go Add assertions for ObservedGeneration/Ready on AutoscalingRunnerSet status.
controllers/actions.github.com/autoscalinglistener_controller.go Add listener ObservedGeneration and Ready condition updates based on pod state.
config/crd/bases/actions.github.com_ephemeralrunnersets.yaml CRD schema updates for conditions and observedGeneration in EphemeralRunnerSet status.
config/crd/bases/actions.github.com_ephemeralrunners.yaml CRD schema updates for conditions and observedGeneration in EphemeralRunner status.
config/crd/bases/actions.github.com_autoscalingrunnersets.yaml CRD schema updates for conditions and observedGeneration in AutoscalingRunnerSet status.
config/crd/bases/actions.github.com_autoscalinglisteners.yaml CRD schema updates for conditions and observedGeneration in AutoscalingListener status.
charts/gha-runner-scale-set-controller/crds/actions.github.com_ephemeralrunnersets.yaml Helm-bundled CRD regeneration for EphemeralRunnerSet status fields.
charts/gha-runner-scale-set-controller/crds/actions.github.com_ephemeralrunners.yaml Helm-bundled CRD regeneration for EphemeralRunner status fields.
charts/gha-runner-scale-set-controller/crds/actions.github.com_autoscalingrunnersets.yaml Helm-bundled CRD regeneration for AutoscalingRunnerSet status fields.
charts/gha-runner-scale-set-controller/crds/actions.github.com_autoscalinglisteners.yaml Helm-bundled CRD regeneration for AutoscalingListener status fields.
charts/gha-runner-scale-set-controller-experimental/crds/actions.github.com_ephemeralrunnersets.yaml Experimental Helm-bundled CRD regeneration for EphemeralRunnerSet status fields.
charts/gha-runner-scale-set-controller-experimental/crds/actions.github.com_ephemeralrunners.yaml Experimental Helm-bundled CRD regeneration for EphemeralRunner status fields.
charts/gha-runner-scale-set-controller-experimental/crds/actions.github.com_autoscalingrunnersets.yaml Experimental Helm-bundled CRD regeneration for AutoscalingRunnerSet status fields.
charts/gha-runner-scale-set-controller-experimental/crds/actions.github.com_autoscalinglisteners.yaml Experimental Helm-bundled CRD regeneration for AutoscalingListener status fields.
apis/actions.github.com/v1alpha1/zz_generated.deepcopy.go Regenerate deep-copy logic to correctly copy new Conditions slices in status.
apis/actions.github.com/v1alpha1/ephemeralrunnerset_types.go Add ObservedGeneration and Conditions to EphemeralRunnerSetStatus.
apis/actions.github.com/v1alpha1/ephemeralrunner_types.go Add ObservedGeneration and Conditions to EphemeralRunnerStatus.
apis/actions.github.com/v1alpha1/common.go Add shared ConditionTypeReady constant.
apis/actions.github.com/v1alpha1/autoscalingrunnerset_types.go Add ObservedGeneration and Conditions to AutoscalingRunnerSetStatus.
apis/actions.github.com/v1alpha1/autoscalinglistener_types.go Add ObservedGeneration and Conditions to AutoscalingListenerStatus.
Files not reviewed (1)
  • apis/actions.github.com/v1alpha1/zz_generated.deepcopy.go: Generated file

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

Comment thread controllers/actions.github.com/autoscalinglistener_controller.go Outdated
Comment thread controllers/actions.github.com/autoscalingrunnerset_controller_test.go Outdated
@Okabe-Junya
Okabe-Junya force-pushed the Okabe-Junya/feature/status-conditions-observedgeneration branch from 5b57f1f to 9e6f4a1 Compare July 25, 2026 20:06
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.

2 participants