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

Update maintenanceconfiguration commands #5739

Merged
merged 12 commits into from
Jan 16, 2023
Merged

Update maintenanceconfiguration commands #5739

merged 12 commits into from
Jan 16, 2023

Conversation

wenxuan0923
Copy link
Contributor

@wenxuan0923 wenxuan0923 commented Jan 9, 2023


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az aks maintenanceconfiguration add
az aks maintenanceconfiguration update

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally?

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
The precondition is to put your code inside this repository and upgrade the version in the pull request but do not modify src/index.json.

@yonzhan
Copy link
Collaborator

yonzhan commented Jan 9, 2023

AKS

src/aks-preview/azext_aks_preview/_help.py Outdated Show resolved Hide resolved
src/aks-preview/azext_aks_preview/_help.py Outdated Show resolved Hide resolved
src/aks-preview/azext_aks_preview/_params.py Outdated Show resolved Hide resolved
src/aks-preview/azext_aks_preview/_params.py Outdated Show resolved Hide resolved
@wenxuan0923
Copy link
Contributor Author

Hi @FumingZhang and @zhoxing-ms, I have addressed all the comments, could you help take another look? Many thanks!!

Copy link
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

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

LGTM, but something related to monitoring addon broken due a recent update on azure-cli/acs. Please hold the PR until that's fixed.

Comment on lines 616 to 617
c.argument('duration_hours', options_list=['--duration'], type=int,
help='The length of maintenance window. The value ranges from 4 to 24 hours.', required=False)
Copy link
Member

Choose a reason for hiding this comment

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

It seems that this is the only argument which has some difference between parameter and the option. Then you could omit the options_list for all other arguments.

Also you could omit required=False.

Copy link
Member

Choose a reason for hiding this comment

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

