Skip to content

Conversation

@DomAyre
Copy link
Contributor

@DomAyre DomAyre commented Dec 7, 2025

Why

Allows the user to generate the fragment reference rego for building policies and insert that in the final policy.

How

  • Add a command to generate the fragment reference
  • Add the --with-fragments flag to acipolicygen
  • Add testing

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

Related command

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

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Dec 7, 2025

⚠️Azure CLI Extensions Breaking Change Test
⚠️confcom
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd confcom acifragmentgen cmd confcom acifragmentgen added parameter out_signed_fragment
⚠️ 1006 - ParaAdd confcom acipolicygen cmd confcom acipolicygen added parameter fragment_definitions
⚠️ 1011 - SubgroupAdd confcom fragment sub group confcom fragment added

@yonzhan
Copy link
Collaborator

yonzhan commented Dec 7, 2025

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

@azure-client-tools-bot-prd
Copy link

Hi @DomAyre,
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.

@github-actions
Copy link

github-actions bot commented Dec 7, 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>

@yonzhan yonzhan requested a review from jsntcy December 7, 2025 23:15
@DomAyre DomAyre force-pushed the fragment-reference-from-image branch from 3612a9b to 19e9e16 Compare December 8, 2025 10:17
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

@DomAyre DomAyre force-pushed the fragment-reference-from-image branch 4 times, most recently from 819a575 to 403c16f Compare December 8, 2025 17:51
Addresses
- Azure#9222

- [x] Update the code to restore the "attach to first image in input" behaviour
- [x] Add two new commands: `fragment push` and `fragment attach` to allow the user to explicitly do one or the other (or both!)
- [x] Add new tests which run a local docker registry, and test that the fragments are generated, signed, pushed and attached as expected (as well as the default behaviour)

---

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

<!--- Please provide the related command with az {command} if you can, so that we can quickly route to the related person to review. --->

- [x] Have you run `azdev style <YOUR_EXT>` locally? (`pip install azdev` required)
- [x] Have you run `python scripts/ci/test_index.py -q` locally? (`pip install wheel==0.30.0` required)
- [x] My extension version conforms to the [Extension version schema](https://github.com/Azure/azure-cli/blob/release/doc/extensions/versioning_guidelines.md)
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.

3 participants