-
Notifications
You must be signed in to change notification settings - Fork 147
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
Create RepositoryRefsOptions and ListRefs method with helper funcs #155
Create RepositoryRefsOptions and ListRefs method with helper funcs #155
Conversation
This commit creates a ListRefs method of the Repository type. Specifically, it creates a RepositoryRefs struct type that is returned from the decoodeRepositoryRefs function that is a helper function for decoding the reponse from the refs GET API Bitbucket endpoint.
Exactly. First, we should add the new apis in it. after that, we update old apis to show deprecated notifications for an end user. Finally, delete the old apis. |
And, Looks good for me, may be. |
I'll carefully read it later. |
… ddansby/153-create-refs-options-and-methods
This commit creates a test case for ListRefs based on setting up the test repo with a new branch and then listing the refs and making sure properly created the test repo. So, this test case technically also tests a portion of the functionality of the CreateBranch function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you.
Great thank you @ktrysmt. I'll look out for the merge! 💯 . I'm going to start working on the delete branch and tag methods which I think will be useful for setting up testing that tests methods that work on branches/tags. |
This commit refactors the existing RepositoryBranchTarget and RepositoryTagTarget types to a single RepositoryRefTarget since tags and branches are both refs and the two Target variables represented the same type anyways. This will also help us move to removing branch and tag specific options types into a single refs options type. See ktrysmt#155 and ktrysmt#153 (comment)
This commit refactors the existing RepositoryBranchTarget and RepositoryTagTarget types to a single RepositoryRefTarget since tags and branches are both refs and the two Target variables represented the same type anyways. This will also help us move to removing branch and tag specific options types into a single refs options type. See ktrysmt#155 and ktrysmt#153 (comment)
TL;DR: this PR creates a RepositoryRefsOptions type and starts the groundwork to eventually remove RepositoryBranchOptions and RepositoryTagOptions and those methods that relies on these types.
This PR creates a RepositoryRefsOptions and a ListRefs method on the Repository type. This new refs type will allow users to specific their refs options once and be able to operate on all kinds of refs (i.e. tags and branches) without specifying 2 separate options. Right now, users have to specify a RepositoryBranchOptions and RepositoryTagOptions in order to call ListBranches and ListTags.
This current iteration of the code doesn't adhere to the fact that git refers to all branches and tags as refs and this is reflected in the Bitbucket API since both tags and branches endpoints are build off of the refs endpoint.
I want to add a test for this new ListRefs function, but in the meantime I wanted to create this PR s that we could discuss future plans. Currently, I think it is best to keep Refs options alongside the branches and tags options since if we remove those 2 option types then it imparts a breaking change on users. So we should slowly move towards removing those option types and their methods instead removing support all at once and making a bunch of breaking changes.
Once we have built out the same functionality for branches and tags build upon the refs options type then we can move to completely remove the branches and tags options types and release for a breaking change.