From 0e0de953aa5659088aaa61d14eb5dd39a202b3ad Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 May 2025 17:35:16 +0000 Subject: [PATCH 1/5] copier --- .copier-answers.yml | 2 +- .github/actions/install_deps_uv/action.yml | 2 +- .github/dependabot.yml | 2 +- .github/workflows/ci.yaml | 9 ++--- extensions/context.py | 2 +- .../actions/install_deps_uv/action.yml | 2 +- template/.github/dependabot.yml.jinja | 2 +- template/.github/workflows/get-values.yaml | 34 +++++++++++++++++++ 8 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 template/.github/workflows/get-values.yaml diff --git a/.copier-answers.yml b/.copier-answers.yml index af55d41d..34b9cfc3 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.0.41-24-g20eac2f +_commit: v0.0.41-29-gd592712 _src_path: gh:LabAutomationAndScreening/copier-base-template.git description: Copier template for creating Python libraries and executables python_ci_versions: diff --git a/.github/actions/install_deps_uv/action.yml b/.github/actions/install_deps_uv/action.yml index 0a27ec5b..254f74ab 100644 --- a/.github/actions/install_deps_uv/action.yml +++ b/.github/actions/install_deps_uv/action.yml @@ -40,7 +40,7 @@ runs: shell: bash - name: Setup python - uses: actions/setup-python@v5.5.0 + uses: actions/setup-python@v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e93df146..ec71f925 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,7 +9,7 @@ updates: time: "16:00" open-pull-requests-limit: 5 ignore: - - dependency-name: "*" + - dependency-name: "boto3" # boto3 gets patch updates way too frequently and they're usually not important update-types: - "version-update:semver-patch" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9f2dcb14..26717f9e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -169,16 +169,13 @@ jobs: if: needs.lint-matrix.result != 'success' run: | exit 1 - - name: Make updated dependabot hash commit as succeeded + - name: Mark updated dependabot hash commit as succeeded if: needs.get-values.outputs.dependabot-commit-created == 'true' env: GH_TOKEN: ${{ github.token }} run: | gh api \ - -X POST \ - -H "Accept: application/vnd.github.v3+json" \ + -X POST -H "Accept: application/vnd.github.v3+json" \ "/repos/${{ github.repository }}/statuses/${{ needs.get-values.outputs.new-dependabot-sha }}" \ - -f state=success \ - -f context="required-check" \ - -f description="Initial CI run passed" \ + -f state=success -f context="required-check" -f description="Initial CI run passed" \ -f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" diff --git a/extensions/context.py b/extensions/context.py index f0186b7c..52616742 100644 --- a/extensions/context.py +++ b/extensions/context.py @@ -45,7 +45,7 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]: context["graphql_codegen_typescript_version"] = "^4.1.6" context["gha_checkout"] = "v4.2.2" - context["gha_setup_python"] = "v5.5.0" + context["gha_setup_python"] = "v5.6.0" context["gha_cache"] = "v4.2.2" context["gha_upload_artifact"] = "v4.6.2" context["gha_download_artifact"] = "v4.2.1" diff --git a/template/.github/actions/install_deps_uv/action.yml b/template/.github/actions/install_deps_uv/action.yml index 0a27ec5b..254f74ab 100644 --- a/template/.github/actions/install_deps_uv/action.yml +++ b/template/.github/actions/install_deps_uv/action.yml @@ -40,7 +40,7 @@ runs: shell: bash - name: Setup python - uses: actions/setup-python@v5.5.0 + uses: actions/setup-python@v5.6.0 with: python-version: ${{ env.PYTHON_VERSION }} diff --git a/template/.github/dependabot.yml.jinja b/template/.github/dependabot.yml.jinja index 369b2b0a..39349664 100644 --- a/template/.github/dependabot.yml.jinja +++ b/template/.github/dependabot.yml.jinja @@ -9,7 +9,7 @@ updates: time: "16:00" open-pull-requests-limit: 5 ignore: - - dependency-name: "*" + - dependency-name: "boto3" # boto3 gets patch updates way too frequently and they're usually not important update-types: - "version-update:semver-patch" diff --git a/template/.github/workflows/get-values.yaml b/template/.github/workflows/get-values.yaml new file mode 100644 index 00000000..d91a28e1 --- /dev/null +++ b/template/.github/workflows/get-values.yaml @@ -0,0 +1,34 @@ +name: Get Values + +on: + workflow_call: + outputs: + new-dependabot-sha: + description: BUILD_HASH + value: ${{ jobs.get-values.outputs.new-dependabot-sha }} + dependabot-commit-created: + description: whether or not a commit was created on a dependabot branch + value: ${{ jobs.get-values.outputs.dependabot-commit-created }} + +env: + PYTHONUNBUFFERED: True + +permissions: + contents: write # needed to push commit of new devcontainer hash for dependabot PRs + +jobs: + get-values: + runs-on: ubuntu-24.04 + outputs: + new-dependabot-sha: ${{ steps.update-hash.outputs.new-sha }} + dependabot-commit-created: ${{ steps.update-hash.outputs.commit-created }} + steps: + - name: Checkout code + uses: actions/checkout@v4.2.2 + + - name: Update Devcontainer Hash + if: ${{ github.actor == 'dependabot[bot]' }} + id: update-hash + uses: ./.github/actions/update-devcontainer-hash + with: + branch: ${{ github.ref_name }} From bd77b8323f6411403a73d9922ff8adf8e00241cc Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 May 2025 17:38:23 +0000 Subject: [PATCH 2/5] update CI --- template/.github/workflows/ci.yaml.jinja | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/template/.github/workflows/ci.yaml.jinja b/template/.github/workflows/ci.yaml.jinja index 66081e5e..2dbbcfab 100644 --- a/template/.github/workflows/ci.yaml.jinja +++ b/template/.github/workflows/ci.yaml.jinja @@ -15,7 +15,11 @@ permissions: contents: write # needed for mutex jobs: - lint: + get-values: + uses: ./.github/workflows/get-values.yaml + + pre-commit: + needs: [ get-values ] name: Pre-commit runs-on: {% endraw %}{{ gha_linux_runner }}{% raw %} steps: @@ -161,10 +165,24 @@ jobs: required-check: runs-on: {% endraw %}{{ gha_linux_runner }}{% raw %} - needs: [ test{% endraw %}{% if create_docs %}, build-docs{% endif %}{% if is_frozen_executable %}, executable{% endif %}{% raw %} ] + needs: + - test + - get-values{% endraw %}{% if create_docs %} + - build-docs{% endif %}{% if is_frozen_executable %} + - executable{% endif %}{% raw %} if: always() steps: - name: fail if prior job failure if: needs.test.result != 'success'{% endraw %}{% if create_docs %} || needs.build-docs.result != 'success'{% endif %}{% if is_frozen_executable %} || needs.executable.result != 'success'{% endif %}{% raw %} run: | - exit 1{% endraw %} + exit 1 + - name: Mark updated Dependabot commit of devcontainer hash as succeeded + if: needs.get-values.outputs.dependabot-commit-created == 'true' + env: + GH_TOKEN: ${{ github.token }} + run: | + gh api \ + -X POST -H "Accept: application/vnd.github.v3+json" \ + "/repos/${{ github.repository }}/statuses/${{ needs.get-values.outputs.new-dependabot-sha }}" \ + -f state=success -f context="required-check" -f description="Initial CI run passed" \ + -f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"{% endraw %} From 71ef7554b433332fee3ae9b56fc0d6ec00016e6f Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 May 2025 17:40:09 +0000 Subject: [PATCH 3/5] fix job name --- template/.github/workflows/ci.yaml.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/.github/workflows/ci.yaml.jinja b/template/.github/workflows/ci.yaml.jinja index 2dbbcfab..28fb6207 100644 --- a/template/.github/workflows/ci.yaml.jinja +++ b/template/.github/workflows/ci.yaml.jinja @@ -18,7 +18,7 @@ jobs: get-values: uses: ./.github/workflows/get-values.yaml - pre-commit: + lint: needs: [ get-values ] name: Pre-commit runs-on: {% endraw %}{{ gha_linux_runner }}{% raw %} From 77eaccdbec9bf867e9d1ad493f7bdb064684477b Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 May 2025 17:42:47 +0000 Subject: [PATCH 4/5] comment --- template/.github/workflows/ci.yaml.jinja | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/template/.github/workflows/ci.yaml.jinja b/template/.github/workflows/ci.yaml.jinja index 28fb6207..73c51acb 100644 --- a/template/.github/workflows/ci.yaml.jinja +++ b/template/.github/workflows/ci.yaml.jinja @@ -12,7 +12,8 @@ env: permissions: id-token: write - contents: write # needed for mutex + contents: write # needed for mutex, and updating dependabot branches + statuses: write # needed for updating status on Dependabot PRs jobs: get-values: From b5b4cddb06133193a1d2bb367ae53ae27396d325 Mon Sep 17 00:00:00 2001 From: Eli Fine Date: Fri, 9 May 2025 17:49:58 +0000 Subject: [PATCH 5/5] Coiper --- .copier-answers.yml | 2 +- .devcontainer/devcontainer.json | 2 +- .devcontainer/install-ci-tooling.sh | 2 +- .github/actions/install_deps_uv/install-ci-tooling.ps1 | 2 +- .github/workflows/ci.yaml | 2 +- extensions/context.py | 2 +- template/.github/actions/install_deps_uv/install-ci-tooling.ps1 | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 34b9cfc3..a8080e13 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier -_commit: v0.0.41-29-gd592712 +_commit: v0.0.42 _src_path: gh:LabAutomationAndScreening/copier-base-template.git description: Copier template for creating Python libraries and executables python_ci_versions: diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index cd69b010..e55d8ece 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -59,5 +59,5 @@ "initializeCommand": "sh .devcontainer/initialize-command.sh", "onCreateCommand": "sh .devcontainer/on-create-command.sh", "postStartCommand": "sh .devcontainer/post-start-command.sh" - // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): 5e3a0577 # spellchecker:disable-line + // Devcontainer context hash (do not manually edit this, it's managed by a pre-commit hook): e9b90543 # spellchecker:disable-line } diff --git a/.devcontainer/install-ci-tooling.sh b/.devcontainer/install-ci-tooling.sh index 30d480d5..58b720e5 100644 --- a/.devcontainer/install-ci-tooling.sh +++ b/.devcontainer/install-ci-tooling.sh @@ -6,7 +6,7 @@ set -ex -curl -LsSf https://astral.sh/uv/0.6.17/install.sh | sh +curl -LsSf https://astral.sh/uv/0.7.3/install.sh | sh uv --version # TODO: add uv autocompletion to the shell https://docs.astral.sh/uv/getting-started/installation/#shell-autocompletion diff --git a/.github/actions/install_deps_uv/install-ci-tooling.ps1 b/.github/actions/install_deps_uv/install-ci-tooling.ps1 index 3b9753c2..4d6b40ea 100644 --- a/.github/actions/install_deps_uv/install-ci-tooling.ps1 +++ b/.github/actions/install_deps_uv/install-ci-tooling.ps1 @@ -3,7 +3,7 @@ Set-StrictMode -Version Latest $ErrorActionPreference = "Stop" -irm https://astral.sh/uv/0.6.17/install.ps1 | iex +irm https://astral.sh/uv/0.7.3/install.ps1 | iex # Add uv to path (in github runner) $env:Path = "C:\Users\runneradmin\.local\bin;$env:Path" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 26717f9e..9cc6c816 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,7 +12,7 @@ env: permissions: id-token: write - contents: write # needed for mutex + contents: write # needed for mutex, and updating dependabot branches statuses: write # needed for updating status on Dependabot PRs jobs: diff --git a/extensions/context.py b/extensions/context.py index 52616742..e5a4b3d4 100644 --- a/extensions/context.py +++ b/extensions/context.py @@ -10,7 +10,7 @@ class ContextUpdater(ContextHook): @override def hook(self, context: dict[Any, Any]) -> dict[Any, Any]: - context["uv_version"] = "0.6.17" + context["uv_version"] = "0.7.3" context["pnpm_version"] = "10.10.0" context["pre_commit_version"] = "4.2.0" context["pyright_version"] = "1.1.400" diff --git a/template/.github/actions/install_deps_uv/install-ci-tooling.ps1 b/template/.github/actions/install_deps_uv/install-ci-tooling.ps1 index 3b9753c2..4d6b40ea 100644 --- a/template/.github/actions/install_deps_uv/install-ci-tooling.ps1 +++ b/template/.github/actions/install_deps_uv/install-ci-tooling.ps1 @@ -3,7 +3,7 @@ Set-StrictMode -Version Latest $ErrorActionPreference = "Stop" -irm https://astral.sh/uv/0.6.17/install.ps1 | iex +irm https://astral.sh/uv/0.7.3/install.ps1 | iex # Add uv to path (in github runner) $env:Path = "C:\Users\runneradmin\.local\bin;$env:Path"