Skip to content

[utils][SR-2695] Tag checkout support for all repositories. #4892

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

Merged
merged 1 commit into from
Oct 12, 2016

Conversation

aleksgapp
Copy link
Contributor

Add support for a specific tag checkout for all repositories.

Resolves SR-2695.

Copy link
Contributor

@modocache modocache left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks a lot for doing this.

I haven't heard from any other Swift committers since creating the starter task. I wonder if they have any thoughts on adding this flag? /cc @gottesmm

"--tag",
help="""Check out each repository to the specified tag.""",
metavar='TAG-NAME',
dest='tag')
Copy link
Contributor

Choose a reason for hiding this comment

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

nit-pick: This dest parameter is unnecessary; since the argument name is --tag the destination will automagically be named tag.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, right, it's removed now.

'origin', repo_branch], echo=False)
if not tag_exists:
print("--- Skipping '" + repo_name + "' ---")
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice touch!! I love it.

@gottesmm
Copy link
Contributor

@erg What do you think of this?

@gottesmm
Copy link
Contributor

Since @erg didn't respond, I'll review this real quick. This function is getting quite big. Can you split it into two functions? One for the tag and for the non-tag case?

@aleksgapp
Copy link
Contributor Author

Done!

@modocache
Copy link
Contributor

@swift-ci please Python lint

@modocache
Copy link
Contributor

@swift-ci Please Python lint

@modocache
Copy link
Contributor

@swift-ci please smoke test

Copy link
Contributor

@gottesmm gottesmm left a comment

Choose a reason for hiding this comment

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

This is not what I was suggesting. I was suggesting that you keep 1 function but if you had the tag or scheme you delegated to different functions. It is just the middle section that should be refactored. Everything else is the same.

@aleksgapp
Copy link
Contributor Author

Oops, should be as you've suggested now.

@gottesmm
Copy link
Contributor

@aleksgapp No worries. Thanks for fixing this.

@aleksgapp, @modocache. An additional question: I have not thought about this (and I am fine doing this in a follow on commit), but given that tag/scheme are exclusive options I wonder if there is a way to express them on the command line in an exclusive manner. Just doing something like --type=scheme --type=tag won't work since they require options. Maybe the thing to do is just make sure that only one is set and error otherwise? [Trying to steal a minute of your brain power = )]

@gottesmm
Copy link
Contributor

I guess we could use subparsers? Maybe have something like:

./update-checkout scheme
./update-checkout tag
./update-checkout <[need a name for when we just update what is locally there]>

Not sure.

@aleksgapp
Copy link
Contributor Author

@gottesmm I had a quick look at this direction, but didn't include this to my initial implementation.

There is an parser.add_mutually_exclusive_group() option that makes this possible:

update-checkout: error: argument --scheme/--branch: not allowed with argument --tag

One more thing that isn't fitting well here is optional arguments, e.g, --github-comment relates only to scheme/branch argument and would be just skipped if given with tag argument, --skip-history is taken in account only if clone/clone-with-ssh is given.

I'm not sure if we need take care of those here? May be just adding an exclusiveness for tag/scheme options would be enough in scope of this pull request?

@gottesmm
Copy link
Contributor

@aleksgapp Yes, any such changes are 100% out of scope for this PR. Lets get this in.

@gottesmm
Copy link
Contributor

@swift-ci Please smoke test and merge

@@ -255,11 +287,15 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""")
help="""Check out related pull requests referenced in the given
free-form GitHub-style comment.""",
metavar='GITHUB-COMMENT',
dest='github_comment'),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gottesmm Resolved small conflict, I believe this comma was a typo, right?

@shahmishal
Copy link
Member

@swift-ci Please smoke test and merge

1 similar comment
@shahmishal
Copy link
Member

@swift-ci Please smoke test and merge

@swift-ci swift-ci merged commit 944e0ba into swiftlang:master Oct 12, 2016
@aleksgapp aleksgapp deleted the sr-2695-tag-checkout branch October 12, 2016 09:24
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.

5 participants