Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change autoupdate proto messages #50234

Merged
merged 2 commits into from
Dec 14, 2024
Merged

Conversation

hugoShaka
Copy link
Contributor

@hugoShaka hugoShaka commented Dec 13, 2024

This commits does 3 changes:

  • reflect the maintenance duration on the rollout in a new spec field
  • add the rollout start time field in its status
  • change wait_days into wait_hours

Part of: #47126

Goal (internal): https://github.com/gravitational/cloud/issues/10289

Context:

  • I need to add the maintenance duration in the rollout to support customizing maintenance duration (current implem just does 1h windows) and forgot this in the RFD
  • We must track the rollout start time to add logic that avoids awkward situations when a group start immediately when we change the version.
  • Wait_days behaviour is ambiguous in the RFD (do we count 24 hours since the group start, or check midnight UTC?, midnight local tz?). Switchig to hours solves the issue

@hugoShaka hugoShaka added the no-changelog Indicates that a PR does not require a changelog entry label Dec 13, 2024
// name of the group
string name = 1;
// days when the update can run. Supported values are "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" and "*"
repeated string days = 2;
// start_hour to initiate update
int32 start_hour = 3;
// wait_days after last group succeeds before this group can run. This can only be used when the strategy is "halt-on-failure".
int64 wait_days = 4;
// wait_hours after last group succeeds before this group can run. This can only be used when the strategy is "halt-on-failure".
Copy link
Contributor

Choose a reason for hiding this comment

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

Are zero or negative hours accepted? Is that worth mentioning?

Have you considered google.protobuf.Duration wait_duration?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are zero or negative hours accepted? Is that worth mentioning?

No, I'll reject them during validation. Yes I'll add it.

Have you considered google.protobuf.Duration wait_duration?

Yes but we do have a max resolution of an hour with start_hour so it makes more sense to keep the same unit.

api/proto/teleport/autoupdate/v1/autoupdate.proto Outdated Show resolved Hide resolved
api/proto/teleport/autoupdate/v1/autoupdate.proto Outdated Show resolved Hide resolved
api/proto/teleport/autoupdate/v1/autoupdate.proto Outdated Show resolved Hide resolved
@@ -71,14 +71,17 @@ message AgentAutoUpdateSchedules {

// AgentAutoUpdateGroup specifies the update schedule for a group of agents.
message AgentAutoUpdateGroup {
reserved 4;
reserved "wait_days";
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for the clarity of changing from days to an unambiguous time unit. Nicely done.

@hugoShaka hugoShaka enabled auto-merge December 13, 2024 20:47
@hugoShaka hugoShaka added this pull request to the merge queue Dec 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Dec 13, 2024
@hugoShaka hugoShaka force-pushed the hugo/autoupdate-proto-changes branch from 93c63d8 to 1306783 Compare December 13, 2024 21:37
@hugoShaka hugoShaka enabled auto-merge December 13, 2024 21:38
This commits does 3 changes:
- reflect the maintenance duration on the rollout in a new spec field
- add a rollout start time field in its status
- change wait_days into wait_hours
@hugoShaka hugoShaka force-pushed the hugo/autoupdate-proto-changes branch from 1306783 to 3a3dd61 Compare December 13, 2024 21:47
@hugoShaka hugoShaka disabled auto-merge December 13, 2024 22:00
@hugoShaka hugoShaka enabled auto-merge December 14, 2024 22:34
@hugoShaka hugoShaka added this pull request to the merge queue Dec 14, 2024
Merged via the queue into master with commit 793bedd Dec 14, 2024
44 checks passed
@hugoShaka hugoShaka deleted the hugo/autoupdate-proto-changes branch December 14, 2024 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a PR does not require a changelog entry size/sm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants