Skip to content

Conversation

@nathana1
Copy link
Contributor

@nathana1 nathana1 commented Mar 21, 2018

  • adds an operation to support copying a Docker image from one registry to another
  • supports copying to multiple places in the target registry
  • only one source and one target registry are supported

This checklist is used to make sure that common issues in a pull request are addressed. This will expedite the process of getting your pull request merged and avoid extra work on your part to fix issues discovered during the review process.

PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • Except for special cases involving multiple contributors, the PR is started from a fork of the main repository, not a branch.
  • If applicable, the PR references the bug/issue that it fixes.
  • Swagger files are correctly named (e.g. the api-version in the path should match the api-version in the spec).

Quality of Swagger

@AutorestCI
Copy link

AutorestCI commented Mar 21, 2018

Automation for azure-sdk-for-node

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-node#2780

@AutorestCI
Copy link

AutorestCI commented Mar 21, 2018

Automation for azure-libraries-for-java

The initial PR has been merged into your service PR:
AutorestCI/azure-libraries-for-java#106

@AutorestCI
Copy link

AutorestCI commented Mar 21, 2018

Automation for azure-sdk-for-python

The initial PR has been merged into your service PR:
Azure/azure-sdk-for-python#1935

@AutorestCI
Copy link

AutorestCI commented Mar 21, 2018

Automation for azure-sdk-for-go

A PR has been created for you based on this PR content.

Once this PR will be merged, content will be added to your service PR:
Azure/azure-sdk-for-go#1680

@olydis olydis added the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Mar 21, 2018
@olydis
Copy link
Contributor

olydis commented Mar 21, 2018

@ravbhatnagar new operation

Copy link
Contributor

@ravbhatnagar ravbhatnagar left a comment

Choose a reason for hiding this comment

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

@olydis - please feel free to merge based on response to these comments.

Copy link
Contributor

Choose a reason for hiding this comment

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

can we make this a string enum? ex - "copyMode" propetrties where values are force etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created a new mode enum.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just call this copyImage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to importImage.

@ravbhatnagar ravbhatnagar added ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Mar 22, 2018
@ravbhatnagar
Copy link
Contributor

Couple of minor comments. @olydis - Please feel free to merge based on response to the 2 comments I raised above.

@nathana1 nathana1 force-pushed the nathana/acr-copyimage-api branch from ffa69db to 4e6be6f Compare March 23, 2018 17:40
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add

