This repository was archived by the owner on Jan 25, 2020. It is now read-only.
Generating list of repositories from github using github api#89
Open
michalbundyra wants to merge 3 commits into
Open
Generating list of repositories from github using github api#89michalbundyra wants to merge 3 commits into
michalbundyra wants to merge 3 commits into
Conversation
Member
Author
|
Forgot to mention: because we don't include all zendframework packages in statistics the total download number is slightly different. |
Member
Author
|
Here is PR to synchronize repos between zf-component-list.json file and github: zendframework/maintainers#22 |
**It requires setring GITHUB_TOKEN env variable on the server.** Build process runs composer twice - first to install all dependencies including also development dependencies. Then page files are built and composer is run one again, but now without dev dependencies (`--no-dev`).
THe file with the component list is generated on build process and it shouldn't be included in the repository.
Member
Author
|
Ok, so... I've updated the PR. Now component list is generated on build process, and composer install runs twice: first to install all dependencies (including dev) and the second one (after build process) to remove these dev dependencies. It is required to set |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently https://framework.zend.com/status does not contain all repositories from
zendframeworkorg (the same on stats, documentation, issues). The current list is generated from https://github.com/zendframework/zf-mkdoc-theme/blob/gh-pages/scripts/zf-component-list.json which was created mainly to use in documentation.I've created new script (
bin/repos.php <github-token>) to generate config file with all repositories to get data from github api. It is usingknplabs/github-api. I've added this as development dependency* in composer, so for now it should be generated locally and committed to the repository. We can change it and add it to the build process. Scripts requires providegithub-token- because there is hourly limit on github api request (without token is 60, with token is 5000*).Generated component list is associative array:
As you can see,
descriptionis fetched form github repository description, and probably it does not match description from zf-component-list.json. We can write another script to sychronize these descriptions.docshas value0or1which means if there is documentation for the component. We check ifmkdocs.ymlfile exists in the repository.On documentation page we display repositories only with documentation.
When we generate statistics we use only components published on packagist, so packages like
maintainers,zf3-web, ... are not gonna be on the statistics list.* As I mentioned the script should be run locally, it's not a part of build process. This is because, not sure if you'd like to add these composer dependencies on production. Another concern is 5000 requests per hour (with github token). It seems to be a lot.
We have right now 149 repositories, so to generate the whole list of component we need to do around
~160request to github api (1 request for each repo to check ifmkdocs.ymlexists, and listing all repositories). So even if we run build process multiple times on couple machines in the same hour it should be enough (shouldn't be?)About dev dependencies... I just got an idea - if we slightly change build process:
bin/build.php)composer install --no-devto remove dev dependencies needed to build the websiteThen we can have it on build process. What do you think?