From b234f77b843cd1c95c18c95a8e5bf1b35c4e3c52 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 15:12:09 +0100 Subject: [PATCH 01/22] Extend on the redjudging overview Added the individual judging runs to it, still to be done is the testcase output --- webapp/src/Controller/Jury/RejudgingController.php | 11 ++++++----- webapp/templates/jury/rejudging.html.twig | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/webapp/src/Controller/Jury/RejudgingController.php b/webapp/src/Controller/Jury/RejudgingController.php index f650586c64..3a38cbe9d6 100644 --- a/webapp/src/Controller/Jury/RejudgingController.php +++ b/webapp/src/Controller/Jury/RejudgingController.php @@ -708,7 +708,7 @@ private function getStats(Rejudging $rejudging): array ->leftJoin('j.rejudging', 'r') ->leftJoin('j.submission', 's') ->leftJoin('j.judgehost', 'jh') - ->select('j.judgingid', 's.submitid', 'jh.hostname', 'j.result', + ->select('r.rejudgingid, j.judgingid', 's.submitid', 'jh.hostname', 'j.result', 'AVG(jr.runtime) AS runtime_avg', 'COUNT(jr.runtime) AS ntestcases', '(j.endtime - j.starttime) AS duration' ) @@ -812,19 +812,19 @@ function ($a, $b) { 'count' => count($submissions[$submitid]), 'verdict' => ( !array_key_exists($submitid, $submissions_to_result) - ? '*multiple*' + ? join(', ', $results) : $submissions_to_result[$submitid] ) ]; } $judgehost_stats = []; - foreach ($judgehosts as $judgehost => $judgings) { + foreach ($judgehosts as $judgehost => $host_judgings) { $totaltime = 0.0; // Actual time begin--end of judging $totalrun = 0.0; // Time spent judging runs $sumsquare = 0.0; $njudged = 0; - foreach ($judgings as $judging) { + foreach ($host_judgings as $judging) { $runtime = $judging['runtime_avg']*$judging['ntestcases']; $totaltime += $judging['duration']; $totalrun += $runtime; @@ -849,7 +849,8 @@ function ($a, $b) { 'judging_runs_differ' => array_slice($judging_runs_differ, 0, $max_list_len), 'judging_runs_differ_overflow' => count($judging_runs_differ) - $max_list_len, 'runtime_spread' => $runtime_spread_list, - 'judgehost_stats' => $judgehost_stats + 'judgehost_stats' => $judgehost_stats, + 'judgings' => $judgings ]; } } diff --git a/webapp/templates/jury/rejudging.html.twig b/webapp/templates/jury/rejudging.html.twig index a0d37bc618..844ab00e23 100644 --- a/webapp/templates/jury/rejudging.html.twig +++ b/webapp/templates/jury/rejudging.html.twig @@ -148,6 +148,20 @@ {% endfor %} + +

Judging verdicts

+ + + {% for judging in stats.judgings %} + + + + + + + + {% endfor %} +
jIDrIDJudgehostruntimeverdict
{{ judging.judgingid }}{{ judging.rejudgingid }}{{ judging.hostname }}{{ judging.duration | number_format(3) }}{{ judging.result | printResult }}
{% endif %} {% endif %} From fb3c6872c45a9a2be59f4cc08446f5fbdfdccf38 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 19:13:14 +0100 Subject: [PATCH 02/22] first trigger --- .github/workflows/comment_pr.yml | 27 +++++++++++++++++++ .../submission_testcase_boxes.html.twig | 0 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/comment_pr.yml create mode 100644 webapp/templates/jury/partials/submission_testcase_boxes.html.twig diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml new file mode 100644 index 0000000000..53cc19607f --- /dev/null +++ b/.github/workflows/comment_pr.yml @@ -0,0 +1,27 @@ +name: Comment on PR + +on: [push] + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + name: + # Friendly description to be shown in the UI instead of 'name' + description: 'Person to greet' + # Default value if no value is explicitly provided + default: 'World' + # Input has to be provided for the workflow to run + required: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "greet" + greet: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Runs a single command using the runners shell + - name: Send greeting + run: echo "Hello ${{ github.event.inputs.name }}" + diff --git a/webapp/templates/jury/partials/submission_testcase_boxes.html.twig b/webapp/templates/jury/partials/submission_testcase_boxes.html.twig new file mode 100644 index 0000000000..e69de29bb2 From 77353649046dce7a8da75be5ab286cc422e4a833 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 19:15:43 +0100 Subject: [PATCH 03/22] cleanup --- .github/workflows/comment_pr.yml | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index 53cc19607f..b692dbc5f3 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -1,27 +1,15 @@ name: Comment on PR -on: [push] - workflow_dispatch: - # Inputs the workflow accepts. - inputs: - name: - # Friendly description to be shown in the UI instead of 'name' - description: 'Person to greet' - # Default value if no value is explicitly provided - default: 'World' - # Input has to be provided for the workflow to run - required: true +on: pull_request -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "greet" - greet: - # The type of runner that the job will run on + diff: runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Runs a single command using the runners shell - - name: Send greeting - run: echo "Hello ${{ github.event.inputs.name }}" - + - uses: actions/github-script@v3 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const diff_url = context.payload.pull_request.diff_url + const result = await github.request(diff_url) + console.log(result) From c0986cf77c231c48788117799b77f1312b07e838 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 19:20:58 +0100 Subject: [PATCH 04/22] Go --- .github/workflows/comment_pr.yml | 2 + .idea/.gitignore | 8 + .idea/domjudge.iml | 170 +++++++++++++++++ .idea/inspectionProfiles/Project_Default.xml | 7 + .idea/jsLinters/jshint.xml | 16 ++ .idea/modules.xml | 8 + .idea/php.xml | 181 +++++++++++++++++++ .idea/vcs.xml | 6 + 8 files changed, 398 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/domjudge.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/jsLinters/jshint.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/php.xml create mode 100644 .idea/vcs.xml diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index b692dbc5f3..df49ef510a 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -13,3 +13,5 @@ jobs: const diff_url = context.payload.pull_request.diff_url const result = await github.request(diff_url) console.log(result) + console.log(context.payload) + console.log(context.payload.pull_request) diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000..73f69e0958 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/domjudge.iml b/.idea/domjudge.iml new file mode 100644 index 0000000000..9a6b8a68ad --- /dev/null +++ b/.idea/domjudge.iml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000..c73d2199e9 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/.idea/jsLinters/jshint.xml b/.idea/jsLinters/jshint.xml new file mode 100644 index 0000000000..d7c6485fe8 --- /dev/null +++ b/.idea/jsLinters/jshint.xml @@ -0,0 +1,16 @@ + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000..d4a949c3dd --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/php.xml b/.idea/php.xml new file mode 100644 index 0000000000..2aa5f557b2 --- /dev/null +++ b/.idea/php.xml @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..94a25f7f4c --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file From 116fcb5544afccdc3ccd05616ddccc7ee385710a Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 19:24:43 +0100 Subject: [PATCH 05/22] go --- .github/workflows/comment_pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index df49ef510a..6a93ffcedb 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -10,8 +10,8 @@ jobs: with: github-token: ${{secrets.GITHUB_TOKEN}} script: | - const diff_url = context.payload.pull_request.diff_url - const result = await github.request(diff_url) - console.log(result) + #const diff_url = context.payload.pull_request.diff_url + #const result = await github.request(diff_url) + #console.log(result) console.log(context.payload) console.log(context.payload.pull_request) From 56f1e402352a84ecda1e9a4d70dbc037740e02fd Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 19:28:23 +0100 Subject: [PATCH 06/22] wait for the result --- .github/workflows/comment_pr.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index 6a93ffcedb..349cb58081 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -13,5 +13,6 @@ jobs: #const diff_url = context.payload.pull_request.diff_url #const result = await github.request(diff_url) #console.log(result) - console.log(context.payload) - console.log(context.payload.pull_request) + const pay = context.payload + console.log(pay) + # console.log(context.payload.pull_request) From e38c79222e3caef53864f294188e7ca3287f2429 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 19:43:08 +0100 Subject: [PATCH 07/22] gogo --- .github/workflows/comment_pr.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index 349cb58081..c64791eef7 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -10,9 +10,16 @@ jobs: with: github-token: ${{secrets.GITHUB_TOKEN}} script: | - #const diff_url = context.payload.pull_request.diff_url - #const result = await github.request(diff_url) - #console.log(result) - const pay = context.payload - console.log(pay) - # console.log(context.payload.pull_request) + context.pulls.createReview({ + pull_number: 14, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'thanks' + event: 'REQUEST_CHANGES' + comments: [ + { + path: gitlab/workflows/comment_pr.yml, + line: 1, + body: 'thanks' + } + }) From 4ec5fdfcd7439a540e42503a661e1dfb7357e184 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 19:44:42 +0100 Subject: [PATCH 08/22] gogogo --- .github/workflows/comment_pr.yml | 42 +++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index c64791eef7..4ce066474f 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -3,23 +3,43 @@ name: Comment on PR on: pull_request jobs: - diff: + welcome: runs-on: ubuntu-latest steps: - uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | - context.pulls.createReview({ + await context.pulls.createReview({ pull_number: 14, owner: context.repo.owner, repo: context.repo.repo, - body: 'thanks' - event: 'REQUEST_CHANGES' - comments: [ - { - path: gitlab/workflows/comment_pr.yml, - line: 1, - body: 'thanks' - } - }) + } + + + // Get a list of all issues created by the PR opener + // See: https://octokit.github.io/rest.js/#pagination + //const creator = context.payload.sender.login + //const opts = github.issues.listForRepo.endpoint.merge({ + // ...context.issue, + // creator, + // state: 'all' + //}) + //const issues = await github.paginate(opts) + + //for (const issue of issues) { + // if (issue.number === context.issue.number) { + // continue + // } + + // if (issue.pull_request) { + // return // Creator is already a contributor. + // } + //} + + //await github.issues.createComment({ + // issue_number: context.issue.number, + // owner: context.repo.owner, + // repo: context.repo.repo, + // body: 'Welcome, new contributor!' + //}) From 38735a33260ed1c0849e8aac0cd095020689da0d Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 20:16:56 +0100 Subject: [PATCH 09/22] new try --- .github/workflows/comment_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index 4ce066474f..49031f046e 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -14,7 +14,7 @@ jobs: pull_number: 14, owner: context.repo.owner, repo: context.repo.repo, - } + }) // Get a list of all issues created by the PR opener From 6a04858c79a2cc0f160bae2ced8317b9556acf18 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 20:20:35 +0100 Subject: [PATCH 10/22] new try --- .github/workflows/comment_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index 49031f046e..3af2bbb9bb 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -10,7 +10,7 @@ jobs: with: github-token: ${{secrets.GITHUB_TOKEN}} script: | - await context.pulls.createReview({ + await github.pulls.createReview({ pull_number: 14, owner: context.repo.owner, repo: context.repo.repo, From 7c169e4af2316747a18292b66024dd69e6755643 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 20:26:06 +0100 Subject: [PATCH 11/22] new try --- .github/workflows/comment_pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index 3af2bbb9bb..f420ee733e 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -15,6 +15,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, }) + console.log(context.repo) // Get a list of all issues created by the PR opener From be17a65b614ba5d3af6c44854f35ce5875dd809e Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 20:29:54 +0100 Subject: [PATCH 12/22] new try --- .github/workflows/comment_pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index f420ee733e..a152306752 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -14,6 +14,7 @@ jobs: pull_number: 14, owner: context.repo.owner, repo: context.repo.repo, + body: "yes" }) console.log(context.repo) From 876e3df278e8231641ce51ddd2b30e3d4fa3e53f Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 20:38:11 +0100 Subject: [PATCH 13/22] new try --- .github/workflows/comment_pr.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index a152306752..e933eda69f 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -10,6 +10,11 @@ jobs: with: github-token: ${{secrets.GITHUB_TOKEN}} script: | + await github.pulls.listFiles({ + pull_number: 14, + owner: context.repo.owner, + repo: context.repo.repo, + }); await github.pulls.createReview({ pull_number: 14, owner: context.repo.owner, From 03a2a8786a745e3d051743dfbaa62d17e9e89c7c Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 20:40:38 +0100 Subject: [PATCH 14/22] new try --- .github/workflows/comment_pr.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index e933eda69f..be981e286d 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -15,6 +15,11 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, }); + await github.pulls.listReviews({ + pull_number: 14, + owner: context.repo.owner, + repo: context.repo.repo, + }); await github.pulls.createReview({ pull_number: 14, owner: context.repo.owner, From 13ef4a590562c447528d24f1291ea44e891f8042 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 21:00:59 +0100 Subject: [PATCH 15/22] new try --- .github/workflows/comment_pr.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index be981e286d..2fb1e0a6bf 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -20,12 +20,12 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, }); - await github.pulls.createReview({ - pull_number: 14, - owner: context.repo.owner, - repo: context.repo.repo, - body: "yes" - }) + #await github.pulls.createReview({ + # pull_number: 14, + # owner: context.repo.owner, + # repo: context.repo.repo, + # body: "yes" + #}) console.log(context.repo) From 1c4feb5930043faba941f2be3becbf56208dbf51 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 21:07:25 +0100 Subject: [PATCH 16/22] Update comment_pr.yml --- .github/workflows/comment_pr.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index 2fb1e0a6bf..d695ef4944 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -20,12 +20,12 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, }); - #await github.pulls.createReview({ - # pull_number: 14, - # owner: context.repo.owner, - # repo: context.repo.repo, - # body: "yes" - #}) + //await github.pulls.createReview({ + // pull_number: 14, + // owner: context.repo.owner, + // repo: context.repo.repo, + // body: "yes" + //}) console.log(context.repo) From c9501e80d78c52f65a5b1e7b34931fda2924da8c Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 21:12:14 +0100 Subject: [PATCH 17/22] Update comment_pr.yml --- .github/workflows/comment_pr.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index d695ef4944..55edd0b8eb 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -10,12 +10,12 @@ jobs: with: github-token: ${{secrets.GITHUB_TOKEN}} script: | - await github.pulls.listFiles({ + var a = await github.pulls.listFiles({ pull_number: 14, owner: context.repo.owner, repo: context.repo.repo, }); - await github.pulls.listReviews({ + var b = await github.pulls.listReviews({ pull_number: 14, owner: context.repo.owner, repo: context.repo.repo, @@ -27,6 +27,10 @@ jobs: // body: "yes" //}) console.log(context.repo) + console.log(context) + console.log(github) + console.log(a) + console.log(b) // Get a list of all issues created by the PR opener From d4d9c7613d32af899e67a55ce0f06d4e92dc62af Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 21:24:43 +0100 Subject: [PATCH 18/22] Update comment_pr.yml --- .github/workflows/comment_pr.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index 55edd0b8eb..e269cf4291 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -11,17 +11,17 @@ jobs: github-token: ${{secrets.GITHUB_TOKEN}} script: | var a = await github.pulls.listFiles({ - pull_number: 14, + pull_number: context.payload.number, owner: context.repo.owner, repo: context.repo.repo, }); var b = await github.pulls.listReviews({ - pull_number: 14, + pull_number: context.payload.number, owner: context.repo.owner, repo: context.repo.repo, }); //await github.pulls.createReview({ - // pull_number: 14, + // pull_number: context.payload.number, // owner: context.repo.owner, // repo: context.repo.repo, // body: "yes" From adafdc8e108f5c209ae2c9f59fbc252fc1eab174 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 22:40:32 +0100 Subject: [PATCH 19/22] Update comment_pr.yml --- .github/workflows/comment_pr.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index e269cf4291..f32da16dbe 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -26,11 +26,14 @@ jobs: // repo: context.repo.repo, // body: "yes" //}) - console.log(context.repo) - console.log(context) - console.log(github) - console.log(a) - console.log(b) + //console.log(context.repo) + //console.log(context) + //console.log(github) + //console.log(a) + b.forEach(function(entry) { + console.log(entry.user); + }); + //console.log(b) // Get a list of all issues created by the PR opener From 4debe361dd6da54b15e6642ea791efdbaeaa64c8 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 22:43:41 +0100 Subject: [PATCH 20/22] Update comment_pr.yml --- .github/workflows/comment_pr.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index f32da16dbe..b65800640b 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -30,9 +30,13 @@ jobs: //console.log(context) //console.log(github) //console.log(a) - b.forEach(function(entry) { - console.log(entry.user); - }); + for (index = 0; index < b.length; ++index) { + console.log(b[index]); + console.log(b[index].user); + } + //b.forEach(function(entry) { + // console.log(entry.user); + //}); //console.log(b) From a9870e967b2bf48242ad67254aebb4d5a1dda103 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 22:45:09 +0100 Subject: [PATCH 21/22] Update comment_pr.yml --- .github/workflows/comment_pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index b65800640b..992369e4a0 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -37,7 +37,7 @@ jobs: //b.forEach(function(entry) { // console.log(entry.user); //}); - //console.log(b) + console.log(b) // Get a list of all issues created by the PR opener From 9a30eaecf8f7e8f939915f0a7228a61635652df7 Mon Sep 17 00:00:00 2001 From: MCJ Vasseur <14887731+mvr320@users.noreply.github.com> Date: Sat, 27 Mar 2021 22:46:29 +0100 Subject: [PATCH 22/22] Update comment_pr.yml --- .github/workflows/comment_pr.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/comment_pr.yml b/.github/workflows/comment_pr.yml index 992369e4a0..34949da5d1 100644 --- a/.github/workflows/comment_pr.yml +++ b/.github/workflows/comment_pr.yml @@ -15,11 +15,12 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, }); - var b = await github.pulls.listReviews({ + var bt = await github.pulls.listReviews({ pull_number: context.payload.number, owner: context.repo.owner, repo: context.repo.repo, }); + var b = bt.data //await github.pulls.createReview({ // pull_number: context.payload.number, // owner: context.repo.owner,