Skip to content

Commit

Permalink
Pure GraphQL Peloton update script (#16)
Browse files Browse the repository at this point in the history
* New update script using all GraphQL via sgqlc.

* Shebang.

* Docstrings and type hints.

* Coding standards.

* Reference new script in GHA.

* Add supporting schema and update instructions.

* Remove old files.

* Top level docstring.

* Record project settings in a MD file.

* Rename debug to verbose.

* Demonstrate GHA.

* Remove pygithub from dependencies.

* Demonstrate GHA.

* Demonstrate GHA.

* Correct invocation of update_loop_minutes.

* Default for update_loop_minutes.

* Avoid rate limiting from GitHub.

* Revert "Demonstrate GHA."

This reverts commit 79356fe.

* Revert "Demonstrate GHA."

This reverts commit 0d37bfe.

* Revert "Demonstrate GHA."

This reverts commit 72049a1.

* Demonstrate GHA.

* Restore defaulting of update_loop_minutes.

* Revert "Demonstrate GHA."

This reverts commit 6ee4342.

* Use curly braces for parameter expansion.

Co-authored-by: Bill Little <[email protected]>

* Use curly braces for parameter expansion.

Co-authored-by: Bill Little <[email protected]>

* Move some strings to constants.

* Better string formatting.

* Comment about negating GH search syntax.

* Convenience for converting dt to date strings.

* Make mutation result a read-only property.

---------

Co-authored-by: Bill Little <[email protected]>
  • Loading branch information
trexfeathers and bjlittle authored Dec 15, 2023
1 parent 6309c10 commit 15ef8fb
Show file tree
Hide file tree
Showing 10 changed files with 37,927 additions and 517 deletions.
26 changes: 17 additions & 9 deletions .github/workflows/peloton.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Peloton
on:
schedule:
- cron: "50 02 * * *"
workflow_dispatch:
inputs:
update_loop_minutes:
description: "Number of minutes to keep updating for, after full refresh."
required: true
default: 0

jobs:
update_peloton_project:
Expand All @@ -27,12 +33,14 @@ jobs:
- name: "Set up environment"
run: conda install -c conda-forge --file peloton/requirements.txt

- name: "Query GitHub"
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: $CONDA/bin/python peloton/query.py

- name: "Populate Peloton Project"
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
run: $CONDA/bin/python peloton/populate.py
- name: "Update the Peloton Project"
run: |
if [ -z "${{ github.event.inputs.update_loop_minutes }}" ]; then
update_loop_minutes=0
else
update_loop_minutes=${{ github.event.inputs.update_loop_minutes }}
fi
$CONDA/bin/python peloton/update_project.py \
--verbose \
--bearer_token "${{ steps.generate_token.outputs.token }}" \
-- update_loop_minutes $update_loop_minutes
1 change: 0 additions & 1 deletion peloton/.gitignore

This file was deleted.

67 changes: 0 additions & 67 deletions peloton/common.py

This file was deleted.

Loading

0 comments on commit 15ef8fb

Please sign in to comment.