"x-ms-enum": {
  "name": <please choose something meaningful>,
  "modelAsString": true
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add "type": "object".

Copy link
Member

Choose a reason for hiding this comment

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

@olydis We were instructed from the very first swagger 2016-06-27-preview version that this "type": "object" should be removed from here since it's redundant. We don't have it in all the versions since then, and looking at other swaggers such as Storage, Compute, etc. they don't have this either. Is this a new requirement? Or do we need to update other places if "type": "object" is now required?

Copy link
Contributor

@olydis olydis Mar 26, 2018

Choose a reason for hiding this comment

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

Yeeeeeah so somehow the idea that type: object is redundant was a false assumption we made for a long long time. Swagger follows JSON schema, and JSON says that something that doesn't have a type has any type (if you have stuff like properties, it is ignored unless you are looking at an object but, say, a number also matches such schema! Oops). Long story short, except for a handful of cases across all of Azure, stuff really has a type! No worries about the past Swaggers and also no worries about the future - our ancient code generation was created with the same false assumption so it behaves perfectly fine regardless of type or not. But external tools may take it more seriously, and ultimately our job is to provide valid Swaggers to our customers... and currently, if a PUT's body accepts a { "properties": { ... } } then that means customers are allowed to send a 42 over the wire rather than { ... }. We have a work item on our side to normalize the entire repo to have type: object where it belongs, but whenever I see it in a PR, I ask for it... but I don't expect you to spend more efforts on that since indeed we gave the wrong guidance for years!

Copy link
Member

Choose a reason for hiding this comment

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

We use a global filter in swashbuckle to get rid of all the "type": "object" so I guess it's actually easier for us to consistently have it in this swagger, rather than having a special case for the new API/definitions, but we probably don't want to touch old swaggers as you also mentioned.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah sure, that makes perfect sense 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Please add "type": "object".

Copy link
Contributor

Choose a reason for hiding this comment

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

Also: Is the property required? Or could you specify {} as source of ImportImageParameters?

Copy link
Contributor

@olydis olydis left a comment

Choose a reason for hiding this comment

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

technicalities

@olydis
Copy link
Contributor

olydis commented Mar 23, 2018

@nathana1 @ravbhatnagar What's the timeline for providing an example for the new operation?

@nathana1
Copy link
Contributor Author

@olydis There's an ImportImage.json file included in the examples folder. Let me know if anything else is needed for an example.

@olydis
Copy link
Contributor

olydis commented Mar 27, 2018

@nathana1 oh thanks! I blindly reported what our tooling said... which complained since you also need to hook the example into the Swagger. Please take a look at any other operation with regards to x-ms-examples and replicate the pattern for your operation - and that should be it 🙂

Copy link
Member

@djyou djyou left a comment

Choose a reason for hiding this comment

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

Just a few minor comments.

Copy link
Member

Choose a reason for hiding this comment

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

Do we have no response payload at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope, just the return code

Copy link
Member

Choose a reason for hiding this comment

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

NIT: registry -> container registry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

Can we name this importImageParameters? importParameters sounds too general.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looking at it I think it was too redundant (it was on an operation named importImage), so I've renamed it to parameters.

Copy link
Member

Choose a reason for hiding this comment

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

NIT: registry -> container registry.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

Choose a reason for hiding this comment

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

I wonder if sourceRepository, sourceTag, and sourceManifestDigest can be combined to one single parameter such as sourceImage which can be the following format:

  • hello-world -> hello-world:latest.
  • `hello-world:v21
  • hello-world@sha256:abc123

This will be consistent with docker and avoid the mentioning of digest is exclusive with tag.
/cc @sajayantony

Copy link
Contributor Author

Choose a reason for hiding this comment

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

made an update to this and updated the samples

Copy link
Member

Choose a reason for hiding this comment

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

Can we add something like default: NoForce rather than mentioning the default value in description?
NIT: remove the extra space in overwritten. When. There are extra spaces in other descriptions too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@nathana1 nathana1 force-pushed the nathana/acr-copyimage-api branch from d3b9410 to f7bb60b Compare March 27, 2018 20:46
Copy link
Contributor

@olydis olydis left a comment

Choose a reason for hiding this comment

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

Looks good from SDK perspective, will await @djyou's comments - also, am I correct in assuming that this is already live? Just for timing the merge 🙂

@nathana1 nathana1 force-pushed the nathana/acr-copyimage-api branch from f7bb60b to 57b80df Compare April 2, 2018 17:56
@nathana1
Copy link
Contributor Author

nathana1 commented Apr 2, 2018

This is live in dogfood. We are trying to go live in production in about a week or so.

Copy link
Member

@djyou djyou left a comment

Choose a reason for hiding this comment

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

LGTM. Just two minor comments.

Copy link
Member

Choose a reason for hiding this comment

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

Move the last . out of )?

Copy link
Member

Choose a reason for hiding this comment

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

Repository name has to be lower case so I would lower case the example name sourceRepository here to make it more realistic. The same applies to other cases.

Copy link
Contributor

Choose a reason for hiding this comment

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

@djyou @nathana1 oh, note that you could model that restriction using the pattern property of Swagger (or JSON schema, for that matter) that allows you to specify a regex. Maybe this is a good opportunity for adding a pattern on ImportSource.sourceImage?

Copy link
Member

Choose a reason for hiding this comment

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

parameters

- adds an operation to support copying a Docker image from one registry to another
- supports copying to multiple places in the target registry
- only one source and one target registry are supported
@nathana1 nathana1 force-pushed the nathana/acr-copyimage-api branch from 57b80df to 8c306b9 Compare April 2, 2018 20:02
@olydis
Copy link
Contributor

olydis commented Apr 2, 2018

@nathana1 Thanks for the response! Please ping me once you are live in public since that's when this will be merged 🙂

BTW, please don't force push, I now don't see which things you changed based on review feedback, so it's super hard to review! I of course trust that nothing else was changed since ARM signoff and such, but it's less obvious what to look at when I wanna do an iteration on this PR. 😉

@olydis
Copy link
Contributor

olydis commented Apr 11, 2018

@nathana1 @djyou any news? Do you have a date for going live in public?
Also, @djyou were you happy with the changes? Also note #2719 (comment)

@nathana1
Copy link
Contributor Author

We're in the process of rolling this out in prod right now (in canary so far) so it should be everywhere in about a week.

Unfortunately I think the regex for that particular data would be too complicated and the documentation is the best way to describe the value.

@djyou
Copy link
Member

djyou commented Apr 12, 2018

@olydis This PR LGTM. I agree with @nathana1 that the regex for image name would be too complicated here.

@olydis
Copy link
Contributor

olydis commented Apr 12, 2018

Alright, thanks for your feedback! I'll mark this as "OK to merge" and add a date of 4/20 to the PR title - please reach out (or edit the PR title) if you want to change that date 🙂

@olydis olydis changed the title add a copy image operation to Azure Container Registry [merge on 4/20] add a copy image operation to Azure Container Registry Apr 12, 2018
@olydis olydis added Approved-OkToMerge <valid label in PR review process>add this label when assignee approve to merge the updates Reassign labels Apr 12, 2018
@azuresdkci azuresdkci assigned jianghaolu and unassigned olydis Apr 13, 2018
@azuresdkci azuresdkci requested a review from jianghaolu April 13, 2018 18:05
@olydis
Copy link
Contributor

olydis commented Apr 13, 2018

@jianghaolu Handing this one off to you 😉 Review is complete, as you can see in the very last comments, this just has to be merged once the service is live in public (see title for estimated date).

@jianghaolu
Copy link
Contributor

It's 4/20. Any concerns before I merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved-OkToMerge <valid label in PR review process>add this label when assignee approve to merge the updates ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants