Skip to content

feat: add fork filter parameter to repository search functionality #250

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

Closed
wants to merge 1 commit into from

Conversation

MayorFaj
Copy link
Contributor

This pull request introduces a new feature to filter repository search results by fork status. The changes include updates to the README.md, the main search function, and the test cases to support this new functionality.

New feature for fork filtering:

  • README.md: Added a description for the new fork parameter in the search query options.

Code updates for fork filtering:

  • pkg/github/search.go: Imported the strings package and added the containsForkFilter function to check for existing fork filters in the query. Updated the SearchRepositories function to include the fork parameter and modify the query accordingly. [1] [2]

Test updates for fork filtering:

  • pkg/github/search_test.go: Added new test cases to verify the behavior of the fork parameter in repository searches, including scenarios where the parameter is not provided, set to 'only', 'true', or 'false'. [1] [2]

@Copilot Copilot AI review requested due to automatic review settings April 12, 2025 17:35
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

@juruen
Copy link
Collaborator

juruen commented Apr 13, 2025

@MayorFaj

First of all, thank you so much for your time working on this. I really appreciate your engagement here and in other PRs ❤️

Re: these changes. I'm not entirely sure they are needed as I can make the existing search_repositories tool search based on the different fork filters without adding the parameter, just by being explicit in the prompt.

Let me show you a couple of examples:

Screenshot 2025-04-13 at 11 21 22 Screenshot 2025-04-13 at 11 25 19

Please, let me know what you think but I'm inclined to think that the current version seems to be enough to achieve this level of filtering.

Once again, thanks a lot for your time working on this!

@MayorFaj
Copy link
Contributor Author

Thanks @juruen it is a pleasure. So the current search repository func can't search profile(so to say, or my repo) and return all repositories including forked ones. When users try to list their repos, it doesnt return forked ones. The query you have written is only searching a particular repo.

@MayorFaj
Copy link
Contributor Author

MayorFaj commented Apr 13, 2025

Basically I am not able to list my forked repositories.
Perhaps there is a better approach compared to how it is done in this PR?

@juruen
Copy link
Collaborator

juruen commented Apr 13, 2025

Basically I am not able to list my forked repositories. Perhaps there is a better approach compared to how it is done in this PR?

I tried this and seemed to work. Is that what's not working for you?

Screenshot 2025-04-13 at 13 08 42

@MayorFaj
Copy link
Contributor Author

Yes, I will probably try refine my queries again. Seems strange

@juruen
Copy link
Collaborator

juruen commented Apr 15, 2025

@MayorFaj closing this for now as we discussed an alternative using an existing tool. Feel free to re-open this or open an issue to discuss this further.

But once again, thank so much for your help here! ❤️

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.

3 participants