Skip to content

Commit 01d9add

Browse files
authored
Use public released version of volto-plate (#475)
* Rework the changelog CI workflow and fix the Dependabot config Run the backend, frontend and repository changelog checks as steps of a single job, deriving the package paths from `uvx repoplone settings dump` via the shared config workflow, and report each outcome in the workflow summary. Move `dependabot.yml` to `.github/`, where GitHub actually reads it, and label its pull requests with `skip changelog`. * Rename the towncrier `test` fragment type to `tests` Align the fragment type with the directory name used by the other types, and declare it in the repository-level configuration as well. Rename the one existing fragment accordingly, so it is not silently dropped from the changelog. Also move the frontend changelog template into `news/`, so it no longer depends on `node_modules` being installed, relocate the stray `+core-a6.bugfix` fragment into `news/`, and finish the pipx-to-uvx migration in `.release-it.json`. * Use the public released versions of volto-plate Depend on `kitconcept.plate` 1.0.0a23 from PyPI and `@kitconcept/volto-plate` 1.0.0-alpha.23 from npm, instead of the source distribution vendored in `backend/container/` and the tarball vendored in `frontend/artifacts/`. Both vendored artifacts and the `update-volto-plate` script that produced them are removed, together with its `Makefile` target. Refs https://gitlab.kitconcept.io/kitconcept/distribution-kitconcept-intranet/-/issues/593 * Stop copying the removed vendored artifact directories in the images `backend/container/` and `frontend/artifacts/` only ever held the vendored volto-plate distributions. With those consumed from PyPI and npm, git no longer tracks the directories, so the `COPY` lines fail the image builds. Nothing else reads either path.
1 parent 1fc072d commit 01d9add

28 files changed

Lines changed: 207 additions & 676 deletions

.github/dependabot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
updates:
3+
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
# Check for updates to GitHub Actions every week
8+
interval: "weekly"
9+
cooldown:
10+
default-days: 7
11+
# Dependabot never writes news fragments, so exempt its pull requests from
12+
# the changelog check. Both labels must exist in the repository, otherwise
13+
# they are silently ignored.
14+
labels:
15+
- "dependencies"
16+
- "skip changelog"

.github/workflows/changelog.yml

Lines changed: 37 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,22 @@
1-
name: Changelog check
1+
name: "Changelog"
22
on:
33
pull_request:
44
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
55
branches:
66
- main
77

88
env:
9-
NODE_VERSION: 24.x
10-
ADDON_NAME: kitconcept-intranet
11-
BASE_BRANCH: main
9+
python-version: 3.14
10+
base-branch: main
1211

1312
jobs:
1413
config:
15-
runs-on: ubuntu-latest
16-
outputs:
17-
backend: ${{ steps.filter.outputs.backend }}
18-
frontend: ${{ steps.filter.outputs.frontend }}
19-
repository: ${{ steps.filter.outputs.repository }}
20-
steps:
21-
- name: Checkout
22-
uses: actions/checkout@v7
23-
24-
- uses: dorny/paths-filter@v4
25-
id: filter
26-
with:
27-
filters: |
28-
backend:
29-
- 'backend/**'
30-
repository:
31-
- '.github/**'
32-
- '.vscode/**'
33-
- 'devops/**'
34-
- 'docs/**'
35-
- 'docker-compose.yml'
36-
- 'README.md'
37-
frontend:
38-
- 'frontend/**'
14+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip changelog') }}
15+
uses: ./.github/workflows/config.yml
3916

40-
backend:
41-
if: ${{ needs.config.outputs.backend == 'true' }}
17+
checks:
4218
runs-on: ubuntu-latest
19+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip changelog') }}
4320
needs:
4421
- config
4522
steps:
@@ -48,88 +25,42 @@ jobs:
4825
# Fetch all history
4926
fetch-depth: '0'
5027

51-
- name: Install pipx
52-
run: pip install towncrier
53-
54-
- name: Check for presence of a Change Log fragment (only pull requests)
55-
if: github.event_name == 'pull_request'
56-
run: |
57-
# Fetch the pull request' base branch so towncrier will be able to
58-
# compare the current branch with the base branch.
59-
# Source: https://github.com/actions/checkout/#fetch-all-branches.
60-
git fetch --no-tags origin ${BASE_BRANCH}
61-
towncrier check --compare-with origin/${{ env.BASE_BRANCH }} --config backend/pyproject.toml --dir backend/
62-
63-
frontend:
64-
if: ${{ needs.config.outputs.frontend == 'true' }}
65-
runs-on: ubuntu-latest
66-
needs:
67-
- config
68-
defaults:
69-
run:
70-
working-directory: ./frontend
71-
steps:
72-
- uses: actions/checkout@v7
28+
- name: Setup uv
29+
uses: plone/meta/.github/actions/setup_uv@2.x
7330
with:
74-
# Fetch all history
75-
fetch-depth: '0'
31+
python-version: ${{ env.python-version }}
32+
working-directory: '.'
7633

77-
- name: Install pipx
78-
run: pip install towncrier
79-
80-
- name: Use Node.js ${{ env.NODE_VERSION }}
81-
uses: actions/setup-node@v6
82-
with:
83-
node-version: ${{ env.NODE_VERSION }}
84-
85-
- name: Enable corepack
86-
run: npm i -g corepack@latest && corepack enable
87-
88-
- name: Get pnpm store directory
89-
shell: bash
34+
- name: "Fetch base branch"
9035
run: |
91-
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
92-
93-
- uses: actions/cache@v6
94-
name: Setup pnpm cache
95-
with:
96-
path: ${{ env.STORE_PATH }}
97-
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
98-
restore-keys: |
99-
${{ runner.os }}-pnpm-store-
36+
git fetch --no-tags origin ${{ env.base-branch }}
10037
101-
- name: Install dependencies
102-
run: make install
103-
104-
- name: Check for presence of a Change Log fragment (only pull requests)
105-
if: github.event_name == 'pull_request'
38+
- name: "Backend: Check"
39+
id: backend-changelog
40+
if: ${{ always() && needs.config.outputs.changelog-backend == 'true' }}
10641
run: |
107-
# Fetch the pull request' base branch so towncrier will be able to
108-
# compare the current branch with the base branch.
109-
# Source: https://github.com/actions/checkout/#fetch-all-branches.
110-
git fetch --no-tags origin ${BASE_BRANCH}
111-
cd ..
112-
towncrier check --compare-with origin/${{ env.BASE_BRANCH }} --config frontend/packages/${{ env.ADDON_NAME }}/towncrier.toml --dir frontend/packages/${{ env.ADDON_NAME }}
42+
git fetch --no-tags origin ${{ env.base-branch }}
43+
uvx towncrier check --compare-with origin/${{ env.base-branch }} --config backend/pyproject.toml --dir backend/
11344
114-
repository:
115-
if: ${{ needs.config.outputs.repository == 'true' }}
116-
runs-on: ubuntu-latest
117-
needs:
118-
- config
119-
steps:
120-
- uses: actions/checkout@v7
121-
with:
122-
# Fetch all history
123-
fetch-depth: '0'
45+
- name: "Frontend: Check"
46+
id: frontend-changelog
47+
if: ${{ always() && needs.config.outputs.changelog-frontend == 'true' }}
48+
run: |
49+
git fetch --no-tags origin ${{ env.base-branch }}
50+
uvx towncrier check --compare-with origin/${{ env.base-branch }} --config ${{ needs.config.outputs.path-frontend }}/towncrier.toml --dir ${{ needs.config.outputs.path-frontend }}
12451
125-
- name: Install pipx
126-
run: pip install towncrier
52+
- name: "Repository: Check"
53+
id: repository-changelog
54+
if: ${{ always() && needs.config.outputs.changelog-repository == 'true' }}
55+
run: |
56+
git fetch --no-tags origin ${{ env.base-branch }}
57+
uvx towncrier check --compare-with origin/${{ env.base-branch }} --config ${{ needs.config.outputs.path-root }}/towncrier.toml --dir ${{ needs.config.outputs.path-root }}
12758
128-
- name: Check for presence of a Change Log fragment (only pull requests)
129-
if: github.event_name == 'pull_request'
59+
- name: "Report check"
13060
run: |
131-
# Fetch the pull request' base branch so towncrier will be able to
132-
# compare the current branch with the base branch.
133-
# Source: https://github.com/actions/checkout/#fetch-all-branches.
134-
git fetch --no-tags origin ${BASE_BRANCH}
135-
towncrier check --compare-with origin/${{ env.BASE_BRANCH }} --config towncrier.toml --dir .
61+
echo '# Workflow Report' >> $GITHUB_STEP_SUMMARY
62+
echo '| Job ID | Conclusion |' >> $GITHUB_STEP_SUMMARY
63+
echo '| --- | --- |' >> $GITHUB_STEP_SUMMARY
64+
echo '| backend | ${{ steps.backend-changelog.conclusion }} |' >> $GITHUB_STEP_SUMMARY
65+
echo '| frontend | ${{ steps.frontend-changelog.conclusion }} |' >> $GITHUB_STEP_SUMMARY
66+
echo '| repository | ${{ steps.repository-changelog.conclusion }} |' >> $GITHUB_STEP_SUMMARY

.github/workflows/config.yml

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ on:
5151
value: ${{ jobs.config.outputs.base-tag }}
5252
image-name-prefix:
5353
description: "Image name prefix for container images"
54-
value: ${{ inputs.image-name-prefix }}
54+
value: ${{ jobs.config.outputs.image-name-prefix }}
5555
node-version:
5656
description: "Node version to be used"
5757
value: ${{ inputs.node-version }}
@@ -79,6 +79,24 @@ on:
7979
stack-prefix:
8080
description: "Deploy: Short name to be used to create Traefik labels"
8181
value: ${{ inputs.stack-prefix }}
82+
changelog-backend:
83+
description: "Flag reporting if we should run changelog jobs for the backend"
84+
value: ${{ jobs.config.outputs.changelog-backend }}
85+
changelog-frontend:
86+
description: "Flag reporting if we should run changelog jobs for the frontend"
87+
value: ${{ jobs.config.outputs.changelog-frontend }}
88+
changelog-repository:
89+
description: "Flag reporting if we should run changelog jobs for the repository"
90+
value: ${{ jobs.config.outputs.changelog-repository }}
91+
path-backend:
92+
description: "Path to the backend package, relative to the repository root"
93+
value: ${{ jobs.config.outputs.path-backend }}
94+
path-frontend:
95+
description: "Path to the frontend package, relative to the repository root"
96+
value: ${{ jobs.config.outputs.path-frontend }}
97+
path-root:
98+
description: "Path to the repository root"
99+
value: ${{ jobs.config.outputs.path-root }}
82100

83101
jobs:
84102
config:
@@ -90,27 +108,48 @@ jobs:
90108
docs: ${{ steps.filter.outputs.docs }}
91109
frontend: ${{ steps.filter.outputs.frontend }}
92110
deploy: ${{ steps.filter.outputs.deploy }}
93-
base-tag: ${{ steps.vars.outputs.BASE_TAG }}
111+
base-tag: ${{ steps.vars.outputs.base-tag }}
94112
kc-version: ${{ steps.vars.outputs.kc-version }}
95113
volto-version: ${{ steps.vars.outputs.volto-version }}
96114
environment: ${{ steps.vars.outputs.environment }}
97115
stack-name: ${{ steps.vars.outputs.stack-name }}
116+
image-name-prefix: ${{ steps.vars.outputs.image-name-prefix }}
117+
changelog-backend: ${{ steps.filter.outputs.changelog-backend }}
118+
changelog-frontend: ${{ steps.filter.outputs.changelog-frontend }}
119+
changelog-repository: ${{ steps.filter.outputs.changelog-repository }}
120+
path-backend: ${{ steps.vars.outputs.path-backend }}
121+
path-frontend: ${{ steps.vars.outputs.path-frontend }}
122+
path-root: ${{ steps.vars.outputs.path-root }}
98123

99124
steps:
100125
- name: Checkout
101126
uses: actions/checkout@v7
102127

128+
- name: Setup uv
129+
uses: plone/meta/.github/actions/setup_uv@2.x
130+
with:
131+
python-version: ${{ inputs.python-version }}
132+
working-directory: '.'
133+
103134
- name: Compute several vars needed for the CI
104135
id: vars
105136
run: |
106-
echo "BASE_TAG=sha-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
107-
echo "kc-version=$(cat backend/version.txt)" >> $GITHUB_OUTPUT
108-
python3 -c 'import json; data = json.load(open("./frontend/mrs.developer.json")); print("volto-version=" + (data["core"].get("tag") or "latest"))' >> $GITHUB_OUTPUT
137+
REPOSITORY_SETTINGS="$(uvx repoplone settings dump)"
138+
# `repoplone` reports absolute paths, but the checks need them
139+
# relative to the repository root.
140+
ROOT="$(jq -r '.root_path' <<< "$REPOSITORY_SETTINGS")"
141+
echo "base-tag=sha-$(git rev-parse --short HEAD)" >> "$GITHUB_OUTPUT"
142+
echo "image-name-prefix=$(jq -r '.container_images_prefix' <<< "$REPOSITORY_SETTINGS")" >> "$GITHUB_OUTPUT"
143+
echo "kc-version=$(jq -r '.backend.base_package_version' <<< "$REPOSITORY_SETTINGS")" >> "$GITHUB_OUTPUT"
144+
echo "volto-version=$(jq -r '.frontend.volto_version' <<< "$REPOSITORY_SETTINGS")" >> "$GITHUB_OUTPUT"
145+
echo "path-backend=$(jq -r '.backend.path' <<< "$REPOSITORY_SETTINGS" | sed "s|^${ROOT}/||")" >> "$GITHUB_OUTPUT"
146+
echo "path-frontend=$(jq -r '.frontend.path' <<< "$REPOSITORY_SETTINGS" | sed "s|^${ROOT}/||")" >> "$GITHUB_OUTPUT"
147+
echo "path-root=." >> "$GITHUB_OUTPUT"
109148
environment=${{ inputs.hostname }}
110149
echo "environment=${environment}" >> $GITHUB_OUTPUT
111150
echo "stack-name=${environment//./-}" >> $GITHUB_OUTPUT
112151
113-
- uses: dorny/paths-filter@v4
152+
- uses: dorny/paths-filter@v4.0.3
114153
id: filter
115154
with:
116155
filters: |
@@ -141,12 +180,26 @@ jobs:
141180
- '.github/workflows/frontend*'
142181
- '.github/workflows/main*'
143182
- 'devops/**'
183+
changelog-backend:
184+
- 'backend/**'
185+
changelog-frontend:
186+
- 'frontend/**'
187+
changelog-repository:
188+
- '.github/**'
189+
- '.vscode/**'
190+
- 'devops/**'
191+
- 'docs/**'
192+
- 'docker-compose.yml'
193+
- 'README.md'
144194
145195
- name: Test vars
146196
run: |
147-
echo "BASE_TAG: ${{ steps.vars.outputs.BASE_TAG }}"
197+
echo "BASE_TAG: ${{ steps.vars.outputs.base-tag }}"
148198
echo 'kc-version: ${{ steps.vars.outputs.kc-version }}'
149199
echo 'volto-version: ${{ steps.vars.outputs.volto-version }}'
200+
echo 'path-backend: ${{ steps.vars.outputs.path-backend }}'
201+
echo 'path-frontend: ${{ steps.vars.outputs.path-frontend }}'
202+
echo 'path-root: ${{ steps.vars.outputs.path-root }}'
150203
echo 'environment: ${{ steps.vars.outputs.environment }}'
151204
echo 'stack-name: ${{ steps.vars.outputs.stack-name }}'
152205
echo 'event-name: ${{ github.event_name }}'
@@ -156,3 +209,6 @@ jobs:
156209
echo 'Paths - devops: ${{ steps.filter.outputs.devops }}'
157210
echo 'Paths - docs: ${{ steps.filter.outputs.docs }}'
158211
echo 'Paths - frontend: ${{ steps.filter.outputs.frontend }}'
212+
echo 'Paths - changelog-backend: ${{ steps.filter.outputs.changelog-backend }}'
213+
echo 'Paths - changelog-frontend: ${{ steps.filter.outputs.changelog-frontend }}'
214+
echo 'Paths - changelog-repository: ${{ steps.filter.outputs.changelog-repository }}'

.vscode/settings.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
"eslint.workingDirectories": ["./frontend"],
33
"python.defaultInterpreterPath": "${workspaceFolder}/backend/.venv/bin/python",
44
"python-envs.workspaceSearchPaths": [
5-
".venv",
6-
"*/.venv",
75
"backend/.venv"
86
],
97
"ruff.organizeImports": true,

Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@ all: install
6363
help: ## This help message
6464
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
6565

66-
###########################################
67-
# Volto Plate
68-
###########################################
69-
.PHONY: update-volto-plate
70-
update-volto-plate: ## Update Volto Plate
71-
@echo "Update Volto Plate"
72-
@uv run scripts/update-volto-plate.py
73-
7466
###########################################
7567
# Frontend
7668
###########################################

backend/Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
ARG KC_VERSION
33
FROM ghcr.io/kitconcept/core-builder:${KC_VERSION:-latest} AS builder
44

5-
# Copy only the files needed for installing dependencies first to leverage Docker cache
6-
# In this case, kitconcept-plate
7-
COPY ./container /container
8-
95
# Install dependencies
106
RUN --mount=type=cache,target=/root/.cache \
117
--mount=type=bind,source=uv.lock,target=uv.lock \

backend/Dockerfile.acceptance

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
ARG KC_VERSION=latest
33
FROM ghcr.io/kitconcept/core-builder:${KC_VERSION} AS builder
44

5-
# Copy only the files needed for installing dependencies first to leverage Docker cache
6-
# In this case, kitconcept-plate
7-
COPY ./container /container
8-
95
# Install dependencies
106
RUN --mount=type=cache,target=/root/.cache \
117
--mount=type=bind,source=uv.lock,target=uv.lock \
-4.34 MB
Binary file not shown.

backend/news/593.internal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Depend on the released `kitconcept.plate` 1.0.0a23 from PyPI instead of the source distribution vendored in `container/`. @ericof

0 commit comments

Comments
 (0)