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

[ContainerRegistry] <DO NOT MERGE> Add 'acrcssc' extension for public preview #8530

Draft
wants to merge 189 commits into
base: main
Choose a base branch
from

Conversation

cegraybl
Copy link

@cegraybl cegraybl commented Mar 6, 2025


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

Related command

CSSC (Container Secure Supply Chain) is an extension that configures your registry for continuous scanning and patching of container images. With the Continuous Patching feature in Azure Container Registry, you can automatically scan and patch designated artifacts for OS-level vulnerabilities. The workflow allows you to schedule recurring ACR tasks that scan your list of configured images for vulnerabilities (CVEs) using Trivy and then patch them using Copa.

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? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

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.

Pending items before the publishing PR

pwalecha and others added 30 commits June 4, 2024 21:30
# Fix LINT and Style issues
# Add more unit test
# Add defer_run_immediately support in the CLI command
# Change the command from supply-chain task to supply-chain workflow - Need to read document
# Change the show command to display cadence as "n"d instead of cron expression, order the list by name
# Check if Resource_group is coming as mandatory field Or it can be set in the config and can be fetched directly from there
remove redundant files
Fix formatting
Fix bugs
breaking test cases
upload of dry-run quick task should be done from temp folder
improve logging feedback
Increase time for MI setup
Make cadence and config file updates optional
help file
default values in documentation
test invalid json values
regex for days validation
change error messages
refactor code
fix test cases related to refactoring
Copy link

Validation for Breaking Change Starting...

Thanks for your contribution!

Copy link

Hi @cegraybl,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Mar 6, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link

github-actions bot commented Mar 6, 2025

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Copy link

github-actions bot commented Mar 6, 2025

Hi @cegraybl

⚠️ Release Requirements

Module: acrcssc

  • ⚠️ Please update VERSION to be 1.0.0b1 in src/acrcssc/setup.py

Notes

Ruchi Maheshwari and others added 7 commits March 7, 2025 12:03
…-convention schema validation to strictly allow for only incremental or floating
fix(cssc): 31694722 fixed config validation to only allow tag-convention = floating or incremental
fix(cssc): 31694219 inform user when images matching their configuration are 0
…s (2/n) (#25)

- Add ScenarioTest for the extension and the recording
- Fix remaining style and lint issues
- Fix README file to reflect basic usage
- Fix HISTORY and setup.py to have the final release version for private
preview
@github-actions github-actions bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Mar 10, 2025
Ruchii-27 and others added 2 commits March 10, 2025 16:08
…ests (#31)

Currently, no validation error is thrown when repositories are empty or
repeated in configuration file.

Bug -
https://msazure.visualstudio.com/AzureContainerRegistry/_workitems/edit/31695069/?view=edit

This PR fixes the issue by enhancing schema validation for repositories
and updating the tests to test for this scenario.


![image](https://github.com/user-attachments/assets/1d7d1f0e-feff-49b1-a955-2dbb85c44ab2)

---------

Co-authored-by: Ruchi Maheshwari <rumahe@microsoft.com>
…e calling list command + enhance log message (#32)

This PR adds a check to ensure that the cssc tasks exist before calling
the list command. It also displays that the list command is executed for
the last n days. Updated tests as well.

With this, below 2 bugs are addressed:
1.
https://msazure.visualstudio.com/AzureContainerRegistry/_workitems/edit/31694510/?view=edit
Before Fix: 

![image](https://github.com/user-attachments/assets/61ced20f-d8c4-42d6-bc8d-67e3ae299ed1)
After Fix:

![image](https://github.com/user-attachments/assets/807745a3-71f5-471c-89b5-62161fbd3fd1)

2.
https://msazure.visualstudio.com/AzureContainerRegistry/_workitems/edit/31694600/?view=edit
After Fix: added a line to indicate list executed for last n days:

![image](https://github.com/user-attachments/assets/fe832467-d337-4f18-a2c7-f713452e5c3a)

---------

Co-authored-by: Ruchi Maheshwari <rumahe@microsoft.com>
logger.warn("Wheel is not available, disabling bdist_wheel hook")

VERSION = '1.1.1'

Copy link
Member

Choose a reason for hiding this comment

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

Please adjust the initial version for acrcssc to be 1.0.0b1, instead of 1.1.1

For more info about the extension versioning schema, please refer to doc here:https://github.com/Azure/azure-cli/blob/dev/doc/extensions/versioning_guidelines.md#initialization

…iately options are mutually exclusive (#33)

Added validation to ensure that the `--dryrun` and `--run-immediately`
options cannot be used together both during create and update.
Also added unit tests for this scenario to ensure the validation works
as expected.

Bug -
https://msazure.visualstudio.com/AzureContainerRegistry/_workitems/edit/31694592/?view=edit

After fix:

![image](https://github.com/user-attachments/assets/b5a2f868-8904-42ea-aa9e-acb561943d2f)

Co-authored-by: Ruchi Maheshwari <rumahe@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants