Skip to content

Commit

Permalink
Merge branch 'master' into issue-3471
Browse files Browse the repository at this point in the history
  • Loading branch information
aleixpuigb authored Feb 4, 2025
2 parents 5f62771 + 18805aa commit bc8aac5
Show file tree
Hide file tree
Showing 350 changed files with 1,226,022 additions and 1,125,564 deletions.
3 changes: 1 addition & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# Uberon code owners (Guardians of the main branch)
# GitHub documentation about CODEOWNERS file - https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

* @anitacaron
*.yaml @matentzn
*Makefile @gouttegd
*uberon.Makefile @gouttegd @matentzn @anitacaron
*uberon.Makefile @gouttegd @matentzn


#docs/* [email protected]
Expand Down
31 changes: 27 additions & 4 deletions .github/workflows/auto-pr-ontobot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,30 @@ on:
types: [ opened, edited ]

jobs:
check:
runs-on: ubuntu-latest
outputs:
phraseExists: ${{ steps.check-body.outputs.result }}
steps:
- name: Check if issue body contains 'Hey ontobot'
id: check-body
uses: actions/github-script@v6
with:
script: |
const issue = await github.rest.issues.get({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
});
if (!issue.data.body) {
console.log('Issue body is empty or null');
return false;
}
return issue.data.body.toLowerCase().includes('hey ontobot');
build:
needs: check
if: needs.check.outputs.phraseExists == 'true'
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -24,7 +47,7 @@ jobs:
id: gh-script-issue
uses: actions/github-script@v6
with:
# github-token: ${{ secrets.GH_TOKEN }}
github-token: ${{ secrets.ONTOBOT_TOKEN }}
script: |
const issue_number = context.issue.number
const repo = context.repo.owner+"/"+context.repo.repo
Expand All @@ -34,7 +57,7 @@ jobs:
id: gh-script-repo
uses: actions/github-script@v6
with:
# github-token: ${{ secrets.GH_TOKEN }}
github-token: ${{ secrets.ONTOBOT_TOKEN }}
script: |
const repo = context.repo.owner+"/"+context.repo.repo
return repo
Expand All @@ -55,7 +78,7 @@ jobs:
ochange process-issue ${{ env.resource }} \
-r ${{ steps.gh-script-repo.outputs.result }} \
-n ${{ steps.gh-script-issue.outputs.result }} \
-g ${{ secrets.GH_TOKEN }} \
-g ${{ secrets.ONTOBOT_TOKEN }} \
-p UBERON
- name: Create Pull Request
Expand All @@ -70,4 +93,4 @@ jobs:
committer: ${{ env.ISSUE_CREATOR }} <${{ env.ISSUE_CREATOR }}@users.noreply.github.com>
base: ${{ github.head_ref }}
branch: ${{ env.branch-name }}
# token: ${{ secrets.GH_TOKEN }}
token: ${{ secrets.ONTOBOT_TOKEN }}
194 changes: 150 additions & 44 deletions .github/workflows/diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ on:

