From da90dcdf3a71d4619a7c5238d42451cf7a89cf68 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Tue, 29 Aug 2023 18:08:12 -0500 Subject: [PATCH 01/13] Added gh workflow for kgcl-java --- .github/workflows/ontobot.yml | 74 +++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/ontobot.yml diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml new file mode 100644 index 000000000..86d46e18a --- /dev/null +++ b/.github/workflows/ontobot.yml @@ -0,0 +1,74 @@ +name: Create new pull request + +on: + workflow_dispatch: + issues: + types: [ opened, edited ] + +jobs: + build: + runs-on: ${{ matrix.os }} + container: obolibrary/odkfull:v1.4.1 + strategy: + matrix: + python-version: ["3.9"] + os: [ ubuntu-latest ] + + steps: + - name: Checkout main branch + uses: actions/checkout@v3 + + - name: Return issue number + id: gh-script-issue + uses: actions/github-script@v6 + with: + # github-token: ${{ secrets.GH_TOKEN }} + script: | + const issue_number = context.issue.number + const repo = context.repo.owner+"/"+context.repo.repo + return issue_number + + - name: Return repository name + id: gh-script-repo + uses: actions/github-script@v6 + with: + # github-token: ${{ secrets.GH_TOKEN }} + script: | + const repo = context.repo.owner+"/"+context.repo.repo + return repo + + - name: Set branch name + id: vars + run: | + echo "resource=cl-base.owl" >> $GITHUB_ENV + echo "branch-name=kgcl_automation_"${{ steps.gh-script-issue.outputs.result }} >> $GITHUB_ENV + + - name: Get jar & create alias command. + run: wget https://github.com/gouttegd/kgcl-java/releases/download/kgcl-0.1.0/kgcl-robot-standalone-0.1.0.jar -O kgcl-robot.jar + + - name: Run kgcl-robot + id: kgcl-robot + run: | + java -jar kgcl-robot.jar apply -i ${{ env.resource }} \ + -k "create class CL:000099999999 'new class'" \ + -o ${{ env.resource }} + + - name: Clean-up + run: rm -f kgcl-robot.jar + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v5 + # if: ${{ env.PR_TITLE}} + with: + token: ${{ secrets.GH_TOKEN }} + branch-suffix: short-commit-hash + labels: Automated + # author: ${{ env.ISSUE_CREATOR }} <${{ env.ISSUE_CREATOR }}@users.noreply.github.com> + # committer: ${{ env.ISSUE_CREATOR }} <${{ env.ISSUE_CREATOR }}@users.noreply.github.com> + # body: ${{ env.PR_BODY }} + # title: ${{ env.PR_TITLE }} + body: "TEST KGCL_JAVA run." + title: "TEST KGCL_JAVA run." + branch: "test-kgcl-robot" + base: ${{ github.head_ref }} + # branch: ${{ env.branch-name }} \ No newline at end of file From f1640ba58cb60352b48935c6bd2dc7b16e175f71 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 30 Aug 2023 15:07:53 -0500 Subject: [PATCH 02/13] updated to use ontobot --- .github/workflows/ontobot.yml | 36 +++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml index 86d46e18a..184a5c9b9 100644 --- a/.github/workflows/ontobot.yml +++ b/.github/workflows/ontobot.yml @@ -18,6 +18,11 @@ jobs: - name: Checkout main branch uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Return issue number id: gh-script-issue uses: actions/github-script@v6 @@ -46,12 +51,18 @@ jobs: - name: Get jar & create alias command. run: wget https://github.com/gouttegd/kgcl-java/releases/download/kgcl-0.1.0/kgcl-robot-standalone-0.1.0.jar -O kgcl-robot.jar - - name: Run kgcl-robot - id: kgcl-robot + - name: Install dependencies + run: | + pip install ontobot-change-agent + + - name: Run ochange + id: ochange run: | - java -jar kgcl-robot.jar apply -i ${{ env.resource }} \ - -k "create class CL:000099999999 'new class'" \ - -o ${{ env.resource }} + ochange process-issue ${{ env.resource }} \ + -r ${{ steps.gh-script-repo.outputs.result }} \ + -n ${{ steps.gh-script-issue.outputs.result }} \ + -g ${{ secrets.GH_TOKEN }} \ + -j kgcl-robot.jar - name: Clean-up run: rm -f kgcl-robot.jar @@ -60,15 +71,12 @@ jobs: uses: peter-evans/create-pull-request@v5 # if: ${{ env.PR_TITLE}} with: - token: ${{ secrets.GH_TOKEN }} branch-suffix: short-commit-hash labels: Automated - # author: ${{ env.ISSUE_CREATOR }} <${{ env.ISSUE_CREATOR }}@users.noreply.github.com> - # committer: ${{ env.ISSUE_CREATOR }} <${{ env.ISSUE_CREATOR }}@users.noreply.github.com> - # body: ${{ env.PR_BODY }} - # title: ${{ env.PR_TITLE }} - body: "TEST KGCL_JAVA run." - title: "TEST KGCL_JAVA run." - branch: "test-kgcl-robot" + author: ${{ env.ISSUE_CREATOR }} <${{ env.ISSUE_CREATOR }}@users.noreply.github.com> + committer: ${{ env.ISSUE_CREATOR }} <${{ env.ISSUE_CREATOR }}@users.noreply.github.com> + body: ${{ env.PR_BODY }} + title: ${{ env.PR_TITLE }} base: ${{ github.head_ref }} - # branch: ${{ env.branch-name }} \ No newline at end of file + branch: ${{ env.branch-name }} + # token: ${{ secrets.GH_TOKEN }} \ No newline at end of file From 724a8262896773fac2dbc89de9f41d64c843a049 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 30 Aug 2023 15:12:14 -0500 Subject: [PATCH 03/13] uncommented token --- .github/workflows/ontobot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml index 184a5c9b9..4982f93b1 100644 --- a/.github/workflows/ontobot.yml +++ b/.github/workflows/ontobot.yml @@ -79,4 +79,4 @@ jobs: title: ${{ env.PR_TITLE }} base: ${{ github.head_ref }} branch: ${{ env.branch-name }} - # token: ${{ secrets.GH_TOKEN }} \ No newline at end of file + token: ${{ secrets.GH_TOKEN }} \ No newline at end of file From 08f6386143a14bbce2aa01c33da3db43dd3ed6d8 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 30 Aug 2023 15:13:17 -0500 Subject: [PATCH 04/13] comment token --- .github/workflows/ontobot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml index 4982f93b1..184a5c9b9 100644 --- a/.github/workflows/ontobot.yml +++ b/.github/workflows/ontobot.yml @@ -79,4 +79,4 @@ jobs: title: ${{ env.PR_TITLE }} base: ${{ github.head_ref }} branch: ${{ env.branch-name }} - token: ${{ secrets.GH_TOKEN }} \ No newline at end of file + # token: ${{ secrets.GH_TOKEN }} \ No newline at end of file From d1f379d9f6f4990ea440519327f4d35944050be3 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 30 Aug 2023 15:18:29 -0500 Subject: [PATCH 05/13] aded back token --- .github/workflows/ontobot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml index 184a5c9b9..4982f93b1 100644 --- a/.github/workflows/ontobot.yml +++ b/.github/workflows/ontobot.yml @@ -79,4 +79,4 @@ jobs: title: ${{ env.PR_TITLE }} base: ${{ github.head_ref }} branch: ${{ env.branch-name }} - # token: ${{ secrets.GH_TOKEN }} \ No newline at end of file + token: ${{ secrets.GH_TOKEN }} \ No newline at end of file From 7de453e104b42a6ec5700845cdf028afbcae1c54 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Wed, 30 Aug 2023 15:26:54 -0500 Subject: [PATCH 06/13] token commented --- .github/workflows/ontobot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml index 4982f93b1..184a5c9b9 100644 --- a/.github/workflows/ontobot.yml +++ b/.github/workflows/ontobot.yml @@ -79,4 +79,4 @@ jobs: title: ${{ env.PR_TITLE }} base: ${{ github.head_ref }} branch: ${{ env.branch-name }} - token: ${{ secrets.GH_TOKEN }} \ No newline at end of file + # token: ${{ secrets.GH_TOKEN }} \ No newline at end of file From 7862e5d50b42297128558addd0b312473b4a1b2c Mon Sep 17 00:00:00 2001 From: Harshad Date: Thu, 31 Aug 2023 18:09:46 -0500 Subject: [PATCH 07/13] Update kgcl-java to v0.2.0 --- .github/workflows/ontobot.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml index 184a5c9b9..c6c10491a 100644 --- a/.github/workflows/ontobot.yml +++ b/.github/workflows/ontobot.yml @@ -49,7 +49,7 @@ jobs: echo "branch-name=kgcl_automation_"${{ steps.gh-script-issue.outputs.result }} >> $GITHUB_ENV - name: Get jar & create alias command. - run: wget https://github.com/gouttegd/kgcl-java/releases/download/kgcl-0.1.0/kgcl-robot-standalone-0.1.0.jar -O kgcl-robot.jar + run: wget https://github.com/gouttegd/kgcl-java/releases/download/kgcl-0.2.0/kgcl-robot-standalone-0.2.0.jar -O kgcl-robot.jar - name: Install dependencies run: | @@ -79,4 +79,4 @@ jobs: title: ${{ env.PR_TITLE }} base: ${{ github.head_ref }} branch: ${{ env.branch-name }} - # token: ${{ secrets.GH_TOKEN }} \ No newline at end of file + # token: ${{ secrets.GH_TOKEN }} From 3f27a7be447664381dbaf995edadc3efc37d2096 Mon Sep 17 00:00:00 2001 From: Harshad Date: Tue, 5 Sep 2023 16:40:03 -0500 Subject: [PATCH 08/13] Update ontobot.yml --- .github/workflows/ontobot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml index c6c10491a..da8693acc 100644 --- a/.github/workflows/ontobot.yml +++ b/.github/workflows/ontobot.yml @@ -53,7 +53,7 @@ jobs: - name: Install dependencies run: | - pip install ontobot-change-agent + pip install ontobot-change-agent==0.4.4 - name: Run ochange id: ochange From 160afee2f79ad9b22eb3ab1f092ad8f4dc4a61bf Mon Sep 17 00:00:00 2001 From: Harshad Date: Tue, 5 Sep 2023 17:28:29 -0500 Subject: [PATCH 09/13] Update ontobot.yml --- .github/workflows/ontobot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml index da8693acc..c6c10491a 100644 --- a/.github/workflows/ontobot.yml +++ b/.github/workflows/ontobot.yml @@ -53,7 +53,7 @@ jobs: - name: Install dependencies run: | - pip install ontobot-change-agent==0.4.4 + pip install ontobot-change-agent - name: Run ochange id: ochange From f8e8d60588d9c044a698c76909ec9378a92f6567 Mon Sep 17 00:00:00 2001 From: Harshad Date: Tue, 5 Sep 2023 17:43:44 -0500 Subject: [PATCH 10/13] Update ontobot.yml --- .github/workflows/ontobot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml index c6c10491a..88a2e6de0 100644 --- a/.github/workflows/ontobot.yml +++ b/.github/workflows/ontobot.yml @@ -45,7 +45,7 @@ jobs: - name: Set branch name id: vars run: | - echo "resource=cl-base.owl" >> $GITHUB_ENV + echo "resource=src/ontology/cl-edit.owl" >> $GITHUB_ENV echo "branch-name=kgcl_automation_"${{ steps.gh-script-issue.outputs.result }} >> $GITHUB_ENV - name: Get jar & create alias command. From c5bee1a86aa7d8168ad0267c5120e3a735dc1ab5 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Thu, 2 Nov 2023 11:40:15 -0500 Subject: [PATCH 11/13] update workflow to use kgcl-java as a robot plugin --- .github/workflows/ontobot.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml index 88a2e6de0..b4a9e9324 100644 --- a/.github/workflows/ontobot.yml +++ b/.github/workflows/ontobot.yml @@ -48,12 +48,15 @@ jobs: echo "resource=src/ontology/cl-edit.owl" >> $GITHUB_ENV echo "branch-name=kgcl_automation_"${{ steps.gh-script-issue.outputs.result }} >> $GITHUB_ENV - - name: Get jar & create alias command. - run: wget https://github.com/gouttegd/kgcl-java/releases/download/kgcl-0.2.0/kgcl-robot-standalone-0.2.0.jar -O kgcl-robot.jar + - name: Get jar & enable plugin. + run: | + mkdir -p robot-plugins + wget https://github.com/gouttegd/kgcl-java/releases/download/kgcl-0.2.0/kgcl-robot-plugin-0.2.0.jar -O robot-plugins/kgcl.jar + echo "ROBOT_PLUGINS_DIRECTORY=$(pwd)/robot-plugins/" >> "$GITHUB_ENV" - name: Install dependencies run: | - pip install ontobot-change-agent + pip install git+https://github.com/hrshdhgd/ontobot-change-agent.git - name: Run ochange id: ochange @@ -61,11 +64,10 @@ jobs: ochange process-issue ${{ env.resource }} \ -r ${{ steps.gh-script-repo.outputs.result }} \ -n ${{ steps.gh-script-issue.outputs.result }} \ - -g ${{ secrets.GH_TOKEN }} \ - -j kgcl-robot.jar + -g ${{ secrets.GH_TOKEN }} - name: Clean-up - run: rm -f kgcl-robot.jar + run: rm -rf robot-plugins - name: Create Pull Request uses: peter-evans/create-pull-request@v5 From 191c33afd1f5e0c88de51320b3e479cba9e4c59e Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Thu, 2 Nov 2023 11:45:54 -0500 Subject: [PATCH 12/13] update ODK version --- .github/workflows/ontobot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml index b4a9e9324..b6f68fe49 100644 --- a/.github/workflows/ontobot.yml +++ b/.github/workflows/ontobot.yml @@ -8,7 +8,7 @@ on: jobs: build: runs-on: ${{ matrix.os }} - container: obolibrary/odkfull:v1.4.1 + container: obolibrary/odkfull:v1.4.3 strategy: matrix: python-version: ["3.9"] From 52cfb6ce43a99fc9580054fa0dc472ea60ac21c2 Mon Sep 17 00:00:00 2001 From: Harshad Hegde Date: Thu, 2 Nov 2023 11:54:17 -0500 Subject: [PATCH 13/13] install package rather than github repo --- .github/workflows/ontobot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ontobot.yml b/.github/workflows/ontobot.yml index b6f68fe49..0ea039a1c 100644 --- a/.github/workflows/ontobot.yml +++ b/.github/workflows/ontobot.yml @@ -56,7 +56,7 @@ jobs: - name: Install dependencies run: | - pip install git+https://github.com/hrshdhgd/ontobot-change-agent.git + pip install ontobot-change-agent - name: Run ochange id: ochange