mirror of https://github.com/zcash/developers.git
Merge pull request #37 from nathan-at-least/ignore-local-credentials
Use credentials in well-known filenames.
This commit is contained in:
commit
d6691cb2b6
|
@ -4,3 +4,8 @@ public/*.svg
|
|||
|
||||
github_schema.json
|
||||
github_schema.py
|
||||
|
||||
poetry.lock
|
||||
|
||||
GITHUB_TOKEN
|
||||
ZENHUB_TOKEN
|
||||
|
|
33
README.md
33
README.md
|
@ -12,38 +12,39 @@ It also depends on the Graphviz library; for Debian-based distros, install the
|
|||
|
||||
After installing `poetry`, run `poetry install`.
|
||||
|
||||
The scripts provided by this project require two environment variables:
|
||||
### Authorization Tokens
|
||||
|
||||
The scripts provided by this project require two files:
|
||||
|
||||
- `GITHUB_TOKEN`: a GitHub API token with permission to read the necessary repositories.
|
||||
- `ZENHUB_TOKEN`: a ZenHub API token.
|
||||
- `ZENHUB_TOKEN`: a ZenHub REST API token. (Not a GraphQL token.)
|
||||
|
||||
After generating each token, paste the literal contents into the associated file. There is a
|
||||
`.gitignore` which ignores these files to ensure they are not committed. Be careful to avoid
|
||||
that editor temporary files or any copies or renames of these files aren't committed.
|
||||
|
||||
You can generate a GitHub token with [this url](https://github.com/settings/tokens/new). This
|
||||
token should not have any excess authority; it only needs public read access! Make sure all of
|
||||
those extra capability checkboxes are unchecked.
|
||||
|
||||
The DAG script depends upon GraphQL APIs for GitHub which can be generated using
|
||||
`GITHUB_TOKEN=<INSERT> ./gen-schema.sh`.
|
||||
`./gen-schema.sh`.
|
||||
|
||||
## Generating DAGs
|
||||
|
||||
The `zcash-issue-dag.py` script supports several configuration options,
|
||||
also supplied as environment variables:
|
||||
The simplest way to generate one or more DAGs is to use `./gen-dag.sh` script. This takes
|
||||
a list of DAGs to render as arguments (default: `core wallet tfl halo2 zf`).
|
||||
|
||||
Alternatively, the `zcash-issue-dag.py` script supports several configuration options
|
||||
supplied as environment variables:
|
||||
|
||||
- `DAG_VIEW=[core|halo2|tfl|wallet|wallet-ios|wallet-android|zf]`: The DAG to render (default: `core`).
|
||||
- `SHOW_MILESTONES=[true|false]`: Whether or not to render GitHub milestones as boxes (default: `false`).
|
||||
- `SHOW_EPICS=[true|false]`: Whether or not to render ZenHub epics as boxes (default: `false`).
|
||||
- `INCLUDE_FINISHED=[true|false]`: Whether or not to include closed issues with no open blockers (default: `false`).
|
||||
|
||||
Here's an example script for easily running the DAG generator:
|
||||
Example command:
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DAG_VIEW=core \
|
||||
SHOW_MILESTONES=false \
|
||||
GITHUB_TOKEN=<INSERT> \
|
||||
ZENHUB_TOKEN=<INSERT> \
|
||||
poetry run python ./zcash-issue-dag.py
|
||||
```
|
||||
|
||||
You can find a series of template script files inside the folder `template_scripts`.
|
||||
DAG_VIEW=core SHOW_MILESTONES=false poetry run python ./zcash-issue-dag.py
|
||||
```
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
set -efuo pipefail
|
||||
|
||||
views=${*:-core wallet tfl halo2 zf}
|
||||
|
||||
for view in ${views}
|
||||
do
|
||||
echo Generating ${view} DAG...
|
||||
DAG_VIEW=${view} \
|
||||
SHOW_MILESTONES=true \
|
||||
SHOW_EPICS=true \
|
||||
GITHUB_TOKEN="$(cat GITHUB_TOKEN)" \
|
||||
ZENHUB_TOKEN="$(cat ZENHUB_TOKEN)" \
|
||||
poetry run python ./zcash-issue-dag.py
|
||||
done
|
|
@ -1,9 +1,10 @@
|
|||
#!/usr/bin/env bash
|
||||
set -eu
|
||||
|
||||
poetry run python3 -m sgqlc.introspection \
|
||||
--exclude-deprecated \
|
||||
--exclude-description \
|
||||
-H "Authorization: bearer $GITHUB_TOKEN" \
|
||||
-H "Authorization: bearer $(cat GITHUB_TOKEN)" \
|
||||
https://api.github.com/graphql \
|
||||
github_schema.json
|
||||
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#GITHUB_TOKEN=<INSERT> \
|
||||
#ZENHUB_TOKEN=<INSERT> \
|
||||
poetry run python3 -m sgqlc.introspection \
|
||||
--exclude-deprecated \
|
||||
--exclude-description \
|
||||
-H "Authorization: bearer $GITHUB_TOKEN" \
|
||||
https://api.github.com/graphql \
|
||||
github_schema.json
|
||||
|
||||
poetry run sgqlc-codegen schema github_schema.json github_schema.py
|
|
@ -1,7 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
DAG_VIEW=wallet-android \
|
||||
SHOW_MILESTONES=true \
|
||||
#GITHUB_TOKEN=<INSERT> \
|
||||
#ZENHUB_TOKEN=<INSERT> \
|
||||
poetry run python ./zcash-issue-dag.py
|
|
@ -1,7 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
DAG_VIEW=wallet \
|
||||
SHOW_MILESTONES=true \
|
||||
#GITHUB_TOKEN=<INSERT> \
|
||||
#ZENHUB_TOKEN=<INSERT> \
|
||||
poetry run python ./zcash-issue-dag.py
|
|
@ -1,7 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
DAG_VIEW=wallet-ios \
|
||||
SHOW_MILESTONES=true \
|
||||
#GITHUB_TOKEN=<INSERT> \
|
||||
#ZENHUB_TOKEN=<INSERT> \
|
||||
poetry run python ./zcash-issue-dag.py
|
Loading…
Reference in New Issue