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-93606]: Added Support for search term in For List Repo Operations. #301

Merged
merged 13 commits into from
Mar 25, 2024

Conversation

senjucanon2
Copy link
Contributor

@senjucanon2 senjucanon2 commented Mar 19, 2024

Issue:

  • Github support search term in For List Repo Operations but our flow was failing for the same. Issue was pinpointes at the go-scm library level.

Changes:

  • Added Blank Space in Url Encoded Format to build the correct Url path.

Testing:

  • Changes were tested for various search terms on my Github Account with user name "senjucanon2":
    • Search term "test" -> fetched 3 results: "test-repo", "test-repo2", "terraform-test".
    • Search term "test-repo" -> fetched 2 results: "test-repo", "test-repo2"
    • Search term "terraform" -> fetched 1 result: "terraform-test".
    • Invalid Search term -> fetched 0 result.

@bradrydzewski
Copy link
Member

I noticed this function uses a strings.Builder for building the url query string. However, in the rest of the functions we use url.Values for building and encoding the query string. Example:

	params := url.Values{}
	if opts.Page != 0 {
		params.Set("page", strconv.Itoa(opts.Page))
	}
	if opts.Size != 0 {
		params.Set("per_page", strconv.Itoa(opts.Size))
	}
	...
	return params.Encode()

Is there a reason to use strings.Builder or can we change this to url.Values?

scm/driver/github/util.go Outdated Show resolved Hide resolved
@adivishy1 adivishy1 merged commit 6089476 into drone:master Mar 25, 2024
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.

None yet

4 participants