Skip to content

Add license to repository search#2258

Merged
shiftkey merged 2 commits intooctokit:mainfrom
Dagizmo:license_search
Oct 6, 2020
Merged

Add license to repository search#2258
shiftkey merged 2 commits intooctokit:mainfrom
Dagizmo:license_search

Conversation

@Dagizmo
Copy link
Contributor

@Dagizmo Dagizmo commented Oct 2, 2020

Search Repositories by license is supported by github api:
https://help.github.com/articles/searching-repositories#search-by-license

Currently only a list of licenses is supported as stated in :
https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/licensing-a-repository#searching-github-by-license-type.

But using GitHub search I was able to find more licenses types keys.
https://github.com/search/advanced

This PR, adds all licenses found right now on GitHub.

One of the issues found while developing is that Octokit.License class does exist, while Octokit.Langues exist inside SearchRepositoriesRequest.cs and is also used on different classes I think we should move it later, for this PR I named the enum that has the licenses as : Octokit.RepoSearchLicense, the name can change, also I took the "license" word of the description of the enum, but I can put it back if needed.

Also test were added :)

Jose de Jesus Medina Rios and others added 2 commits October 1, 2020 17:21
@codecov
Copy link

codecov bot commented Oct 2, 2020

Codecov Report

Merging #2258 into main will decrease coverage by 0.82%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2258      +/-   ##
==========================================
- Coverage   65.98%   65.16%   -0.83%     
==========================================
  Files         553      553              
  Lines       14428    14408      -20     
  Branches      843      841       -2     
==========================================
- Hits         9521     9389     -132     
+ Misses       4748     4744       -4     
- Partials      159      275     +116     
Impacted Files Coverage Δ
...ctokit/Models/Request/SearchRepositoriesRequest.cs 71.96% <100.00%> (+0.80%) ⬆️
Octokit/Helpers/AuthorizationExtensions.cs 82.35% <0.00%> (-17.65%) ⬇️
Octokit/Clients/MigrationsClient.cs 83.33% <0.00%> (-16.67%) ⬇️
Octokit/Clients/StatisticsClient.cs 86.20% <0.00%> (-13.80%) ⬇️
Octokit/Clients/GitHubAppInstallationsClient.cs 50.00% <0.00%> (-12.50%) ⬇️
Octokit/Clients/RepositoryInvitationsClient.cs 67.85% <0.00%> (-10.72%) ⬇️
Octokit/Clients/ApiPagination.cs 40.00% <0.00%> (-10.00%) ⬇️
Octokit/Clients/ProjectColumnsClient.cs 73.91% <0.00%> (-8.70%) ⬇️
Octokit/Clients/Enterprise/EnterpriseLdapClient.cs 66.66% <0.00%> (-8.34%) ⬇️
Octokit/Clients/WatchedClient.cs 85.18% <0.00%> (-7.41%) ⬇️
... and 29 more

Copy link
Member

@shiftkey shiftkey left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @Dagizmo!

@shiftkey shiftkey merged commit df77be2 into octokit:main Oct 6, 2020
@shiftkey
Copy link
Member

release_notes: License property added to repository search API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Something isn't working as documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants