<div class="socmaildefaultfont" dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10pt" ><div dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10pt" ><div dir="ltr" >Brad/Andrew,</div>
<div dir="ltr" > </div>
<div dir="ltr" ><div>We are using pygithub3 module to list the repo's under openbmc</div>
<div> </div>
<div>here is the snippet of that code . we create a list based on o/p of this which is i/p to the main script which does the analysis</div>
<div> </div>
<div>If the repo's are archived saw that this below code as well skips same</div>
<div> </div>
<div><div>#!/usr/bin/env python<br>""" Print all of the clone-urls for a GitHub organization.</div>
<div>It requires the pygithub3 module, which you can install like this::</div>
<div> $ sudo yum -y install python-virtualenv<br> $ mkdir scratch<br> $ cd scratch</div>
<div> $ virtualenv my-virtualenv<br> $ source my-virtualenv/bin/activate</div>
<div> $ pip install pygithub3</div>
<div>Usage example::</div>
<div> $ python list-all-repos.py</div>
<div>Advanced usage. This will actually clone all the repos for a<br>GitHub organization or user::</div>
<div> $ for url in $(python list-all-repos.py); do git clone $url; done</div>
<div>"""</div>
<div>import pygithub3</div>
<div>gh = None</div>
<div><br>def gather_clone_urls(organization, no_forks=True):<br> all_repos = gh.repos.list(user=organization).all()<br> for repo in all_repos:</div>
<div> # Don't print the urls for repos that are forks.<br> if no_forks and repo.fork:<br> continue</div>
<div> yield repo.clone_url</div>
<div><br>if __name__ == '__main__':<br> gh = pygithub3.Github()</div>
<div> clone_urls = gather_clone_urls("openbmc")<br> for url in clone_urls:<br> print url</div>
<div> </div>
<div> </div></div></div>
<div dir="ltr" ><div dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10pt" ><div dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10.5pt" ><div dir="ltr" style="font-family:Arial, Helvetica, sans-serif;font-size:10.5pt" ><div dir="ltr" >Thanks & Regards,<br>Lakshminarayana Kamath</div></div></div></div></div>
<div dir="ltr" > </div>
<blockquote data-history-content-modified="1" data-history-expanded="1" dir="ltr" style="border-left:solid #aaaaaa 2px; margin-left:5px; padding-left:5px; direction:ltr; margin-right:0px" >----- Original message -----<br>From: Brad Bishop <bradleyb@fuzziesquirrel.com><br>To: Lakshminarayana R Kammath <lkammath@in.ibm.com><br>Cc: openbmc@lists.ozlabs.org<br>Subject: [EXTERNAL] Re: [OpenBMC]: Unit test coverage analysis on openbmc repositories<br>Date: Fri, Feb 28, 2020 10:06 PM<br>
<div><font size="2" face="Default Monospace,Courier New,Courier,monospace" >at 11:31 AM, Brad Bishop <bradleyb@fuzziesquirrel.com> wrote:<br><br>> at 11:30 AM, Lakshminarayana R Kammath <lkammath@in.ibm.com> wrote:<br>><br>>> sure Brad!<br>>><br>>> If Some one can confirm the list of repo's that can be ignored we can <br>>> put them to blacklist<br>><br>> Is it possible to use the GitHub api to query this? Then we don’t need <br>> to maintain a blacklist. How are you building the list of repos?<br><br><a href="https://developer.github.com/v3/repos/#list-organization-repositories" target="_blank">https://developer.github.com/v3/repos/#list-organization-repositories</a> <br><br>there is an “archived” property in the response to this list-org-repos api <br>that seems like it would work?<br><br>This looks like an interesting python module that might make the API <br>interaction easier...<br><br><a href="https://pygithub.readthedocs.io/en/latest/" target="_blank">https://pygithub.readthedocs.io/en/latest/</a> </font><br> </div></blockquote>
<div dir="ltr" > </div></div></div><BR>