-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Draft new workflow * Add utility script * Update Makefile * Update casing to be consistent * Update Makefile * Revise workflow file * Make workflow consistent with changes * Also update if workflow updates * Lint * Combine and rename main build and test workflow * Update * Add cli tool install to step * Revise cond and test * Rebuild NF.jsonld, json * Update workflow to propagate changes to Synapse schema registry as well * Update token ref * Lint * Add term * Rebuild NF.jsonld, json --------- Co-authored-by: nf-osi[bot] <[email protected]>
- Loading branch information
1 parent
bb6dca2
commit 30291f1
Showing
14 changed files
with
492 additions
and
323 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: schematic-ci | ||
name: main-ci | ||
|
||
on: | ||
|
||
|
@@ -13,7 +13,6 @@ on: | |
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
if: ${{ !contains(github.event.head_commit.message, '[skip schematic]') }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -28,20 +27,30 @@ jobs: | |
bash < <(curl -s https://raw.githubusercontent.com/babashka/babashka/master/install) | ||
git clone --depth 1 https://github.com/anngvu/retold.git | ||
make | ||
- name: Install tools and regenerate registered jsons for Superdataset, PortalDataset, etc | ||
run: | | ||
pip install linkml | ||
npm install -g json-dereference-cli | ||
make Dataset | ||
make Superdataset | ||
make PortalDataset | ||
make PortalStudy | ||
- name: Commit files | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "nf-osi[bot]" | ||
git add "NF.jsonld" | ||
git commit -m "Build jsonld" | ||
git add . | ||
git commit -m "Rebuild NF.jsonld, json" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.event.pull_request.head.ref }} | ||
|
||
|
||
# Additionally test PRs | ||
test: | ||
name: Test with schematic | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# When updates are merged into main, propagate data model updates to various places: | ||
# 1. dcc-site uses assay, etc. for drop-down options; triggers a workflow in dcc-site that creates a PR to pull in new terms. | ||
# 2. The Synapse schema registry has schemas for the NF entities such as portal studies and datasets. Push updated JSON schemas to the Synapse registry. | ||
# | ||
# Highly related but to be handled by separate workflow: | ||
# Update data model version in DCA-prod for official releases (instead of every merge into main) | ||
|
||
name: Propagate data model updates | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- NF.jsonld | ||
|
||
env: | ||
REPO: nf-osi/dcc-site | ||
REF: refs/heads/main | ||
SYNAPSE_AUTH_TOKEN: ${{ secrets.DATA_MODEL_SERVICE }} | ||
|
||
jobs: | ||
trigger-sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Dispatch update workflow for dcc-site | ||
uses: benc-uk/workflow-dispatch@v1 | ||
with: | ||
workflow: Handle data model update | ||
repo: ${{ env.REPO }} | ||
ref: ${{ env.REF }} | ||
token: ${{ secrets.SERVICE_TOKEN }} | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Push to Synapse schema registry only JSON schemas that changed | ||
run: | | ||
CHANGED=$(git diff --name-only HEAD HEAD~1 registered-json-schemas) | ||
for FILE in $CHANGED | ||
do | ||
REQUEST_BODY=$(jq '. + { concreteType: "org.sagebionetworks.repo.model.schema.CreateSchemaRequest", dryRun: false }' $FILE) | ||
RESPONSE=$(curl -X POST https://repo-prod.prod.sagebase.org/repo/v1/schema/type/create/async/start \ | ||
-H "Authorization: Bearer $SYNAPSE_AUTH_TOKEN" \ | ||
-H "Content-Type: application/json" \ | ||
-d "$REQUEST_BODY") | ||
# Will error if token not within response | ||
TOKEN=$( echo $RESPONSE | jq -e -r '.token') | ||
sleep 1 | ||
STATUS=$(curl "https://repo-prod.prod.sagebase.org/repo/v1/schema/type/create/async/get/$TOKEN" \ | ||
-H "Authorization: Bearer $SYNAPSE_AUTH_TOKEN") | ||
echo $STATUS | jq -e '.newVersionInfo' | ||
done | ||
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.