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

[feat]: [CDS-73030]: Support for text based branch filtration #260

Merged
merged 2 commits into from
Jul 7, 2023

Conversation

adivishy1
Copy link
Contributor

@adivishy1 adivishy1 commented Jul 5, 2023

Have added code for supporting text based branch filtration for the following git providers:

  1. Bitbucket cloud
  2. Bitbucket server
  3. Azure
  4. Gitlab

Note: Github does not provide support for text based search.
Have tested out string based search all the above providers. For the other drivers that implement the GitService interface, have called the listBranches method which means that its not filtering based on any branch being passed.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@adivishy1 adivishy1 closed this Jul 5, 2023
@adivishy1 adivishy1 reopened this Jul 5, 2023
@adivishy1 adivishy1 closed this Jul 5, 2023
@adivishy1 adivishy1 reopened this Jul 5, 2023
@adivishy1 adivishy1 closed this Jul 5, 2023
@adivishy1 adivishy1 reopened this Jul 5, 2023
@adivishy1 adivishy1 closed this Jul 5, 2023
@adivishy1 adivishy1 reopened this Jul 5, 2023
Copy link
Contributor

@tphoney tphoney left a comment

Choose a reason for hiding this comment

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

i have a few questions.
what do you expect the search term to look like ? do we need to encode that search term differently for each scm provider ?
why dont you just use the url operation that is part of the listBranches ?
why is it named v2 , this has no meaning

@adivishy1
Copy link
Contributor Author

  1. what do you expect the search term to look like ? : it can be anything that user types, say if we have branches such as test, main, main-patch, main-patch1, main-patch-12 cds-12312, etc, and the user wants only branches where "main-patch" in present, then in such case the user can pass search term as "main-patch" or "patch" or "main-" the the git providers that support such functionality
  2. do we need to encode that search term differently for each scm provider ? yes, each of them take the filter params in a different query param name, eg azure takes it as "filterContains=" ,bitbucket saas takes it as "q=name~" etc,
  3. why dont you just use the url operation that is part of the listBranches?: there are cases where the url changes slightly, like in the case of azure, in existing impl of ListBranches, there is a query param includeMyBranches=true but we cannot have includeMyBranches and "filterContains=" together in the same url, hence new listBranchesV2 with new query params in the url
  4. why is it named v2 , this has no meaning: Purely for backward compatibility purpose, for implementing this functionality, we would need a new param, searchTerm to the existing listBranches method, if we directly add it as new param, that would break the previous usages of the go-scm lib, hence listBranchesV2 and once everyone are on board with the ListBranchesV2, then gradually we can deprecate the listBranches method

@rajatharanganath rajatharanganath merged commit 3947016 into drone:master Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants