comses.net
comses.net copied to clipboard
git(hub) integration feature
this relies on changes in #790
part 1 (1-way mirror):
adds a button that allows model submitters to create an auto-updating, read-only git repository archive which is hosted on a central organization
the 'mirror' git repository consists of commits for each release that are tagged and branched off so that metadata can be updated for individual releases without re-writing history
additions
library.fs.CodebaseGitRepositoryApi: functionality for building/updating a git repository from aCodebaselibrary.github.GithubApi: provides an interface overPyGithubfor interacting with repositories on githublibrary.github.GithubRepoNameValidator: providesvalidate()to make sure a repo name is valid and unusedmirror_codebase()andupdate_mirrored_codebase()huey tasks which call theCodebaseGitRepositoryApito build the git repo on the file system and thenGithubApito create/push to the remoteupdate_mirrored_release_metadata()huey task which is triggered when there is an update to codemeta, and updates the corresponding release branch in git after the submission package is rebuilt- feature overview page at
/github/ - button + form on the release detail page for mirroring a codebase
configuration steps
- create an app on the
comses-model-libraryorganization with the following permissions:- Administration: read and write
- Contents: read and write
- Metadata: read only
- create a webhook secret and set the webhook url
<HOST>/github-sync-webhook/** the trailing slash is very important for some reason - subscribe to the
Releasewebhook event - generate private key
- install the app on the organization and add the installation id to
.env - add the app id, app name, and organization name to
.env - add the private key and webhook secret to
secrets/
I believe all of the main functionality for the 2-way sync is now implemented and works for simple cases. Likely not bulletproof nor polished so I now need to do lots and lots of testing
replaced by #815