From 938401432dd5d5c79ae62a57917d77a2e3c59c4d Mon Sep 17 00:00:00 2001 From: perl_d Date: Fri, 27 Feb 2026 12:11:40 +0100 Subject: [PATCH 1/3] Update repo with template version v1.2.7 --- .copier-answers.yml | 2 +- .gitea/workflows/ci.yml | 22 ++++++---- .gitea/workflows/create_update_pr.yml | 62 +++++++++++++++++++++++++++ .gitlab-ci.yml | 7 --- pyproject.toml | 5 +++ 5 files changed, 81 insertions(+), 17 deletions(-) create mode 100644 .gitea/workflows/create_update_pr.yml delete mode 100644 .gitlab-ci.yml diff --git a/.copier-answers.yml b/.copier-answers.yml index c77efd7..f3ec294 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -2,7 +2,7 @@ # It is needed to track the repo template version, and editing may break things. # This file will be overwritten by copier on template updates. -_commit: v1.2.2 +_commit: v1.2.7 _src_path: https://github.com/bec-project/plugin_copier_template.git make_commit: false project_name: tomcat_bec diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 4f8fbf6..2dc3484 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -28,7 +28,7 @@ on: description: "Python version to use" required: false type: string - default: "3.11" + default: "3.12" permissions: pull-requests: write @@ -44,7 +44,18 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "${{ inputs.PYTHON_VERSION || '3.11' }}" + python-version: "${{ inputs.PYTHON_VERSION || '3.12' }}" + + - name: Checkout BEC Plugin Repository + uses: actions/checkout@v4 + with: + repository: bec/tomcat_bec + ref: "${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.head_ref || github.sha }}" + path: ./tomcat_bec + + - name: Lint for merge conflicts + run: | + - name: Checkout BEC Core uses: actions/checkout@v4 @@ -67,13 +78,6 @@ jobs: ref: "${{ inputs.BEC_WIDGETS_BRANCH || 'main' }}" path: ./bec_widgets - - name: Checkout BEC Plugin Repository - uses: actions/checkout@v4 - with: - repository: bec/tomcat_bec - ref: "${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.head_ref || github.sha }}" - path: ./tomcat_bec - - name: Install dependencies shell: bash run: | diff --git a/.gitea/workflows/create_update_pr.yml b/.gitea/workflows/create_update_pr.yml new file mode 100644 index 0000000..718a4d8 --- /dev/null +++ b/.gitea/workflows/create_update_pr.yml @@ -0,0 +1,62 @@ +name: Create template upgrade PR for tomcat_bec +on: + workflow_dispatch: + +permissions: + pull-requests: write + +jobs: + create_update_branch_and_pr: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install tools + run: | + pip install copier PySide6 + + - name: Checkout + uses: actions/checkout@v4 + + - name: Perform update + run: | + git config --global user.email "bec_ci_staging@psi.ch" + git config --global user.name "BEC automated CI" + + branch="chore/update-template-$(python -m uuid)" + echo "switching to branch $branch" + git checkout -b $branch + + echo "Running copier update..." + output="$(copier update --trust --defaults --conflict inline 2>&1)" + echo "$output" + msg="$(printf '%s\n' "$output" | head -n 1)" + + if ! grep -q "make_commit: true" .copier-answers.yml ; then + echo "Autocommit not made, committing..." + git add -A + git commit -a -m "$msg" + fi + + if diff-index --quiet HEAD ; then + echo "No changes detected" + exit 0 + fi + + git push -u origin $branch + curl -X POST "https://gitea.psi.ch/api/v1/repos/${{ gitea.repository }}/pulls" \ + -H "Authorization: token ${{ secrets.CI_REPO_WRITE }}" \ + -H "Content-Type: application/json" \ + -d "{ + \"title\": \"Template: $(echo $msg)\", + \"body\": \"This PR was created by Gitea Actions\", + \"head\": \"$(echo $branch)\", + \"base\": \"main\" + }" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index f84162d..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,7 +0,0 @@ -include: -- file: /templates/plugin-repo-template.yml - inputs: - name: tomcat_bec - target: tomcat_bec - branch: $CHILD_PIPELINE_BRANCH - project: bec/awi_utils diff --git a/pyproject.toml b/pyproject.toml index 0126133..7b262cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,8 +5,13 @@ build-backend = "hatchling.build" [project] name = "tomcat_bec" version = "0.0.0" +<<<<<<< before updating description = "The TOMCAT plugin repository for BEC" requires-python = ">=3.10" +======= +description = "A plugin repository for BEC" +requires-python = ">=3.11" +>>>>>>> after updating classifiers = [ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", -- 2.49.1 From 51e9dc169c046fb41cd4a255f6b83f362e06465e Mon Sep 17 00:00:00 2001 From: perl_d Date: Fri, 27 Feb 2026 15:49:26 +0100 Subject: [PATCH 2/3] Update repo with template version v1.2.8 --- .copier-answers.yml | 2 +- .gitea/workflows/ci.yml | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index f3ec294..0763ed8 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -2,7 +2,7 @@ # It is needed to track the repo template version, and editing may break things. # This file will be overwritten by copier on template updates. -_commit: v1.2.7 +_commit: v1.2.8 _src_path: https://github.com/bec-project/plugin_copier_template.git make_commit: false project_name: tomcat_bec diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 2dc3484..7424a6c 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -53,9 +53,10 @@ jobs: ref: "${{ inputs.BEC_PLUGIN_REPO_BRANCH || github.head_ref || github.sha }}" path: ./tomcat_bec - - name: Lint for merge conflicts - run: | - + - name: Lint for merge conflicts from template updates + shell: bash + # Find all Copier conflicts except this line + run: '! grep -r "<<<<<<< before updating" | grep -v "grep -r \"<<<<<<< before updating"' - name: Checkout BEC Core uses: actions/checkout@v4 -- 2.49.1 From 2de399d6ca0514992d6721db43a572aecab109c7 Mon Sep 17 00:00:00 2001 From: perl_d Date: Fri, 27 Feb 2026 16:05:08 +0100 Subject: [PATCH 3/3] Resolve template update merge conflict --- pyproject.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7b262cc..69984de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,13 +5,8 @@ build-backend = "hatchling.build" [project] name = "tomcat_bec" version = "0.0.0" -<<<<<<< before updating description = "The TOMCAT plugin repository for BEC" -requires-python = ">=3.10" -======= -description = "A plugin repository for BEC" requires-python = ">=3.11" ->>>>>>> after updating classifiers = [ "Development Status :: 3 - Alpha", "Programming Language :: Python :: 3", -- 2.49.1