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

New parameter --force on Publish command #9745

Merged
merged 8 commits into from
Apr 8, 2023
Merged

New parameter --force on Publish command #9745

merged 8 commits into from
Apr 8, 2023

Conversation

PalmEmanuel
Copy link
Contributor

@PalmEmanuel PalmEmanuel commented Feb 5, 2023

Contributing a feature

  • I have opened a new issue for the proposal, or commented on an existing one, and ensured that the Bicep maintainers are good with the design of the feature being implemented
  • I have included "Fixes #{issue_number}" in the PR description, so GitHub can link to the issue and close it when the PR is merged
  • I have appropriate test coverage of my new feature

Fixes #4757

Microsoft Reviewers: Open in CodeFlow

@PalmEmanuel
Copy link
Contributor Author

As far as I can tell, it's working as expected with bicep publish now giving an error if a module with the same tag exists in the oci registry, unless using --force. I implemented the module-existing-check using the ContainerRegistryClient (not Blob) which made it a little bit intimidating to get started on testing stuff since it requires a new mocking structure for the client unless I'm mistaken.

Can you have a look and see if the design looks good otherwise? And in that case, a pointer or two would be great on where I should get started on the testing. Thanks!

@PalmEmanuel
Copy link
Contributor Author

@majastrz maybe you could have a look when you have time?

Copy link
Member

@majastrz majastrz left a comment

Choose a reason for hiding this comment

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

I added some comments. Please take a look.

@PalmEmanuel PalmEmanuel marked this pull request as ready for review March 12, 2023 16:54
@PalmEmanuel
Copy link
Contributor Author

Since the tests ensured functionality by publishing twice and checking that only one module was published, I decided to modify them to also account for the --force option. If we'd rather have that as separate tests I can break them out.

I've also adjusted to use the blob client to pull and check manifest instead, and removed the traces of the registry client. Take a look when you have time @majastrz 🙂

@majastrz
Copy link
Member

majastrz commented Apr 7, 2023

@PalmEmanuel sorry for the delay with the review. I added a couple more comments. Can you take a look when you get a chance?

…r exception kind, CheckModuleExists() now catches it and checks kind
@PalmEmanuel
Copy link
Contributor Author

Added some changes according to your feedback. See my comment in resolved conversation when you have time @majastrz

Copy link
Member

@majastrz majastrz left a comment

Choose a reason for hiding this comment

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

:shipit:

@majastrz
Copy link
Member

majastrz commented Apr 8, 2023

LGTM!

@majastrz majastrz merged commit bb7865f into Azure:main Apr 8, 2023
@PalmEmanuel PalmEmanuel deleted the publish-safety branch April 8, 2023 07:43
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.

Add confirmation to bicep publish
2 participants