Skip to content

feat(nomos): distinguish synced and current polling - #2242

Open
tomatotomata wants to merge 6 commits into
GoogleContainerTools:mainfrom
tomatotomata:codex/poll-until-status-2006
Open

tomatotomata wants to merge 6 commits into
GoogleContainerTools:mainfrom
tomatotomata:codex/poll-until-status-2006

Conversation

@tomatotomata

@tomatotomata tomatotomata commented Jul 28, 2026

Copy link
Copy Markdown

Fixes #2006

Summary

Adds explicit completion targets for nomos status:

  • --poll-until=synced waits for the selected RootSync and RepoSync objects to report SYNCED without errors.
  • --poll-until=current also waits for every reported managed resource to become Current. complete remains an alias for current.

The --name filter scopes the completion check. An empty reachable cluster does not block other contexts, while a requested name must be found. In current mode, a Failed resource returns an error instead of polling forever; Unknown remains incomplete. Use synced when resource readiness is not required.

Validation

  • go test ./cmd/nomos/status -run 'TestPollUntilReached|TestValidatePollUntil|TestClusterStates' -count=1 passed.
  • git diff --check passed.
  • The full status package run reaches an existing Windows timezone-sensitive TestPrintStatus expectation: the fixture expects UTC while the output uses the local Riyadh timezone. The focused polling and cluster-state tests pass, and the PR presubmits will validate the pushed head.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign tiffanny29631 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow

Copy link
Copy Markdown

Hi @ahmadalguydi. Thanks for your PR.

I'm waiting for a GoogleContainerTools member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@google-cla

google-cla Bot commented Jul 28, 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.

Comment thread cmd/nomos/status/cluster_state.go
Treat poll-until complete as full resource readiness, not only repository apply completion. Keep polling when a reported managed resource is not Current and document the behavior.\n\nAddresses maintainer review on GoogleContainerTools#2006.
@tomatotomata

Copy link
Copy Markdown
Author

Followed up on the readiness question in commit 64ff1554 (already pushed): --poll-until=complete now waits for both repository SYNCED status and every reported managed resource to reach Current. The design doc explicitly documents that this is full resource readiness and that it is independent of the --resources display flag. A regression test covers a non-current resource.

The Google CLA bot still requires the account holder to complete the CLA; that external signature step cannot be performed by the agent.

@tiffanny29631

Copy link
Copy Markdown
Contributor

/ok-to-test

@tomatotomata

Copy link
Copy Markdown
Author

The presubmit failure was a syntax error in the new table literal at poll_until_test.go:64. I fixed the nested literal structure in 8603456a and pushed it. The focused status tests pass locally; the full package run on this Windows host also exposes an existing timezone-sensitive TestPrintStatus expectation, so I have not treated that local result as a full pass.

Could you please rerun the presubmit on the new head?

/retest

@tomatotomata

tomatotomata commented Sep 11, 2026

Copy link
Copy Markdown
Author

I traced the latest results to two separate causes. The required presubmit still wanted Go's simplified composite-literal form in poll_until_test.go, so I applied gofmt -s and pushed 20db06ab. The e2e group 3 failure happened while the runner was building its Docker image and could not fetch the Ubuntu manpages package from archive.ubuntu.com, so that result looks environment-related rather than caused by this change. The focused status tests and git diff --check pass on the new head, and the push has already started a fresh full run. Let me know what you think.

Comment thread cmd/nomos/status/cluster_state.go Outdated
Comment thread cmd/nomos/status/cluster_state.go Outdated
Comment thread cmd/nomos/status/cluster_state.go Outdated
Comment thread cmd/nomos/status/poll_until_test.go Outdated
Comment thread cmd/nomos/status/status.go Outdated

@tiffanny29631 tiffanny29631 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.

Please update the PR description and title to reflect latest changes

@tomatotomata tomatotomata changed the title feat(nomos): poll status until repositories complete feat(nomos): poll until sync or resource readiness Sep 16, 2026
@tomatotomata

Copy link
Copy Markdown
Author

I changed the polling target to separate successful Config Sync application from managed-resource readiness. --poll-until=synced stops once the selected repositories report SYNCED; --poll-until=current also waits for every reported resource to be Current, with complete kept as an alias. A Failed resource now returns an error instead of polling forever, while Unknown remains incomplete in current mode.

The completion check now respects --name, and a reachable cluster with no sync objects no longer holds up other contexts. I added coverage for name selection, empty clusters, Current/Unknown/Failed, and the separate synced target. I also split state collection from rendering so printStatus only formats the output.

The focused tests and git diff --check pass on 13cf2d1f. The full status-package run still hits the UTC-versus-local-time expectation in TestPrintStatus on this Windows host; the new presubmits are running on this head. I updated the title and description to reflect the expanded behavior. Let me know if you think the synced/current split fits the issue.

@tomatotomata tomatotomata changed the title feat(nomos): poll until sync or resource readiness feat(nomos): distinguish synced and current polling Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add –poll-until to ‘nomos status’ command

2 participants