The fix (#5744) is merged. Please rebase from main then I would trigger (or you could rerun the previous one) a live test run for your newly added case. Previous one skipped the tests in aks-preview due to the breaking change in azure-cli/acs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @FumingZhang!

I have rebased to the main branch and re-runed the live test. I also removed all the options_list for all arguments except duration_hours. When I tried to remove required=False, CLI Linter gave me failure saying I'm missing required arguments in help file, so I left them there.

Copy link
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

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

Live test passed.

@wenxuan0923
Copy link
Contributor Author

Hi @zhoxing-ms, could you help merge this PR? Many thanks!!

@@ -12,6 +12,10 @@ To release a new version, please select a new version number (usually plus 1 to
Pending
+++++++

0.5.123
+++++++
* Update command group `az aks maintenanceconfiguration` to enable the creation of *aksManagedAutoUpgradeSchedule* and *aksManagedNodeOSUpgradeSchedule*.
Copy link
Contributor

Choose a reason for hiding this comment

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

aksManagedAutoUpgradeSchedule and aksManagedNodeOSUpgradeSchedule

Could we describe these two features in detail in the history notes, otherwise their meaning is easily confusing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your feedback, I have updated the details!

Comment on lines 1089 to 1090
short-summary: Specifies the number of days between each set of occurrences for daily schedule type.
- name: --interval-weeks
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
short-summary: Specifies the number of days between each set of occurrences for daily schedule type.
- name: --interval-weeks
short-summary: Specify the number of days between each set of occurrences for daily schedule type.
- name: --interval-weeks

Please use the first-person voice in the help message, and other places are similar. Please modify these voices uniformly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

Comment on lines 599 to 600
c.argument('start_hour', type=int, required=False, options_list=[
'--start-hour'], help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am')
Copy link
Contributor

@zhoxing-ms zhoxing-ms Jan 12, 2023

Choose a reason for hiding this comment

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

Suggested change
c.argument('start_hour', type=int, required=False, options_list=[
'--start-hour'], help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am')
c.argument('start_hour', type=int, help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am')

Because required=False and options_list=['--start-hour'] is the default setting, so there is no need to explicitly repeat the definition

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All required=False and unwanted options_list have been removed

Comment on lines 601 to 617
c.argument('schedule_type', arg_type=get_enum_type(schedule_types),
help='Schedule type for non-default maintenance configuration.', required=False)
c.argument('interval_days', type=int, help='The number of days between each set of occurrences for Daily schedule.', required=False)
c.argument('interval_weeks', type=int, help='The number of weeks between each set of occurrences for Weekly schedule.', required=False)
c.argument('interval_months', type=int, help='The number of months between each set of occurrences for AbsoluteMonthly or RelativeMonthly schedule.', required=False)
c.argument('day_of_week', help='Specifies on which day of the week the maintenance occurs for Weekly or RelativeMonthly schedule.', required=False)
c.argument('day_of_month', help='Specifies on which date of the month the maintenance occurs for AbsoluteMonthly schedule.', required=False)
c.argument('week_index', arg_type=get_enum_type(week_indexes), required=False,
help='Specifies on which instance of the weekday specified in --day-of-week the maintenance occurs for RelativeMonthly schedule.')
c.argument('duration_hours', options_list=['--duration'], type=int, required=False,
help='The length of maintenance window. The value ranges from 4 to 24 hours.')
c.argument('utc_offset', validator=validate_utc_offset, required=False,
help='The UTC offset in format +/-HH:mm. e.g. -08:00 or +05:30.')
c.argument('start_date', validator=validate_start_date, required=False,
help='The date the maintenance window activates. e.g. 2023-01-01.')
c.argument('start_time', validator=validate_start_time, required=False,
help='The start time of the maintenance window. e.g. 09:30.')
Copy link
Contributor

Choose a reason for hiding this comment

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

required=False

Same as above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update again: required=False are removed!

@wenxuan0923
Copy link
Contributor Author

Hi @zhoxing-ms, I have addresses you comments. Could you help take another look? Thanks in advance!!

Comment on lines 603 to 606
c.argument('day_of_week', help='Specifies on which day of the week the maintenance occurs for Weekly or RelativeMonthly schedule.')
c.argument('day_of_month', help='Specifies on which date of the month the maintenance occurs for AbsoluteMonthly schedule.')
c.argument('week_index', arg_type=get_enum_type(week_indexes),
help='Specifies on which instance of the weekday specified in --day-of-week the maintenance occurs for RelativeMonthly schedule.')
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
c.argument('day_of_week', help='Specifies on which day of the week the maintenance occurs for Weekly or RelativeMonthly schedule.')
c.argument('day_of_month', help='Specifies on which date of the month the maintenance occurs for AbsoluteMonthly schedule.')
c.argument('week_index', arg_type=get_enum_type(week_indexes),
help='Specifies on which instance of the weekday specified in --day-of-week the maintenance occurs for RelativeMonthly schedule.')
c.argument('day_of_week', help='Specify on which day of the week the maintenance occurs for Weekly or RelativeMonthly schedule.')
c.argument('day_of_month', help='Specify on which date of the month the maintenance occurs for AbsoluteMonthly schedule.')
c.argument('week_index', arg_type=get_enum_type(week_indexes),
help='Specify on which instance of the weekday specified in --day-of-week the maintenance occurs for RelativeMonthly schedule.')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah sorry I missed these. They have been fixed!

Comment on lines 596 to 597
c.argument('weekday', help='weekday on which maintenance can happen. e.g. Monday')
c.argument('start_hour', type=int, help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am')
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
c.argument('weekday', help='weekday on which maintenance can happen. e.g. Monday')
c.argument('start_hour', type=int, help='maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am')
c.argument('weekday', help='Weekday on which maintenance can happen. e.g. Monday')
c.argument('start_hour', type=int, help='Maintenance start hour of 1 hour window on the weekday. e.g. 1 means 1:00am - 2:00am')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed~

Copy link
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

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

Please use mocked time instead of real time.

'auto_upgrade_config_name': 'aksManagedAutoUpgradeSchedule',
'node_os_upgrade_config_name': 'aksManagedNodeOSUpgradeSchedule',
'ssh_key_value': self.generate_ssh_keys(),
'future_date': (datetime.datetime.now() + datetime.timedelta(days=10)).strftime("%Y-%m-%d")
Copy link
Member

Choose a reason for hiding this comment

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

Just wondered why the recording test failed based on previous commit.

It's not a good idea to use real time instead of mocked time in e2e test, which would fail the recording test later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have modified the test to use a fixed future date. Thanks for the explanation!

@zhoxing-ms
Copy link
Contributor

@wenxuan0923 Could you please resolve these conflicts?

Copy link
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

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

Queue another live test to do the final verification. Looks good!

@zhoxing-ms zhoxing-ms merged commit b95c721 into Azure:main Jan 16, 2023
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.

4 participants