issue_comment:
types: [created]
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
diff-reports:
if: ${{ github.event.issue.pull_request }}
runs-on: macos-latest
branch_status:
if: ${{ github.event.issue.pull_request && github.event.issue.state == 'open' }}
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
Expand All @@ -20,58 +22,164 @@ jobs:
trigger: '#gogoeditdiff'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- uses: docker-practice/actions-setup-docker@master
# Checks-out current branch
- uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch
- uses: actions/checkout@v4
if: steps.check.outputs.triggered == 'true'
- run: |
set -x
docker version
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
# Checks-out master branch under "master" directory
- uses: actions/checkout@v4
if: steps.check.outputs.triggered == 'true'
- name: Install ODK
run: docker pull obolibrary/odklite
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
fetch-depth: 0
- name: Check current branch status
if: steps.check.outputs.triggered == 'true'
# Checks-out current branch
- uses: xt0rted/pull-request-comment-branch@v1
id: info
run: |
echo "status=$(git rev-list --left-right --count origin/$DEFAULT_BRANCH...origin/`git branch --show-current` | awk '{print $1}')"
echo "status=$(git rev-list --left-right --count origin/$DEFAULT_BRANCH...origin/`git branch --show-current` | awk '{print $1}')" >> $GITHUB_OUTPUT
- name: Warn users with a comment
if: steps.info.outputs.status >= 1
run: echo "Your branch is ${{ steps.info.outputs.status }} commit/s behind, please update your branch." > warncomment.md
- name: Post comment
if: steps.info.outputs.status >= 1 && steps.check.outputs.triggered == 'true'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
uses: NejcZdovc/comment-pr@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
file: "../../warncomment.md"
- name: Fail step if branch is behind
if: steps.info.outputs.status >= 1 && steps.check.outputs.triggered == 'true'
run: |
echo "Your branch is ${{ steps.info.outputs.status }} commit/s behind, please update your branch."
exit 1
edit_file:
needs: [branch_status]
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.5.3
steps:
- uses: khan/[email protected]
id: check
with:
trigger: '#gogoeditdiff'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: steps.check.outputs.triggered == 'true'
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
# Checks-out master branch under "master" directory
- uses: actions/checkout@v3
path: branch
- uses: actions/checkout@v4
if: steps.check.outputs.triggered == 'true'
with:
ref: master
path: master
- name: Diff classification
if: steps.check.outputs.triggered == 'true'
run: |
cd src/ontology
docker run -v $PWD/../../:/work -w /work/src/ontology -e ROBOT_JAVA_ARGS='-Xmx9G' -e JAVA_OPTS='-Xmx9G' --rm obolibrary/odklite robot diff --left ../../master/src/ontology/uberon-edit.obo --left-catalog ../../master/src/ontology/catalog-v001.xml --right uberon-edit.obo --right-catalog catalog-v001.xml -f markdown -o edit-diff.md
run: export ROBOT_JAVA_ARGS='-Xmx9G'; robot diff --labels True --left master/src/ontology/uberon-edit.obo --left-catalog master/src/ontology/catalog-v001.xml --right branch/src/ontology/uberon-edit.obo --right-catalog branch/src/ontology/catalog-v001.xml -f markdown -o edit-diff.md
- name: Upload diff
if: steps.check.outputs.triggered == 'true'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: edit-diff.md
path: src/ontology/edit-diff.md
- name: Make step for branch
path: edit-diff.md
classify_branch:
needs: [branch_status]
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.5.3
steps:
- uses: khan/[email protected]
id: check
with:
trigger: '#gogoeditdiff'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch
- uses: actions/checkout@v4
if: steps.check.outputs.triggered == 'true'
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}
- name: Classify ontology PR branch
if: steps.check.outputs.triggered == 'true'
run: cd src/ontology && mkdir -p tmp reports mirror && docker run -v $PWD/../../:/work -w /work/src/ontology -e ROBOT_JAVA_ARGS='-Xmx9G' -e JAVA_OPTS='-Xmx9G' --rm obolibrary/odklite make BRI=false MIR=false PAT=false IMP=false uberon-simple.owl > TESTLOG.log
- name: Make step for master
run: export ROBOT_JAVA_ARGS='-Xmx9G'; cd src/ontology; make BRI=false MIR=false PAT=false IMP=false COMP=false uberon-base.owl > TESTLOG.log
- name: Upload classified ontology in PR branch
if: steps.check.outputs.triggered == 'true'
run: cd master/src/ontology && mkdir -p tmp reports mirror && docker run -v $PWD/../../:/work -w /work/src/ontology -e ROBOT_JAVA_ARGS='-Xmx9G' -e JAVA_OPTS='-Xmx9G' --rm obolibrary/odklite make BRI=false MIR=false PAT=false IMP=false uberon-simple.owl > TESTLOG.log
- name: Diff report
uses: actions/upload-artifact@v4
with:
name: uberon-base-pr.owl
path: src/ontology/uberon-base.owl
retention-days: 1
classify_main:
needs: [branch_status]
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.5.3
steps:
- uses: khan/[email protected]
id: check
with:
trigger: '#gogoeditdiff'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- uses: actions/checkout@v4
if: steps.check.outputs.triggered == 'true'
run: |
cd src/ontology
docker run -v $PWD/../../:/work -w /work/src/ontology -e ROBOT_JAVA_ARGS='-Xmx9G' -e JAVA_OPTS='-Xmx9G' --rm obolibrary/odklite robot diff --left ../../master/src/ontology/uberon-simple.owl --left-catalog catalog-v001.xml --right uberon-simple.owl --right-catalog ../../master/src/ontology/catalog-v001.xml -f markdown -o simple-report.md
with:
ref: master
- name: Classify ontology main branch
if: steps.check.outputs.triggered == 'true'
run: export ROBOT_JAVA_ARGS='-Xmx9G'; cd src/ontology; make BRI=false MIR=false PAT=false IMP=false COMP=false uberon-base.owl > TESTLOG.log
- name: Upload classified ontology main branch
if: steps.check.outputs.triggered == 'true'
uses: actions/upload-artifact@v4
with:
name: uberon-base-main.owl
path: src/ontology/uberon-base.owl
retention-days: 1
diff_classification:
needs: [classify_branch, classify_main]
runs-on: ubuntu-latest
container: obolibrary/odkfull:v1.5.3
steps:
- uses: khan/[email protected]
id: check
with:
trigger: '#gogoeditdiff'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- uses: actions/checkout@v4
if: steps.check.outputs.triggered == 'true'
- name: Download classified ontology main branch
if: steps.check.outputs.triggered == 'true'
uses: actions/download-artifact@v4
with:
name: uberon-base-main.owl
path: src/ontology/uberon-base-main.owl
- name: Download classified ontology in PR branch
if: steps.check.outputs.triggered == 'true'
uses: actions/download-artifact@v4
with:
name: uberon-base-pr.owl
path: src/ontology/uberon-base-pr.owl
- name: Diff classification
if: steps.check.outputs.triggered == 'true'
run: export ROBOT_JAVA_ARGS='-Xmx9G'; cd src/ontology; robot diff --labels True --left uberon-base-main.owl/uberon-base.owl --left-catalog catalog-v001.xml --right uberon-base-pr.owl/uberon-base.owl --right-catalog catalog-v001.xml -f markdown -o classification-diff.md
- name: Upload diff
if: steps.check.outputs.triggered == 'true'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: simple-report.md
path: src/ontology/simple-report.md
name: classification-diff.md
path: src/ontology/classification-diff.md
post_comment:
needs: [diff-reports]
needs: [edit_file, diff_classification]
runs-on: ubuntu-latest
steps:
- uses: khan/[email protected]
Expand All @@ -80,42 +188,40 @@ jobs:
trigger: '#gogoeditdiff'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
if: steps.check.outputs.triggered == 'true'
- name: Download reasoned diff
if: steps.check.outputs.triggered == 'true'
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: simple-report.md
name: classification-diff.md
- name: Prepare reasoned comment
run: "echo \"<details>\n <summary> Here's a diff of how these changes impact the classified ontology (on -simple file): </summary> \n\" > comment.md; cat simple-report.md >> comment.md"
if: steps.check.outputs.triggered == 'true'
run: "echo \"<details>\n <summary> Here's a diff of how these changes impact the classified ontology (on -base file): </summary> \n\" > comment.md; cat classification-diff.md >> comment.md"
- name: Post reasoned comment
if: steps.check.outputs.triggered == 'true'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
uses: NejcZdovc/[email protected]
uses: NejcZdovc/[email protected]
with:
file: "../../comment.md"
identifier: "REASONED"
- uses: actions/checkout@v3
github_token: ${{secrets.GITHUB_TOKEN}}
- uses: actions/checkout@v4
if: steps.check.outputs.triggered == 'true'
- name: Download edit diff
if: steps.check.outputs.triggered == 'true'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: edit-diff.md
- name: Prepare edit file comment
run: "echo \"<details>\n <summary> Here's a diff of your edit file (unreasoned) </summary> \n\" > edit-comment.md; cat edit-diff.md >> edit-comment.md"
if: steps.check.outputs.triggered == 'true'
run: "echo \"<details>\n <summary> Here's a diff of your edit file (unreasoned) </summary> \n\" > edit-comment.md; cat edit-diff.md >> edit-comment.md"
- name: Post comment
if: steps.check.outputs.triggered == 'true'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
uses: NejcZdovc/[email protected]
uses: NejcZdovc/[email protected]
with:
file: "../../edit-comment.md"
identifier: "UNREASONED"
github_token: ${{secrets.GITHUB_TOKEN}}



30 changes: 30 additions & 0 deletions .github/workflows/post-release-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Post release diff

on:
# Triggers the workflow on pull request events for the master branch
pull_request:
branches: [ master ]
paths:
- 'src/ontology/diffs/uberon-diff.md'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:

post_diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare release diff comment
env:
GITHUB_SHA: ${{ github.sha }}
run: "echo \"[Here's a diff of how this release impacts uberon-base.owl](https://github.com/obophenotype/uberon/blob/${{ env.GITHUB_SHA }}/src/ontology/diffs/uberon-diff.md)\" >comment.md"
- name: Post comment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: NejcZdovc/comment-pr@v2
with:
github_token: ${{ env.GITHUB_TOKEN }}
file: "../../comment.md"
identifier: "UBERON-DIFF"
Loading

0 comments on commit bc8aac5

Please sign in to comment.