Skip to content

Commit

Permalink
Post a comment explaining the TC violations.
Browse files Browse the repository at this point in the history
If the online QC check fails, check if the failure is due to violations
of the taxon constraints and if it is, post a comment to the PR with the
reasoner's explanations for the violations.
  • Loading branch information
gouttegd committed Nov 2, 2023
1 parent dc3aa6a commit a9b6d7e
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/qc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,35 @@ jobs:
- uses: actions/checkout@v2

- name: Run ontology QC checks
id: check
continue-on-error: true
env:
DEFAULT_BRANCH: master
ROBOT_JAVA_ARGS: -Xmx6G
run: cd src/ontology && mkdir -p tmp reports mirror && make ROBOT_ENV='ROBOT_JAVA_ARGS=-Xmx6G' GH_ACTION=true BRI=false MIR=false IMP=false test > TESTLOG.log

- name: Reason over taxon constraints
id: explaintc
continue-on-error: true
if: steps.check.outcome == 'failure'
run: |
if [ -s src/ontology/reports/taxon-constraint-check.txt ]; then
robot explain -i src/ontology/tmp/uberon-edit-plus-tax-equivs.owl -M unsatisfiability -u all -r ELK -e taxon-unsats.md
echo "<details>\n<summary>This PR violates some taxon constraints. Here is what the reasoner has to say:</summary>\n" > comment.md
cat taxon-unsats.md >> comment.md
echo "</details>" >> comment.md
exit 1
fi
- name: Post explanation for taxon constraint violations
if: steps.explaintc.outcome == 'failure'
uses: NejcZdovc/comment-pr@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
file: "../../comment.md"
identifier: "TAXON_CONSTRAINTS_REASONING"

- name: Last rows of QC report
if: ${{ failure() }}
run: tail -20 src/ontology/TESTLOG.log
if: steps.check.outcome == 'failure'
run: |
tail -20 src/ontology/TESTLOG.log
exit 1

0 comments on commit a9b6d7e

Please sign in to comment.