From 36d0c8af25daab7e387e0a8bca460be79b253492 Mon Sep 17 00:00:00 2001 From: Mathias G Date: Fri, 17 Apr 2026 12:50:33 +0200 Subject: [PATCH 1/9] renamed lint workflow --- .github/workflows/{pr.yml => linting.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{pr.yml => linting.yml} (100%) diff --git a/.github/workflows/pr.yml b/.github/workflows/linting.yml similarity index 100% rename from .github/workflows/pr.yml rename to .github/workflows/linting.yml From cda3f12f2361e93c3eb791b3d571c21c36ab9ce2 Mon Sep 17 00:00:00 2001 From: Mathias G Date: Fri, 17 Apr 2026 12:52:11 +0200 Subject: [PATCH 2/9] Added changelog check workflow --- .github/workflows/Changelog.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/Changelog.yml diff --git a/.github/workflows/Changelog.yml b/.github/workflows/Changelog.yml new file mode 100644 index 0000000..26a72a2 --- /dev/null +++ b/.github/workflows/Changelog.yml @@ -0,0 +1,21 @@ +name: Check Changelog + +on: pull_request + +jobs: + changelog: + runs-on: ubuntu-latest + name: Changelog should be updated + strategy: + fail-fast: false + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: Git fetch + run: git fetch + + - name: Check that changelog has been updated. + run: git diff --exit-code origin/${{ github.base_ref }} -- changelog.md && exit 1 || exit 0 From 89134cf2c9ffb5fc3045540ce99a0329396b9b5c Mon Sep 17 00:00:00 2001 From: Mathias G Date: Fri, 17 Apr 2026 12:52:22 +0200 Subject: [PATCH 3/9] Added version check workflow --- .github/workflows/Version_Check.yml | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/Version_Check.yml diff --git a/.github/workflows/Version_Check.yml b/.github/workflows/Version_Check.yml new file mode 100644 index 0000000..1b07a4b --- /dev/null +++ b/.github/workflows/Version_Check.yml @@ -0,0 +1,36 @@ +name: Check pyproject.toml Version Change + +on: [pull_request] + +jobs: + check-version: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Get current version in PR branch + id: get-pr-version + run: | + PR_VERSION=$(sed -n -e 's/^version = "\(.*\)"/\1/p' pyproject.toml) + echo "PR_VERSION=$PR_VERSION" >> $GITHUB_ENV + + - name: Get version in base branch + id: get-base-version + run: | + git fetch origin ${{ github.event.pull_request.base.ref }} + git checkout FETCH_HEAD + BASE_VERSION=$(sed -n -e 's/^version = "\(.*\)"/\1/p' pyproject.toml) + echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_ENV + + - name: Compare versions + run: | + echo "PR version: ${{ env.PR_VERSION }}" + echo "Base branch version: ${{ env.BASE_VERSION }}" + + if [ "${{ env.PR_VERSION }}" == "${{ env.BASE_VERSION }}" ]; then + echo "Version number has not been changed." + exit 1 + else + echo "Version number has changed." + fi From ed018466dbdbbafdfc0b3ed993611f5ed4dde17d Mon Sep 17 00:00:00 2001 From: Mathias G Date: Fri, 17 Apr 2026 12:55:17 +0200 Subject: [PATCH 4/9] Added changelog --- CHANGELOG.md | 20 ++++++++++++++++++++ pyproject.toml | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..2e7c5fb --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,20 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [0.1.0] + +### Added + +- Changelog! +- PR workflows. + +## [0.0.1] + +- Initial release + +[0.1.0]: https://github.com/itk-dev-rpa/OpenPostbud/tag/0.1.0 +[0.0.1]: https://github.com/itk-dev-rpa/OpenPostbud/tag/0.0.1 diff --git a/pyproject.toml b/pyproject.toml index f838bc0..277be82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "OpenPostbud" -version = "0.0.1" +version = "0.1.0" authors = [ { name="Mathias Gammelgaard", email="ghbm@aarhus.dk" }, ] From 93b6cd545725ccf68c6a42699fc5bf90e8cde411 Mon Sep 17 00:00:00 2001 From: Mathias G Date: Fri, 17 Apr 2026 13:11:32 +0200 Subject: [PATCH 5/9] Added version number to ui --- .github/workflows/Changelog.yml | 2 +- CHANGELOG.md | 1 + src/OpenPostbud/config.py | 3 +++ src/OpenPostbud/ui_components.py | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Changelog.yml b/.github/workflows/Changelog.yml index 26a72a2..9de6c31 100644 --- a/.github/workflows/Changelog.yml +++ b/.github/workflows/Changelog.yml @@ -18,4 +18,4 @@ jobs: run: git fetch - name: Check that changelog has been updated. - run: git diff --exit-code origin/${{ github.base_ref }} -- changelog.md && exit 1 || exit 0 + run: git diff --exit-code origin/${{ github.base_ref }} -- CHANGELOG.md && exit 1 || exit 0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e7c5fb..e3f3e6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changelog! - PR workflows. +- Version number in UI. ## [0.0.1] diff --git a/src/OpenPostbud/config.py b/src/OpenPostbud/config.py index df3d55a..490f1ee 100644 --- a/src/OpenPostbud/config.py +++ b/src/OpenPostbud/config.py @@ -5,6 +5,7 @@ import os import logging import json +from importlib import metadata import dotenv @@ -49,6 +50,8 @@ def format(self, record: logging.LogRecord): SHIPMENT_LIFETIME_DAYS = int(os.environ['shipment_lifetime_days']) REGISTRATION_JOB_LIFETIME_DAYS = int(os.environ['registration_job_lifetime_days']) +OPENPOSTBUD_VERSION = metadata.version("OpenPostbud") + # Workers CVR = os.environ['cvr'] KOMBIT_CERT_PATH = os.environ['kombit_cert_path'] diff --git a/src/OpenPostbud/ui_components.py b/src/OpenPostbud/ui_components.py index e34e788..ecbab11 100644 --- a/src/OpenPostbud/ui_components.py +++ b/src/OpenPostbud/ui_components.py @@ -7,6 +7,7 @@ from nicegui import ui, app from OpenPostbud.middleware import authentication +from OpenPostbud import config def header(): @@ -32,6 +33,8 @@ def header(): ui.space() ui.label(authentication.get_current_user()).classes('text-lg text-white') ui.label(str(authentication.get_current_user_roles())).classes('text-lg text-white') + ui.separator().props("vertical color=white size=2px") + ui.label(config.OPENPOSTBUD_VERSION).classes('text-lg text-white') ui.button("Log Ud", on_click=authentication.logout, color="white").classes("text-primary") From 68dba6d3da57268361583a1fa2b6ccce536f1880 Mon Sep 17 00:00:00 2001 From: Mathias G Date: Mon, 18 May 2026 12:22:46 +0200 Subject: [PATCH 6/9] Fixed changelog --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3f3e6a..ad04a01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.1.0] +## [Unreleased] ### Added @@ -17,5 +17,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release -[0.1.0]: https://github.com/itk-dev-rpa/OpenPostbud/tag/0.1.0 +[Unreleased]: https://github.com/itk-dev-rpa/OpenPostbud/compare/0.0.1...HEAD [0.0.1]: https://github.com/itk-dev-rpa/OpenPostbud/tag/0.0.1 From 5901b654ff80ae4633eaa2e0782977fade8a70c6 Mon Sep 17 00:00:00 2001 From: Mathias G Date: Mon, 18 May 2026 12:24:52 +0200 Subject: [PATCH 7/9] Fixed changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad04a01..abad543 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,4 +18,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release [Unreleased]: https://github.com/itk-dev-rpa/OpenPostbud/compare/0.0.1...HEAD -[0.0.1]: https://github.com/itk-dev-rpa/OpenPostbud/tag/0.0.1 +[0.0.1]: https://github.com/itk-dev-rpa/OpenPostbud/releases/tag/0.0.1 From b614c995b795300b8eccf0418edf6648fdefb04c Mon Sep 17 00:00:00 2001 From: Mathias G Date: Mon, 18 May 2026 12:25:05 +0200 Subject: [PATCH 8/9] Fixed version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 277be82..f838bc0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "OpenPostbud" -version = "0.1.0" +version = "0.0.1" authors = [ { name="Mathias Gammelgaard", email="ghbm@aarhus.dk" }, ] From 645d6a6f85a36e2e1423bdfcf75958e056f894b2 Mon Sep 17 00:00:00 2001 From: Mathias G Date: Mon, 18 May 2026 13:08:10 +0200 Subject: [PATCH 9/9] Limited workflows to main --- .github/workflows/Version_Check.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Version_Check.yml b/.github/workflows/Version_Check.yml index 1b07a4b..d0387ab 100644 --- a/.github/workflows/Version_Check.yml +++ b/.github/workflows/Version_Check.yml @@ -1,6 +1,9 @@ name: Check pyproject.toml Version Change -on: [pull_request] +on: + pull_request: + branches: + - 'main' jobs: check-version: