-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat(acrcssc): Use next occurrence outputted by ACR Tasks #4
base: cegraybl/cssc_phase_1.5
Are you sure you want to change the base?
feat(acrcssc): Use next occurrence outputted by ACR Tasks #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- src/acrcssc/azext_acrcssc/templates/arm/CSSC-AutoImagePatching-encodedtasks.json: Language not supported
Comments suppressed due to low confidence (1)
src/acrcssc/azext_acrcssc/helper/_taskoperations.py:75
- The variable 'next_date' is used before it is assigned a value in some cases. This can lead to a NoneType error. Ensure 'next_date' is properly assigned before it is used.
if next_date is None:
task = get_task(cmd, registry, CONTINUOUSPATCH_TASK_SCANREGISTRY_NAME) | ||
trigger = task.trigger | ||
if trigger and trigger.timer_triggers: | ||
schedule_cron_expression = trigger.timer_triggers[0].schedule | ||
# Note (transteven): I think additional_properties is needed here because nextOccurrence isn't officially in ARM Manifest yet | ||
next_date = trigger.timer_triggers[0].additional_properties["nextOccurrence"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accessing 'additional_properties["nextOccurrence"]' without checking if the key exists can raise a KeyError. Add a check to ensure the key exists before accessing it.
next_date = trigger.timer_triggers[0].additional_properties["nextOccurrence"] | |
if 'nextOccurrence' in trigger.timer_triggers[0].additional_properties: next_date = trigger.timer_triggers[0].additional_properties['nextOccurrence'] |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
valid since the Task API needs to be released and referenced on the client
LGTM but we need to wait for the Task API release with the new property, and reference the new version in |
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
General Guidelines
azdev style <YOUR_EXT>
locally? (pip install azdev
required)python scripts/ci/test_index.py -q
locally? (pip install wheel==0.30.0
required)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.You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify
src/index.json
.