You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
When calling the GitHub API to get a list of repositories the template_repository field is not included in the response. Thus if using this library to get a list of repositories (i.e. GHOrganization.listRepositories()) that field will always be null when mapped onto the GHRepository object constructed as introduced in PR#1817. Under a different proposal I saw PR#1579 it had a check
ifthis.template_repository == nullpopulate()
This has its own performance concerns as there is no flag that populate() isn't called more than once which would happen if this was not a child of a template repository and the getTemplateRepository() method was called multiple times. All works as expected when getting a single repository via GitHub.getRepository() as the GitHub API includes the template_repository field in that case.
To Reproduce
Steps to reproduce the behavior:
Go to '...'
Click on '....'
Scroll down to '....'
See error
GHRepositories[] repos = gitHub.getOrganization("SAMPLE").listRepositories(10);
for (GHRepositoryrepo : repos){
if (repo.getTemplateRepository() != null) {
// BUG: This will never hit as underlying template_repository field isn't ever populated when using list vs single get methodsdoSomethingWithTemplate();
}
}
Expected behavior
A clear and concise description of what you expected to happen.
I expect the GHRepository.getTemplateRepository() to return the value assuming the repo is a child of a template regardless of if it was originally constructed by a method to get the single repo (working) versus getting a list of repositories (not working) and believe making the delayed load populate() call as seen in other places is an established behavior that would be expected.
Desktop (please complete the following information):
OS: [e.g. iOS]
Browser [e.g. chrome, safari]
Version [e.g. 22]
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
A clear and concise description of what the bug is.
When calling the GitHub API to get a list of repositories the
template_repository
field is not included in the response. Thus if using this library to get a list of repositories (i.e.GHOrganization.listRepositories()
) that field will always be null when mapped onto the GHRepository object constructed as introduced in PR#1817. Under a different proposal I saw PR#1579 it had a checkThis has its own performance concerns as there is no flag that
populate()
isn't called more than once which would happen if this was not a child of a template repository and thegetTemplateRepository()
method was called multiple times. All works as expected when getting a single repository viaGitHub.getRepository()
as the GitHub API includes the template_repository field in that case.To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
I expect the GHRepository.getTemplateRepository() to return the value assuming the repo is a child of a template regardless of if it was originally constructed by a method to get the single repo (working) versus getting a list of repositories (not working) and believe making the delayed load
populate()
call as seen in other places is an established behavior that would be expected.Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: