From bb5e56a8f83fb76950791c843572306a86f124f6 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 16 Dec 2022 17:24:11 +0000 Subject: [PATCH 01/28] github/submodule-update: Needs an 'else' to actually work * Somehow this had been left in a state where it would always signal "no changes". --- .github/workflows/submodule-update.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 8ed83d31..11082721 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -33,12 +33,14 @@ jobs: continue-on-error: true run: | changes=$(git status --porcelain) + git status --porcelain if [ -n "${changes}" ]; then echo '::set-output changes=true' + else + echo '::set-output changes=false' + exit 0 fi - echo '::set-output changes=false' - exit 0 - name: Create submodules changes branch if: steps.check_for_changes.outputs.changes == 'true' From e1199ee3ff650732ba4dfded64c3e52ddc12d47d Mon Sep 17 00:00:00 2001 From: Athanasius Date: Fri, 16 Dec 2022 17:27:13 +0000 Subject: [PATCH 02/28] github/submodule-update: Ensure `exit 0` on the update check I *think* the `exit 0` is to ensure the 'Check for changes' isn't considered failed due to `git` exit code. --- .github/workflows/submodule-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 11082721..692de46a 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -39,8 +39,8 @@ jobs: echo '::set-output changes=true' else echo '::set-output changes=false' - exit 0 fi + exit 0 - name: Create submodules changes branch if: steps.check_for_changes.outputs.changes == 'true' From 34572336cb3159a63f5a4fe7c1d82f08ec956b8a Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 09:34:33 +0000 Subject: [PATCH 03/28] github/submodule-update: steps.check_for_changes condition not working * Now I'm guessing at what the syntax needs to be, but the bare `steps.check_for_changes.outputs.changes` results in it being considerd `null` for the check. --- .github/workflows/submodule-update.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 692de46a..d5f907bd 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -43,14 +43,14 @@ jobs: exit 0 - name: Create submodules changes branch - if: steps.check_for_changes.outputs.changes == 'true' + if: ${{ steps.check_for_changes.outputs.changes }} == 'true' run: | git checkout -b $GITHUB_RUN_ID git commit -am "updating submodules" git push --set-upstream origin $GITHUB_RUN_ID - name: Create pull request against target branch - if: steps.check_for_changes.outputs.changes == 'true' + if: ${{ steps.check_for_changes.outputs.changes }} == 'true' uses: actions/github-script@v6 with: github-token: ${{ inputs.github_token }} @@ -65,7 +65,7 @@ jobs: }); - name: Add labels - if: steps.check_for_changes.outputs.changes == 'true' + if: ${{ steps.check_for_changes.outputs.changes }} == 'true' uses: actions/github-script@v6 with: github-token: ${{ inputs.github_token }} From fda81a0bb7316ffae93d87c35472d54106793047 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 09:42:22 +0000 Subject: [PATCH 04/28] github/submodule-update: Switch to 'environment' style As per --- .github/workflows/submodule-update.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index d5f907bd..9def9e0f 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -36,21 +36,21 @@ jobs: git status --porcelain if [ -n "${changes}" ]; then - echo '::set-output changes=true' + echo 'changes=true' >> $GITHUB_OUTPUT else - echo '::set-output changes=false' + echo 'changes=false' >> $GITHUB_OUTPUT fi exit 0 - name: Create submodules changes branch - if: ${{ steps.check_for_changes.outputs.changes }} == 'true' + if: steps.check_for_changes.outputs.changes == 'true' run: | git checkout -b $GITHUB_RUN_ID git commit -am "updating submodules" git push --set-upstream origin $GITHUB_RUN_ID - name: Create pull request against target branch - if: ${{ steps.check_for_changes.outputs.changes }} == 'true' + if: steps.check_for_changes.outputs.changes == 'true' uses: actions/github-script@v6 with: github-token: ${{ inputs.github_token }} @@ -65,7 +65,7 @@ jobs: }); - name: Add labels - if: ${{ steps.check_for_changes.outputs.changes }} == 'true' + if: steps.check_for_changes.outputs.changes == 'true' uses: actions/github-script@v6 with: github-token: ${{ inputs.github_token }} From 845add163258f8e32b6ce74e09c436a7c68afeaa Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 09:48:21 +0000 Subject: [PATCH 05/28] github/submodule-update: Change to `secrets.GITHUB_TOKEN` That works in the windows-build.yml workflow. --- .github/workflows/submodule-update.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 9def9e0f..451793b6 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -53,7 +53,7 @@ jobs: if: steps.check_for_changes.outputs.changes == 'true' uses: actions/github-script@v6 with: - github-token: ${{ inputs.github_token }} + github-token: "${{ secrets.GITHUB_TOKEN }}" script: | await github.rest.pulls.create({ owner: '${{ inputs.owner }}', @@ -68,7 +68,7 @@ jobs: if: steps.check_for_changes.outputs.changes == 'true' uses: actions/github-script@v6 with: - github-token: ${{ inputs.github_token }} + github-token: "${{ secrets.GITHUB_TOKEN }}" script: | const res = await github.rest.issues.listForRepo({ owner: '${{ inputs.owner }}', From 188581794722883d9390bea1907563867312bfa4 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 09:56:40 +0000 Subject: [PATCH 06/28] github/submodule-update: Switch to `process.env` for owner, repo, base --- .github/workflows/submodule-update.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 451793b6..d3cc2fb2 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -56,10 +56,10 @@ jobs: github-token: "${{ secrets.GITHUB_TOKEN }}" script: | await github.rest.pulls.create({ - owner: '${{ inputs.owner }}', - repo: '${{ inputs.parent_repository }}'.split('/')[1].trim(), + owner: '${{ process.env.OWNER }}', + repo: '${{ process.env.PARENT_REPOSITORY }}'.split('/')[1].trim(), head: process.env.GITHUB_RUN_ID, - base: '${{ inputs.pr_against_branch }}', + base: '${{ process.env.PR_AGAINST_BRANCH }}', title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, body: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, }); @@ -71,14 +71,14 @@ jobs: github-token: "${{ secrets.GITHUB_TOKEN }}" script: | const res = await github.rest.issues.listForRepo({ - owner: '${{ inputs.owner }}', - repo: '${{ inputs.parent_repository }}'.split('/')[1].trim(), + owner: '${{ process.env.OWNER }}', + repo: '${{ process.env.PARENT_REPOSITORY }}'.split('/')[1].trim(), }); const pr = res.data.filter(i => i.title.includes(process.env.GITHUB_RUN_ID)); const prNumber = pr[0].number; await github.rest.issues.addLabels({ issue_number: prNumber, - owner: '${{ inputs.owner }}', - repo: '${{ inputs.parent_repository }}'.split('/')[1].trim(), + owner: '${{ process.env.OWNER }}', + repo: '${{ process.env.PARENT_REPOSITORY }}'.split('/')[1].trim(), labels: ['${{ inputs.label }}'] }); From 7df4db50a9fc6d780d75bc9698425ad072c0ae65 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 09:59:17 +0000 Subject: [PATCH 07/28] github/submodule-update: Fix process.env syntax ? --- .github/workflows/submodule-update.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index d3cc2fb2..ac1823e4 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -56,10 +56,10 @@ jobs: github-token: "${{ secrets.GITHUB_TOKEN }}" script: | await github.rest.pulls.create({ - owner: '${{ process.env.OWNER }}', - repo: '${{ process.env.PARENT_REPOSITORY }}'.split('/')[1].trim(), + owner: '${process.env.OWNER}', + repo: '${process.env.PARENT_REPOSITORY}'.split('/')[1].trim(), head: process.env.GITHUB_RUN_ID, - base: '${{ process.env.PR_AGAINST_BRANCH }}', + base: '${process.env.PR_AGAINST_BRANCH}', title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, body: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, }); @@ -71,14 +71,14 @@ jobs: github-token: "${{ secrets.GITHUB_TOKEN }}" script: | const res = await github.rest.issues.listForRepo({ - owner: '${{ process.env.OWNER }}', - repo: '${{ process.env.PARENT_REPOSITORY }}'.split('/')[1].trim(), + owner: '${process.env.OWNER}', + repo: '${process.env.PARENT_REPOSITORY}'.split('/')[1].trim(), }); const pr = res.data.filter(i => i.title.includes(process.env.GITHUB_RUN_ID)); const prNumber = pr[0].number; await github.rest.issues.addLabels({ issue_number: prNumber, - owner: '${{ process.env.OWNER }}', - repo: '${{ process.env.PARENT_REPOSITORY }}'.split('/')[1].trim(), + owner: '${process.env.OWNER}', + repo: '${process.env.PARENT_REPOSITORY}'.split('/')[1].trim(), labels: ['${{ inputs.label }}'] }); From c6c1f40429aaab817004e3e58b8e2586b3584ba0 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 11:14:18 +0000 Subject: [PATCH 08/28] github/submodule-update: Let's try `github` contexts --- .github/workflows/submodule-update.yml | 42 +++++++++++++------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index ac1823e4..b47812ca 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -56,29 +56,29 @@ jobs: github-token: "${{ secrets.GITHUB_TOKEN }}" script: | await github.rest.pulls.create({ - owner: '${process.env.OWNER}', - repo: '${process.env.PARENT_REPOSITORY}'.split('/')[1].trim(), + owner: '${{ github.repository_owner }}', + repo: '${{ github.repository }}'.split('/')[1].trim(), head: process.env.GITHUB_RUN_ID, - base: '${process.env.PR_AGAINST_BRANCH}', + base: '${{ github.ref }}', title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, body: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, }); - - name: Add labels - if: steps.check_for_changes.outputs.changes == 'true' - uses: actions/github-script@v6 - with: - github-token: "${{ secrets.GITHUB_TOKEN }}" - script: | - const res = await github.rest.issues.listForRepo({ - owner: '${process.env.OWNER}', - repo: '${process.env.PARENT_REPOSITORY}'.split('/')[1].trim(), - }); - const pr = res.data.filter(i => i.title.includes(process.env.GITHUB_RUN_ID)); - const prNumber = pr[0].number; - await github.rest.issues.addLabels({ - issue_number: prNumber, - owner: '${process.env.OWNER}', - repo: '${process.env.PARENT_REPOSITORY}'.split('/')[1].trim(), - labels: ['${{ inputs.label }}'] - }); +# - name: Add labels +# if: steps.check_for_changes.outputs.changes == 'true' +# uses: actions/github-script@v6 +# with: +# github-token: "${{ secrets.GITHUB_TOKEN }}" +# script: | +# const res = await github.rest.issues.listForRepo({ +# owner: '${{ github.repository_owner }}', +# repo: '${{ github.repository }}'.split('/')[1].trim(), +# }); +# const pr = res.data.filter(i => i.title.includes(process.env.GITHUB_RUN_ID)); +# const prNumber = pr[0].number; +# await github.rest.issues.addLabels({ +# issue_number: prNumber, +# owner: '${{ github.repository_owner }}', +# repo: '${{ github.repository }}'.split('/')[1].trim(), +# labels: ['${{ inputs.label }}'] +# }); From 056023bbbf9a8b4c3c83442d0daf6f02c7aaabc6 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 11:21:03 +0000 Subject: [PATCH 09/28] github/submodule-update: Try to use `git status` output in PR body --- .github/workflows/submodule-update.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index b47812ca..3d0b5d57 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -37,6 +37,7 @@ jobs: if [ -n "${changes}" ]; then echo 'changes=true' >> $GITHUB_OUTPUT + echo "changes_text=${changes}" >> $GITHUB_OUTPUT else echo 'changes=false' >> $GITHUB_OUTPUT fi @@ -61,7 +62,7 @@ jobs: head: process.env.GITHUB_RUN_ID, base: '${{ github.ref }}', title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, - body: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, + body: '${{ steps.check_for_changes.outputs.changes_text }}', }); # - name: Add labels From 418780106845547244e877a8ba29110a655de719 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 11:25:16 +0000 Subject: [PATCH 10/28] github/submodule-update: Make better branch names --- .github/workflows/submodule-update.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 3d0b5d57..407f567d 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -46,9 +46,9 @@ jobs: - name: Create submodules changes branch if: steps.check_for_changes.outputs.changes == 'true' run: | - git checkout -b $GITHUB_RUN_ID + git checkout -b "submodule-change/$GITHUB_RUN_ID" git commit -am "updating submodules" - git push --set-upstream origin $GITHUB_RUN_ID + git push --set-upstream origin "submodule-change/$GITHUB_RUN_ID" - name: Create pull request against target branch if: steps.check_for_changes.outputs.changes == 'true' @@ -59,7 +59,7 @@ jobs: await github.rest.pulls.create({ owner: '${{ github.repository_owner }}', repo: '${{ github.repository }}'.split('/')[1].trim(), - head: process.env.GITHUB_RUN_ID, + head: 'submodule-change/${{ github.run_id }}', base: '${{ github.ref }}', title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, body: '${{ steps.check_for_changes.outputs.changes_text }}', From 13ac29bc9b891b4ebaaac5cb849d1640927f91b0 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 11:26:51 +0000 Subject: [PATCH 11/28] github/submodule-update: Remove unused 'Add labels' step 1. This was commented out. 2. It's not necessarily up to date with what *works*, so just delete it. --- .github/workflows/submodule-update.yml | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 407f567d..9af87368 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -64,22 +64,3 @@ jobs: title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, body: '${{ steps.check_for_changes.outputs.changes_text }}', }); - -# - name: Add labels -# if: steps.check_for_changes.outputs.changes == 'true' -# uses: actions/github-script@v6 -# with: -# github-token: "${{ secrets.GITHUB_TOKEN }}" -# script: | -# const res = await github.rest.issues.listForRepo({ -# owner: '${{ github.repository_owner }}', -# repo: '${{ github.repository }}'.split('/')[1].trim(), -# }); -# const pr = res.data.filter(i => i.title.includes(process.env.GITHUB_RUN_ID)); -# const prNumber = pr[0].number; -# await github.rest.issues.addLabels({ -# issue_number: prNumber, -# owner: '${{ github.repository_owner }}', -# repo: '${{ github.repository }}'.split('/')[1].trim(), -# labels: ['${{ inputs.label }}'] -# }); From 2cc0eaf40a27a2fc07c4be2f426214c0f245555c Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 11:30:56 +0000 Subject: [PATCH 12/28] github/submodule-update: Run every day at mid-day. --- .github/workflows/submodule-update.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 9af87368..691e250e 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -2,9 +2,8 @@ name: Submodule Updates on: - # We might want this on a schedule once this is in `main` - push: - branches: [ develop ] + schedule: + - cron: '00 12 * * *' jobs: check_submodules: From ee1c739ee15208980ea0554e9b172b614ec18869 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 12:04:51 +0000 Subject: [PATCH 13/28] github/submodule-update: Run *every* hour for test purposes --- .github/workflows/submodule-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 691e250e..38f23f3f 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -3,7 +3,7 @@ name: Submodule Updates on: schedule: - - cron: '00 12 * * *' + - cron: '10 * * * *' jobs: check_submodules: From 0382dde5cafc9bdf6530a8dff09abf100d7510d2 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 12:40:35 +0000 Subject: [PATCH 14/28] Revert "github/submodule-update: Run *every* hour for test purposes" This reverts commit ee1c739ee15208980ea0554e9b172b614ec18869. --- .github/workflows/submodule-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 38f23f3f..691e250e 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -3,7 +3,7 @@ name: Submodule Updates on: schedule: - - cron: '10 * * * *' + - cron: '00 12 * * *' jobs: check_submodules: From 38c62bb1be88b255078d0e726c6d9e0133366594 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 12:40:48 +0000 Subject: [PATCH 15/28] github/submodule-update: Use single `0` in cron spec Just in case that `00` was the issue. It ran fine with `10 * * * *`. --- .github/workflows/submodule-update.yml | 2 +- FDevIDs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 691e250e..85f45ff0 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -3,7 +3,7 @@ name: Submodule Updates on: schedule: - - cron: '00 12 * * *' + - cron: '0 12 * * *' jobs: check_submodules: diff --git a/FDevIDs b/FDevIDs index 3fd5d202..726fb916 160000 --- a/FDevIDs +++ b/FDevIDs @@ -1 +1 @@ -Subproject commit 3fd5d202e529c52748b1e9b94433262810f6e295 +Subproject commit 726fb91654edb020491e57ce8c07041296645cd0 From 1e1641f6e38800b16b1f02a4e384f8b469c305a7 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 12:48:29 +0000 Subject: [PATCH 16/28] github/submodule-update: Move back to using our defined `env` We need to run against `develop`, even when on `main` using a cron, so actually use the environment vars we define. --- .github/workflows/submodule-update.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 85f45ff0..79819a67 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -25,6 +25,7 @@ jobs: run: | git config user.name github-actions git config user.email github-actions@github.com + git checkout $CHECKOUT_BRANCH git submodule update --remote - name: Check for changes @@ -45,7 +46,7 @@ jobs: - name: Create submodules changes branch if: steps.check_for_changes.outputs.changes == 'true' run: | - git checkout -b "submodule-change/$GITHUB_RUN_ID" + git checkout -b "submodule-change/$GITHUB_RUN_ID" $CHECKOUT_BRANCH git commit -am "updating submodules" git push --set-upstream origin "submodule-change/$GITHUB_RUN_ID" @@ -59,7 +60,7 @@ jobs: owner: '${{ github.repository_owner }}', repo: '${{ github.repository }}'.split('/')[1].trim(), head: 'submodule-change/${{ github.run_id }}', - base: '${{ github.ref }}', + base: '$PR_AGAINST_BRANCH', title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, body: '${{ steps.check_for_changes.outputs.changes_text }}', }); From 682dd391f486ca42e29ee3344f6f7448195f7715 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 12:50:48 +0000 Subject: [PATCH 17/28] github/submodule-update: Also run on `develop` pushes --- .github/workflows/submodule-update.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 79819a67..16bc5511 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -2,6 +2,8 @@ name: Submodule Updates on: + push: + branches: [ develop ] schedule: - cron: '0 12 * * *' From c56abcef5db2a24682cff7d297dc24eba2911456 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 12:53:38 +0000 Subject: [PATCH 18/28] FDevIDs: reset back to before recent commits for workflow testing --- FDevIDs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FDevIDs b/FDevIDs index 726fb916..3fd5d202 160000 --- a/FDevIDs +++ b/FDevIDs @@ -1 +1 @@ -Subproject commit 726fb91654edb020491e57ce8c07041296645cd0 +Subproject commit 3fd5d202e529c52748b1e9b94433262810f6e295 From 32ed770ebb1cf7d3f3337bc932f46c0d09f51c84 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 12:56:11 +0000 Subject: [PATCH 19/28] github/submodule-update: Tweak reference to PR_AGAINST_BRANCH --- .github/workflows/submodule-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 16bc5511..1ce2c214 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -62,7 +62,7 @@ jobs: owner: '${{ github.repository_owner }}', repo: '${{ github.repository }}'.split('/')[1].trim(), head: 'submodule-change/${{ github.run_id }}', - base: '$PR_AGAINST_BRANCH', + base: '${ process.env.PR_AGAINST_BRANCH }', title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, body: '${{ steps.check_for_changes.outputs.changes_text }}', }); From fbfdb381073446974a1a0b654e28d7ceb83f28e2 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sat, 17 Dec 2022 12:59:20 +0000 Subject: [PATCH 20/28] github/submodule-update: Reference `env` as a context thing. --- .github/workflows/submodule-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index 1ce2c214..f3c6cfa7 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -62,7 +62,7 @@ jobs: owner: '${{ github.repository_owner }}', repo: '${{ github.repository }}'.split('/')[1].trim(), head: 'submodule-change/${{ github.run_id }}', - base: '${ process.env.PR_AGAINST_BRANCH }', + base: '${{ env.PR_AGAINST_BRANCH }}', title: `[Auto-generated] Submodule Updates ${process.env.GITHUB_RUN_ID}`, body: '${{ steps.check_for_changes.outputs.changes_text }}', }); From 736a6a5a8355efe94ae5689f9deb01c50285a123 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sun, 18 Dec 2022 13:10:45 +0000 Subject: [PATCH 21/28] github/submodule-update: Direct actions/checkout to use `develop` --- .github/workflows/submodule-update.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/submodule-update.yml b/.github/workflows/submodule-update.yml index f3c6cfa7..3ea6f67c 100644 --- a/.github/workflows/submodule-update.yml +++ b/.github/workflows/submodule-update.yml @@ -20,6 +20,7 @@ jobs: steps: - uses: actions/checkout@v3 with: + ref: '${{ env.CHECKOUT_BRANCH }}' submodules: true - name: Update submodules @@ -27,7 +28,6 @@ jobs: run: | git config user.name github-actions git config user.email github-actions@github.com - git checkout $CHECKOUT_BRANCH git submodule update --remote - name: Check for changes From 6d5bce224a4ea5e9c9d84d1911f2ae7d8c57ccc3 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 11 Jan 2023 11:24:30 +0000 Subject: [PATCH 22/28] sub-modules: Change coriolis-data to an https URL, not git@ Someone cloning shouldn't *need* a github account in order to get the sub-modules. --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index b844f49e..cd89b465 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "coriolis-data"] path = coriolis-data - url = git@github.com:EDCD/coriolis-data.git + url = https://github.com/EDCD/coriolis-data.git [submodule "FDevIDs"] path = FDevIDs url = https://github.com/EDCD/FDevIDs.git From d576cb6611583e42ef25489936b80ec54d8e119b Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 18 Jan 2023 11:16:13 +0000 Subject: [PATCH 23/28] develop: Post (pre-)release appversion bump to 5.8.1-alpha0 --- config/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/__init__.py b/config/__init__.py index 0600f689..ea9a3934 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.8.0-rc3' +_static_appversion = '5.8.1-alpha0' _cached_version: Optional[semantic_version.Version] = None copyright = '© 2015-2019 Jonathan Harris, 2020-2023 EDCD' From 650b43cc3c7693e8ee2eae08bfef8c6aecc2e75d Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 18 Jan 2023 11:30:28 +0000 Subject: [PATCH 24/28] PLUGINS: Document monitor.is_live_galaxy() as sanctioned for use --- PLUGINS.md | 10 +++++++--- monitor.py | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/PLUGINS.md b/PLUGINS.md index 5cabd8b6..9cc2c3f3 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -110,9 +110,9 @@ from the original files unless specified as allowed in this section. `import plug` - For using `plug.show_error()` only. - Use `monitor.game_running()` as follows in case a plugin needs to know if we - think the game is running. *NB: This is a function, and should be called as - such. Using the bare word `game_running` will always be `True`.* +Use `monitor.game_running()` as follows in case a plugin needs to know if we +think the game is running. *NB: This is a function, and should be called as +such. Using the bare word `game_running` will always be `True`.* ``` from monitor import monitor @@ -121,6 +121,10 @@ if monitor.game_running(): ... ``` +Use `monitor.is_live_galaxy()` to determine if the player is playing in the +Live galaxy. Note the implementation details of this. At time of writing it +performs a `semantic_version` >= check. + `import timeout_session` - provides a method called `new_session` that creates a requests.session with a default timeout on all requests. Recommended to reduce noise in HTTP requests diff --git a/monitor.py b/monitor.py index 1770195c..15cd72c4 100644 --- a/monitor.py +++ b/monitor.py @@ -2507,6 +2507,8 @@ class EDLogs(FileSystemEventHandler): # type: ignore # See below """ Indicate if current tracking indicates Live galaxy. + NB: **MAY** be used by third-party plugins. + We assume: 1) `gameversion` remains something that semantic_verison.Version.coerce() can parse. 2) Any Live galaxy client reports a version >= the defined base version. From 8b9379a89e7b5799bc64aec548d6fba41933e228 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 18 Jan 2023 11:44:51 +0000 Subject: [PATCH 25/28] PLUGINS: Document that they should use `requests`, not `urllib`, and why --- PLUGINS.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/PLUGINS.md b/PLUGINS.md index 9cc2c3f3..b0626cfb 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -381,6 +381,20 @@ So instead use: # During shutdown ``` +### Use `requests`, not `urllib` for HTTP(S) requests +We use `requests` in lots of core code, so it will always be available. An +advantage to using it, instead of the core `urllib`, is that it brings in +`certifi` with its own set of trusted root certificates. + +We've seen issues where a plugin was using `urllib`, which uses the **system** +certificate store, and a user's system didn't yet have a new root certificate +that was necessary for the operation of a URL the plugin was acessing. + +We keep `requests`, and thus `certifi` up to date via GitHub's dependabot. If +there is ever a certificate update that we don't have in a release then +please open a +[bug report](https://github.com/EDCD/EDMarketConnector/issues/new?assignees=&labels=bug%2C+unconfirmed&template=bug_report.md&title=). + --- ## Plugin Hooks From 27e39a05d8d2ce17b5f601debe63c5e9de8bb747 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Wed, 18 Jan 2023 11:48:27 +0000 Subject: [PATCH 26/28] PLUGINS: Document using `config.user_agent` for User-Agent And, really, just use `timeout_session` anyway, which does this. --- PLUGINS.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/PLUGINS.md b/PLUGINS.md index b0626cfb..3048f345 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -126,8 +126,11 @@ Live galaxy. Note the implementation details of this. At time of writing it performs a `semantic_version` >= check. `import timeout_session` - provides a method called `new_session` that creates -a requests.session with a default timeout on all requests. Recommended to -reduce noise in HTTP requests +a `requests.session` with a default timeout on all requests. Recommended to +reduce noise in HTTP requests. This also ensures your requests use the central +"User-Agent" header value. If you do have reason to make a request otherwise +please ensure you use the `config.user_agent` value as the User-Agent (you can +append a string to call out your plugin if you wish). `from ttkHyperlinkLabel import HyperlinkLabel` and `import myNotebook as nb` - For creating UI elements. From 3fb372fb113fb3cb636b7d24e2978550995d8e19 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sun, 22 Jan 2023 13:09:34 +0000 Subject: [PATCH 27/28] EDSM: Remove actually un-necessary, and bug-inducing "not None" checks I would have added these during a mypy cleanup, but it turns out they're both not necessary *and* it actually prevents the EDSM Settings tab from properly populating. --- plugins/edsm.py | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/plugins/edsm.py b/plugins/edsm.py index d68a3491..a48177e0 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -327,30 +327,27 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Fr if this.label: this.label.grid(columnspan=2, padx=PADX, sticky=tk.W) - if this.cmdr_label and this.cmdr_text: - # LANG: Game Commander name label in EDSM settings - this.cmdr_label = nb.Label(frame, text=_('Cmdr')) # Main window - this.cmdr_label.grid(row=cur_row, padx=PADX, sticky=tk.W) - this.cmdr_text = nb.Label(frame) - this.cmdr_text.grid(row=cur_row, column=1, padx=PADX, pady=PADY, sticky=tk.W) + # LANG: Game Commander name label in EDSM settings + this.cmdr_label = nb.Label(frame, text=_('Cmdr')) # Main window + this.cmdr_label.grid(row=cur_row, padx=PADX, sticky=tk.W) + this.cmdr_text = nb.Label(frame) + this.cmdr_text.grid(row=cur_row, column=1, padx=PADX, pady=PADY, sticky=tk.W) cur_row += 1 - if this.user_label and this.label: - # LANG: EDSM Commander name label in EDSM settings - this.user_label = nb.Label(frame, text=_('Commander Name')) # EDSM setting - this.user_label.grid(row=cur_row, padx=PADX, sticky=tk.W) - this.user = nb.Entry(frame) - this.user.grid(row=cur_row, column=1, padx=PADX, pady=PADY, sticky=tk.EW) + # LANG: EDSM Commander name label in EDSM settings + this.user_label = nb.Label(frame, text=_('Commander Name')) # EDSM setting + this.user_label.grid(row=cur_row, padx=PADX, sticky=tk.W) + this.user = nb.Entry(frame) + this.user.grid(row=cur_row, column=1, padx=PADX, pady=PADY, sticky=tk.EW) cur_row += 1 - if this.apikey_label and this.apikey: - # LANG: EDSM API key label - this.apikey_label = nb.Label(frame, text=_('API Key')) # EDSM setting - this.apikey_label.grid(row=cur_row, padx=PADX, sticky=tk.W) - this.apikey = nb.Entry(frame) - this.apikey.grid(row=cur_row, column=1, padx=PADX, pady=PADY, sticky=tk.EW) + # LANG: EDSM API key label + this.apikey_label = nb.Label(frame, text=_('API Key')) # EDSM setting + this.apikey_label.grid(row=cur_row, padx=PADX, sticky=tk.W) + this.apikey = nb.Entry(frame) + this.apikey.grid(row=cur_row, column=1, padx=PADX, pady=PADY, sticky=tk.EW) prefs_cmdr_changed(cmdr, is_beta) From d81c93c4ac87396a249dbbe233f99f2d5970b017 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Sun, 22 Jan 2023 13:11:59 +0000 Subject: [PATCH 28/28] Release 5.8.1: appversion & changelog --- ChangeLog.md | 5 +++++ config/__init__.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index e94b376f..7cb178e4 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -34,6 +34,11 @@ produce the Windows executables and installer. --- +Release 5.8.1 +=== +This fixes a bug where the Cmdr/APIKey sections on Settings > EDSM would never +be shown. + Release 5.8.0 === This release is essentially the same as 5.8.0-rc3 with only the version and diff --git a/config/__init__.py b/config/__init__.py index ea9a3934..7b00f21f 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.8.1-alpha0' +_static_appversion = '5.8.1' _cached_version: Optional[semantic_version.Version] = None copyright = '© 2015-2019 Jonathan Harris, 2020-2023 EDCD'