From 1b1ea1c20bc0c3a72bfb53f84e8690722ab6cfe2 Mon Sep 17 00:00:00 2001 From: George Pickering <9803299+bigpick@users.noreply.github.com> Date: Sun, 16 Mar 2025 13:35:02 -0400 Subject: [PATCH 01/10] chore: bump deps+tj-actions --- .github/workflows/ensure-version-changed.yml | 2 +- .pre-commit-config.yaml | 2 +- VERSION | 2 +- poetry.lock | 56 ++++++++++---------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ensure-version-changed.yml b/.github/workflows/ensure-version-changed.yml index beaf6e7..f388874 100644 --- a/.github/workflows/ensure-version-changed.yml +++ b/.github/workflows/ensure-version-changed.yml @@ -19,7 +19,7 @@ jobs: - name: Ensure VERSION file has been updated. id: changed-version-file - uses: tj-actions/changed-files@v44 + uses: tj-actions/changed-files@v46.0.1 with: base_sha: "${{ steps.base-sha.outputs.sha }}" files_yaml: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 167cb91..e8190a5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.2 + rev: v0.11.0 hooks: # Run the linter. - id: ruff diff --git a/VERSION b/VERSION index 8acdd82..4e379d2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.1 +0.0.2 diff --git a/poetry.lock b/poetry.lock index a2b972f..6e4a6a5 100644 --- a/poetry.lock +++ b/poetry.lock @@ -28,14 +28,14 @@ files = [ [[package]] name = "astroid" -version = "3.3.8" +version = "3.3.9" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.9.0" groups = ["dev"] files = [ - {file = "astroid-3.3.8-py3-none-any.whl", hash = "sha256:187ccc0c248bfbba564826c26f070494f7bc964fd286b6d9fff4420e55de828c"}, - {file = "astroid-3.3.8.tar.gz", hash = "sha256:a88c7994f914a4ea8572fac479459f4955eeccc877be3f2d959a33273b0cf40b"}, + {file = "astroid-3.3.9-py3-none-any.whl", hash = "sha256:d05bfd0acba96a7bd43e222828b7d9bc1e138aaeb0649707908d3702a9831248"}, + {file = "astroid-3.3.9.tar.gz", hash = "sha256:622cc8e3048684aa42c820d9d218978021c3c3d174fb03a9f0d615921744f550"}, ] [package.dependencies] @@ -388,14 +388,14 @@ plugins = ["setuptools"] [[package]] name = "jinja2" -version = "3.1.5" +version = "3.1.6" description = "A very fast and expressive template engine." optional = false python-versions = ">=3.7" groups = ["dev"] files = [ - {file = "jinja2-3.1.5-py3-none-any.whl", hash = "sha256:aba0f4dc9ed8013c424088f68a5c226f7d6097ed89b246d7749c2ec4175c6adb"}, - {file = "jinja2-3.1.5.tar.gz", hash = "sha256:8fefff8dc3034e27bb80d67c671eb8a9bc424c0ef4c0826edbff304cceff43bb"}, + {file = "jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67"}, + {file = "jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d"}, ] [package.dependencies] @@ -755,14 +755,14 @@ windows-terminal = ["colorama (>=0.4.6)"] [[package]] name = "pylint" -version = "3.3.4" +version = "3.3.5" description = "python code static checker" optional = false python-versions = ">=3.9.0" groups = ["dev"] files = [ - {file = "pylint-3.3.4-py3-none-any.whl", hash = "sha256:289e6a1eb27b453b08436478391a48cd53bb0efb824873f949e709350f3de018"}, - {file = "pylint-3.3.4.tar.gz", hash = "sha256:74ae7a38b177e69a9b525d0794bd8183820bfa7eb68cc1bee6e8ed22a42be4ce"}, + {file = "pylint-3.3.5-py3-none-any.whl", hash = "sha256:7cb170929a371238530b2eeea09f5f28236d106b70308c3d46a9c0cf11634633"}, + {file = "pylint-3.3.5.tar.gz", hash = "sha256:38d0f784644ed493d91f76b5333a0e370a1c1bc97c22068a77523b4bf1e82c31"}, ] [package.dependencies] @@ -966,30 +966,30 @@ test = ["pytest (>=8)"] [[package]] name = "ruff" -version = "0.9.9" +version = "0.11.0" description = "An extremely fast Python linter and code formatter, written in Rust." optional = false python-versions = ">=3.7" groups = ["dev"] files = [ - {file = "ruff-0.9.9-py3-none-linux_armv6l.whl", hash = "sha256:628abb5ea10345e53dff55b167595a159d3e174d6720bf19761f5e467e68d367"}, - {file = "ruff-0.9.9-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:b6cd1428e834b35d7493354723543b28cc11dc14d1ce19b685f6e68e07c05ec7"}, - {file = "ruff-0.9.9-py3-none-macosx_11_0_arm64.whl", hash = "sha256:5ee162652869120ad260670706f3cd36cd3f32b0c651f02b6da142652c54941d"}, - {file = "ruff-0.9.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3aa0f6b75082c9be1ec5a1db78c6d4b02e2375c3068438241dc19c7c306cc61a"}, - {file = "ruff-0.9.9-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:584cc66e89fb5f80f84b05133dd677a17cdd86901d6479712c96597a3f28e7fe"}, - {file = "ruff-0.9.9-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abf3369325761a35aba75cd5c55ba1b5eb17d772f12ab168fbfac54be85cf18c"}, - {file = "ruff-0.9.9-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:3403a53a32a90ce929aa2f758542aca9234befa133e29f4933dcef28a24317be"}, - {file = "ruff-0.9.9-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:18454e7fa4e4d72cffe28a37cf6a73cb2594f81ec9f4eca31a0aaa9ccdfb1590"}, - {file = "ruff-0.9.9-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0fadfe2c88724c9617339f62319ed40dcdadadf2888d5afb88bf3adee7b35bfb"}, - {file = "ruff-0.9.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6df104d08c442a1aabcfd254279b8cc1e2cbf41a605aa3e26610ba1ec4acf0b0"}, - {file = "ruff-0.9.9-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:d7c62939daf5b2a15af48abbd23bea1efdd38c312d6e7c4cedf5a24e03207e17"}, - {file = "ruff-0.9.9-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:9494ba82a37a4b81b6a798076e4a3251c13243fc37967e998efe4cce58c8a8d1"}, - {file = "ruff-0.9.9-py3-none-musllinux_1_2_i686.whl", hash = "sha256:4efd7a96ed6d36ef011ae798bf794c5501a514be369296c672dab7921087fa57"}, - {file = "ruff-0.9.9-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:ab90a7944c5a1296f3ecb08d1cbf8c2da34c7e68114b1271a431a3ad30cb660e"}, - {file = "ruff-0.9.9-py3-none-win32.whl", hash = "sha256:6b4c376d929c25ecd6d87e182a230fa4377b8e5125a4ff52d506ee8c087153c1"}, - {file = "ruff-0.9.9-py3-none-win_amd64.whl", hash = "sha256:837982ea24091d4c1700ddb2f63b7070e5baec508e43b01de013dc7eff974ff1"}, - {file = "ruff-0.9.9-py3-none-win_arm64.whl", hash = "sha256:3ac78f127517209fe6d96ab00f3ba97cafe38718b23b1db3e96d8b2d39e37ddf"}, - {file = "ruff-0.9.9.tar.gz", hash = "sha256:0062ed13f22173e85f8f7056f9a24016e692efeea8704d1a5e8011b8aa850933"}, + {file = "ruff-0.11.0-py3-none-linux_armv6l.whl", hash = "sha256:dc67e32bc3b29557513eb7eeabb23efdb25753684b913bebb8a0c62495095acb"}, + {file = "ruff-0.11.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:38c23fd9bdec4eb437b4c1e3595905a0a8edfccd63a790f818b28c78fe345639"}, + {file = "ruff-0.11.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:7c8661b0be91a38bd56db593e9331beaf9064a79028adee2d5f392674bbc5e88"}, + {file = "ruff-0.11.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b6c0e8d3d2db7e9f6efd884f44b8dc542d5b6b590fc4bb334fdbc624d93a29a2"}, + {file = "ruff-0.11.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:3c3156d3f4b42e57247275a0a7e15a851c165a4fc89c5e8fa30ea6da4f7407b8"}, + {file = "ruff-0.11.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:490b1e147c1260545f6d041c4092483e3f6d8eba81dc2875eaebcf9140b53905"}, + {file = "ruff-0.11.0-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:1bc09a7419e09662983b1312f6fa5dab829d6ab5d11f18c3760be7ca521c9329"}, + {file = "ruff-0.11.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bcfa478daf61ac8002214eb2ca5f3e9365048506a9d52b11bea3ecea822bb844"}, + {file = "ruff-0.11.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6fbb2aed66fe742a6a3a0075ed467a459b7cedc5ae01008340075909d819df1e"}, + {file = "ruff-0.11.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:92c0c1ff014351c0b0cdfdb1e35fa83b780f1e065667167bb9502d47ca41e6db"}, + {file = "ruff-0.11.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:e4fd5ff5de5f83e0458a138e8a869c7c5e907541aec32b707f57cf9a5e124445"}, + {file = "ruff-0.11.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:96bc89a5c5fd21a04939773f9e0e276308be0935de06845110f43fd5c2e4ead7"}, + {file = "ruff-0.11.0-py3-none-musllinux_1_2_i686.whl", hash = "sha256:a9352b9d767889ec5df1483f94870564e8102d4d7e99da52ebf564b882cdc2c7"}, + {file = "ruff-0.11.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:049a191969a10897fe052ef9cc7491b3ef6de79acd7790af7d7897b7a9bfbcb6"}, + {file = "ruff-0.11.0-py3-none-win32.whl", hash = "sha256:3191e9116b6b5bbe187447656f0c8526f0d36b6fd89ad78ccaad6bdc2fad7df2"}, + {file = "ruff-0.11.0-py3-none-win_amd64.whl", hash = "sha256:c58bfa00e740ca0a6c43d41fb004cd22d165302f360aaa56f7126d544db31a21"}, + {file = "ruff-0.11.0-py3-none-win_arm64.whl", hash = "sha256:868364fc23f5aa122b00c6f794211e85f7e78f5dffdf7c590ab90b8c4e69b657"}, + {file = "ruff-0.11.0.tar.gz", hash = "sha256:e55c620690a4a7ee6f1cccb256ec2157dc597d109400ae75bbf944fc9d6462e2"}, ] [[package]] From e2e29e8250bde5eedc1f157e89d324a94fd5b6a9 Mon Sep 17 00:00:00 2001 From: George Pickering <9803299+bigpick@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:02:26 -0400 Subject: [PATCH 02/10] chore: switch codeql to conditional for required check --- .github/workflows/codeql.yml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ae6958e..19f26fe 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -9,11 +9,39 @@ on: branches: [main] pull_request: branches: [main] - paths: - - 'plox/**' jobs: + check_modified: + name: Check modified code files + outputs: + detected_changed_src: ${{ steps.check_files.outputs.detected_changed_src }} + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 2 + - name: check for modified code src files + id: check_files + run: | + echo "=============== list modified files ===============" + git diff --name-only HEAD^ HEAD + + echo "========== check paths of modified files ==========" + git diff --name-only HEAD^ HEAD > files.txt + while IFS= read -r file + do + echo $file + if [[ $file == plox/* ]]; then + echo "Detected src code under plox/ modified!" + echo "::set-output name=detected_changed_src::true" + return + fi + done < files.txt + echo "::set-output name=detected_changed_src::false" scan: + needs: check_modified + if: needs.check_modified.outputs.detected_changed_src == 'true' runs-on: ubuntu-latest permissions: # required for all workflows From 2fd971b142cff454720a59216732ea81cdeeae80 Mon Sep 17 00:00:00 2001 From: George Pickering <9803299+bigpick@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:05:05 -0400 Subject: [PATCH 03/10] chore: switch codeql to conditional for required check (2) --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 19f26fe..34e6ef8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -28,7 +28,7 @@ jobs: git diff --name-only HEAD^ HEAD echo "========== check paths of modified files ==========" - git diff --name-only HEAD^ HEAD > files.txt + git diff --name-only HEAD^ HEAD > files.txt while IFS= read -r file do echo $file @@ -37,7 +37,7 @@ jobs: echo "::set-output name=detected_changed_src::true" return fi - done < files.txt + done < files.txt echo "::set-output name=detected_changed_src::false" scan: needs: check_modified From 803c9adb5097a0928ed92ba693af384079e139ca Mon Sep 17 00:00:00 2001 From: George Pickering <9803299+bigpick@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:07:16 -0400 Subject: [PATCH 04/10] fix: output syntax --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 34e6ef8..7d24886 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -34,11 +34,11 @@ jobs: echo $file if [[ $file == plox/* ]]; then echo "Detected src code under plox/ modified!" - echo "::set-output name=detected_changed_src::true" + echo "detected_changed_src=true" >> $GIHTUB_OUTPUT return fi done < files.txt - echo "::set-output name=detected_changed_src::false" + echo "detected_changed_src=false" >> $GIHTUB_OUTPUT scan: needs: check_modified if: needs.check_modified.outputs.detected_changed_src == 'true' From 47dddf5872297630023441638b876fa7624adfc7 Mon Sep 17 00:00:00 2001 From: George Pickering <9803299+bigpick@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:11:22 -0400 Subject: [PATCH 05/10] fix: GITHUB typo --- .github/workflows/codeql.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 7d24886..52a477b 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -34,11 +34,11 @@ jobs: echo $file if [[ $file == plox/* ]]; then echo "Detected src code under plox/ modified!" - echo "detected_changed_src=true" >> $GIHTUB_OUTPUT + echo "detected_changed_src=true" >> "$GITHUB_OUTPUT" return fi done < files.txt - echo "detected_changed_src=false" >> $GIHTUB_OUTPUT + echo "detected_changed_src=false" >> "$GITHUB_OUTPUT" scan: needs: check_modified if: needs.check_modified.outputs.detected_changed_src == 'true' From 03c3d9ba6e0bd60dac63ce306e7da4c112e5d621 Mon Sep 17 00:00:00 2001 From: George Pickering <9803299+bigpick@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:23:31 -0400 Subject: [PATCH 06/10] feat: in house VERSION diff --- .github/workflows/ensure-version-changed.yml | 36 +++++++++----------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ensure-version-changed.yml b/.github/workflows/ensure-version-changed.yml index f388874..52be6c3 100644 --- a/.github/workflows/ensure-version-changed.yml +++ b/.github/workflows/ensure-version-changed.yml @@ -4,31 +4,27 @@ on: pull_request: jobs: - changed_files: + check_version_modified: + name: Check VERSION modified runs-on: ubuntu-latest - name: validate steps: - uses: actions/checkout@v4 with: - submodules: true fetch-depth: 0 - - name: Base SHA id: base-sha - run: echo "sha=$(git rev-parse origin/${{ github.event.repository.default_branch }})" >> $GITHUB_OUTPUT - - - name: Ensure VERSION file has been updated. - id: changed-version-file - uses: tj-actions/changed-files@v46.0.1 - with: - base_sha: "${{ steps.base-sha.outputs.sha }}" - files_yaml: | - version: - - VERSION - - - name: Fail if VERSION file wasn't detected as changed - if: steps.changed-version-file.outputs.version_any_changed == 'false' + run: echo "sha=$(git rev-parse origin/${{ github.event.pull_request.base.ref }})" >> $GITHUB_OUTPUT + - name: check for modified code src files + id: check_files run: | - echo "=> Did not detect VERISON file has been updated." - echo "=> Updated the VERSION file, commit, and re-push." - exit 1 + echo "=============== list modified files ===============" + git diff --name-only "${{ steps.base-sha.outputs.sha }}" "${{ github.head_ref }}" > files.txt + cat files.txt + + echo "========== check paths of modified files ==========" + while IFS= read -r file; do + if [[ $file == VERSION ]]; then + return 0 + fi + done < files.txt + return -1 From adae2aee0e65130cd6ad507e565c2e533fd8dd95 Mon Sep 17 00:00:00 2001 From: George Pickering <9803299+bigpick@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:24:52 -0400 Subject: [PATCH 07/10] feat: in house VERSION diff (2) --- .github/workflows/ensure-version-changed.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ensure-version-changed.yml b/.github/workflows/ensure-version-changed.yml index 52be6c3..7fb9d43 100644 --- a/.github/workflows/ensure-version-changed.yml +++ b/.github/workflows/ensure-version-changed.yml @@ -18,7 +18,7 @@ jobs: id: check_files run: | echo "=============== list modified files ===============" - git diff --name-only "${{ steps.base-sha.outputs.sha }}" "${{ github.head_ref }}" > files.txt + git diff --name-only "${{ steps.base-sha.outputs.sha }}" "${{ github.sha }}" > files.txt cat files.txt echo "========== check paths of modified files ==========" From 3f7313463d0a154833749ccde509324210ea2011 Mon Sep 17 00:00:00 2001 From: George Pickering <9803299+bigpick@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:29:50 -0400 Subject: [PATCH 08/10] feat: in house VERSION diff (3) --- .github/workflows/ensure-version-changed.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ensure-version-changed.yml b/.github/workflows/ensure-version-changed.yml index 7fb9d43..c053b0f 100644 --- a/.github/workflows/ensure-version-changed.yml +++ b/.github/workflows/ensure-version-changed.yml @@ -10,17 +10,13 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 - - name: Base SHA - id: base-sha - run: echo "sha=$(git rev-parse origin/${{ github.event.pull_request.base.ref }})" >> $GITHUB_OUTPUT + fetch-depth: 2 - name: check for modified code src files id: check_files run: | echo "=============== list modified files ===============" - git diff --name-only "${{ steps.base-sha.outputs.sha }}" "${{ github.sha }}" > files.txt + git diff --name-only HEAD^ HEAD > files.txt cat files.txt - echo "========== check paths of modified files ==========" while IFS= read -r file; do if [[ $file == VERSION ]]; then From c30bb3bcc105a2245fa581fe806619f023cb0313 Mon Sep 17 00:00:00 2001 From: George Pickering <9803299+bigpick@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:30:31 -0400 Subject: [PATCH 09/10] feat: in house VERSION diff (3) --- .github/workflows/ensure-version-changed.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ensure-version-changed.yml b/.github/workflows/ensure-version-changed.yml index c053b0f..cc8e3f9 100644 --- a/.github/workflows/ensure-version-changed.yml +++ b/.github/workflows/ensure-version-changed.yml @@ -20,7 +20,7 @@ jobs: echo "========== check paths of modified files ==========" while IFS= read -r file; do if [[ $file == VERSION ]]; then - return 0 + exit 0 fi done < files.txt - return -1 + exit 1 From 12a31924274f0302e87c4201bd154815a1956ff9 Mon Sep 17 00:00:00 2001 From: George Pickering <9803299+bigpick@users.noreply.github.com> Date: Sun, 16 Mar 2025 14:35:36 -0400 Subject: [PATCH 10/10] chore: VERSION check name --- .github/workflows/ensure-version-changed.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ensure-version-changed.yml b/.github/workflows/ensure-version-changed.yml index cc8e3f9..c29e6e2 100644 --- a/.github/workflows/ensure-version-changed.yml +++ b/.github/workflows/ensure-version-changed.yml @@ -1,11 +1,10 @@ -name: VERSION bump +name: VERSION on: pull_request: jobs: check_version_modified: - name: Check VERSION modified runs-on: ubuntu-latest steps: - uses: actions/checkout@v4