From 62c24f51893e0b779c957cb322d6f6e04aa25ba2 Mon Sep 17 00:00:00 2001 From: David Runemalm Date: Fri, 11 Jul 2025 18:13:26 +0200 Subject: [PATCH 1/6] fix: dummy change to trigger please release patch bump --- DUMMY_CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 DUMMY_CHANGELOG.md diff --git a/DUMMY_CHANGELOG.md b/DUMMY_CHANGELOG.md new file mode 100644 index 0000000..246686f --- /dev/null +++ b/DUMMY_CHANGELOG.md @@ -0,0 +1 @@ +dummy entry \ No newline at end of file From 8f6624458917a841ae616628da232f997c7e59df Mon Sep 17 00:00:00 2001 From: David Runemalm Date: Tue, 15 Jul 2025 21:38:49 +0200 Subject: [PATCH 2/6] chore(ci): add cz toml file --- .cz.toml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .cz.toml diff --git a/.cz.toml b/.cz.toml new file mode 100644 index 0000000..1cc03bf --- /dev/null +++ b/.cz.toml @@ -0,0 +1,5 @@ +[tool.commitizen] +name = "cz_conventional_commits" +version_files = ["src/codius/version.py"] +changelog_file = "" +changelog-type = "keep-a-changelog" From 4e1059a644ee9eaf7e29c46a195c11610ba8433e Mon Sep 17 00:00:00 2001 From: David Runemalm Date: Tue, 15 Jul 2025 22:46:30 +0200 Subject: [PATCH 3/6] chore(ci): replace bump version package with custom script --- .cz.toml | 5 - .github/scripts/activate-pyenv.sh | 3 - .github/workflows/publish.yml | 40 ---- .github/workflows/release-please.yml | 30 --- .github/workflows/release.yml | 66 +++++++ .release-please-manifest.json | 3 - CHANGELOG.md | 39 ---- DUMMY_CHANGELOG.md | 0 Makefile | 4 + Pipfile | 2 +- Pipfile.lock | 266 ++++++++++++++------------- release-please-config.json | 11 -- scripts/bump_version.py | 63 +++++++ 13 files changed, 272 insertions(+), 260 deletions(-) delete mode 100644 .cz.toml delete mode 100644 .github/scripts/activate-pyenv.sh delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release-please.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .release-please-manifest.json delete mode 100644 CHANGELOG.md delete mode 100644 DUMMY_CHANGELOG.md delete mode 100644 release-please-config.json create mode 100644 scripts/bump_version.py diff --git a/.cz.toml b/.cz.toml deleted file mode 100644 index 1cc03bf..0000000 --- a/.cz.toml +++ /dev/null @@ -1,5 +0,0 @@ -[tool.commitizen] -name = "cz_conventional_commits" -version_files = ["src/codius/version.py"] -changelog_file = "" -changelog-type = "keep-a-changelog" diff --git a/.github/scripts/activate-pyenv.sh b/.github/scripts/activate-pyenv.sh deleted file mode 100644 index 5791174..0000000 --- a/.github/scripts/activate-pyenv.sh +++ /dev/null @@ -1,3 +0,0 @@ -export PYENV_ROOT="$HOME/.pyenv" -export PATH="$PYENV_ROOT/bin:$PATH" -eval "$(pyenv init --path)" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index b6b2a34..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Publish to PyPI - -on: - workflow_run: - workflows: ["Release Please"] - types: - - completed - workflow_dispatch: - -permissions: - contents: write - id-token: write - -jobs: - publish: - if: github.event.workflow_run.conclusion == 'success' && startsWith(github.event.workflow_run.head_commit.message, 'chore(master): release') - - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - - name: Install build dependencies - run: | - python -m pip install --upgrade pip - pip install build - - - name: Build package - run: python -m build - - - name: Publish to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - verbose: true diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml deleted file mode 100644 index e6a8935..0000000 --- a/.github/workflows/release-please.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Release Please - -on: - push: - branches: - - master - -permissions: - contents: write - pull-requests: write - issues: write - checks: write - -jobs: - unittests: - if: github.event.head_commit.author.name != 'github-actions[bot]' - uses: ./.github/workflows/run-unittests.yml - with: - python-versions: '["3.9", "3.10", "3.11", "3.12"]' - - release-please: - name: Release Please - needs: unittests - runs-on: ubuntu-latest - steps: - - name: Run Release Please - uses: googleapis/release-please-action@v4 - with: - config-file: release-please-config.json - manifest-file: .release-please-manifest.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cad7a4a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,66 @@ +name: Release + +on: + push: + branches: + - master + workflow_dispatch: + +permissions: + contents: write + id-token: write + +jobs: + unittests: + uses: ./.github/workflows/run-unittests.yml + with: + python-versions: '["3.9", "3.10", "3.11", "3.12"]' + + release: + needs: unittests + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Install pipenv and dependencies + run: | + python -m pip install --upgrade pip + pip install pipenv + pipenv install --dev + + - name: Auto bump version + id: bump + run: | + python scripts/bump_version.py + VERSION=$(grep '__version__' src/codius/version.py | cut -d'"' -f2) + echo "version=$VERSION" >> $GITHUB_OUTPUT + + - name: Commit and push version bump + run: | + git config user.name "GitHub Actions" + git config user.email "actions@github.com" + git add src/codius/version.py + git commit -m "chore(release): bump version to ${{ steps.bump.outputs.version }}" + git push + + - name: Build package + run: pipenv run python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: true + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: v${{ steps.bump.outputs.version }} + name: Release v${{ steps.bump.outputs.version }} + generate_release_notes: true diff --git a/.release-please-manifest.json b/.release-please-manifest.json deleted file mode 100644 index f66783d..0000000 --- a/.release-please-manifest.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - ".": "0.1.5" -} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 3a0d74a..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,39 +0,0 @@ -# Changelog - -## [0.1.5](https://github.com/runemalm/codius-cli/compare/v0.1.4...v0.1.5) (2025-07-13) - - -### Bug Fixes - -* trigger release-please ([f8f019f](https://github.com/runemalm/codius-cli/commit/f8f019ff9eecb19f24aa5b1cd80c72a1a09d6440)) - -## [0.1.4](https://github.com/runemalm/codius-cli/compare/v0.1.3...v0.1.4) (2025-07-13) - - -### Bug Fixes - -* trigger release-please ([2192d96](https://github.com/runemalm/codius-cli/commit/2192d9619ec62113cc9e3ea9d02326773dcc9c39)) - -## [0.1.3](https://github.com/runemalm/codius-cli/compare/v0.1.2...v0.1.3) (2025-07-13) - - -### Bug Fixes - -* dummy commit for release-please ([87e3758](https://github.com/runemalm/codius-cli/commit/87e37589bfa7d2496071860b4982b84e48c81c3e)) - -## [0.1.2](https://github.com/runemalm/codius-cli/compare/v0.1.1...v0.1.2) (2025-07-13) - - -### Bug Fixes - -* trigger release-please ([95b6982](https://github.com/runemalm/codius-cli/commit/95b698235b62530be63d9975c2da00835cb9e66b)) -* trigger release-please ([7f42f20](https://github.com/runemalm/codius-cli/commit/7f42f2005c1c50f625d0d6a5c068e5029a649ada)) -* trigger release-please ([83995a7](https://github.com/runemalm/codius-cli/commit/83995a78c3e16bf47007c4f18dc5740a9df491a2)) -* trigger release-please ([26b673d](https://github.com/runemalm/codius-cli/commit/26b673d92667d7fb2c2ed822b2a1dad31a567ea2)) -* trigger release-please ([8e1f8f2](https://github.com/runemalm/codius-cli/commit/8e1f8f21d515a52cc5818e62c0030d14ff410440)) -* trigger release-please ([4e63467](https://github.com/runemalm/codius-cli/commit/4e6346726623e26c7f0a47af7a74f73330d36d8c)) -* trigger release-please ([52e84e7](https://github.com/runemalm/codius-cli/commit/52e84e77d806d78afaef73ffe7ef2393c8244ca8)) -* trigger release-please ([4bd91d0](https://github.com/runemalm/codius-cli/commit/4bd91d04d64d779960a92097eb35556ef7e12674)) -* trigger release-please ([e9031f9](https://github.com/runemalm/codius-cli/commit/e9031f9f9af80062ec4be049d120c5daf742d83a)) -* trigger release-please ([9459c1c](https://github.com/runemalm/codius-cli/commit/9459c1cee8770bd6747ef5575105a3c084350e30)) -* trigger release-please ([a938ea0](https://github.com/runemalm/codius-cli/commit/a938ea0ccc9edd050e9d948cb0104fad234e5161)) diff --git a/DUMMY_CHANGELOG.md b/DUMMY_CHANGELOG.md deleted file mode 100644 index e69de29..0000000 diff --git a/Makefile b/Makefile index 7b1d8d8..515a5a9 100644 --- a/Makefile +++ b/Makefile @@ -124,6 +124,10 @@ upload-test: ## upload package to testpypi repository upload: ## upload package to pypi repository TWINE_USERNAME=$(PYPI_USERNAME) TWINE_PASSWORD=$(PYPI_PASSWORD) pipenv run twine upload --skip-existing dist/* +.PHONY: act-release +act-release: ## Run release workflow locally with act + @act push --job release -P ubuntu-latest=catthehacker/ubuntu:act-latest + .PHONY: test-install-all-py test-install-all-py: @for PY in 3.9 3.10 3.11 3.12; do \ diff --git a/Pipfile b/Pipfile index 8c2ef64..7bf5b70 100644 --- a/Pipfile +++ b/Pipfile @@ -24,6 +24,6 @@ pyfakefs = "*" pipfile-requirements = "*" flake8 = "*" twine = "*" -bump2version = "*" +build = "*" [requires] diff --git a/Pipfile.lock b/Pipfile.lock index 67ad013..d901121 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "1ac5b033704c9026fee4eef2192afb7474f374a9bd58419eaa3aa4c261e04f99" + "sha256": "698bab24f4c405b5fd60835eb5552be528e4693de3e67ffd9e39ea3373d32b05" }, "pipfile-spec": 6, "requires": {}, @@ -40,11 +40,11 @@ }, "certifi": { "hashes": [ - "sha256:c1d2ec05395148ee10cf672ffc28cd37ea0ab0d99f9cc74c43e588cbd111b079", - "sha256:d842783a14f8fdd646895ac26f719a061408834473cfc10203f6a575beb15d39" + "sha256:6b31f564a415d79ee77df69d757bb49a5bb53bd9f756cbbe24394ffd6fc1f4b2", + "sha256:8ea99dbdfaaf2ba2f9bac77b9249ef62ec5218e7c2b2e903378ed5fccf765995" ], "markers": "python_version >= '3.7'", - "version": "==2025.7.9" + "version": "==2025.7.14" }, "charset-normalizer": { "hashes": [ @@ -380,12 +380,12 @@ }, "langchain-openai": { "hashes": [ - "sha256:5d5a55adbff739274dfc3a4102925771736f893758f63679b64ae62fed79ca30", - "sha256:efe636c3523978c44adc41cf55c8b3766c05c77547982465884d1258afe705df" + "sha256:4cd6d80a5b2ae471a168017bc01b2e0f01548328d83532400a001623624ede67", + "sha256:6c669548dbdea325c034ae5ef699710e2abd054c7354fdb3ef7bf909dc739d9e" ], "index": "pypi", "markers": "python_version >= '3.9'", - "version": "==0.3.27" + "version": "==0.3.28" }, "langchain-text-splitters": { "hashes": [ @@ -397,12 +397,12 @@ }, "langgraph": { "hashes": [ - "sha256:393b767e9d6a129636a9df36edc492499336c71e4ee268e64b9d1299d30e636c", - "sha256:db6b8053bf99887957fe45ec27918f8819c4bba269afde88b538e00e9301a581" + "sha256:36d4b67f984ff2649d447826fc99b1a2af3e97599a590058f20750048e4f548f", + "sha256:9819b88a6ef6134a0fa6d6121a81b202dc3d17b25cf7ea3fe4d7669b9b252b5d" ], "index": "pypi", "markers": "python_version >= '3.9'", - "version": "==0.5.2" + "version": "==0.5.3" }, "langgraph-checkpoint": { "hashes": [ @@ -422,19 +422,19 @@ }, "langgraph-sdk": { "hashes": [ - "sha256:396d8195881830700e2d54a0a9ee273e8b1173428e667502ef9c182a3cec7ab7", - "sha256:925d3fcc7a26361db04f9c4beb3ec05bc36361b2a836d181ff2ab145071ec3ce" + "sha256:6e6dcdf66bcf8710739899616856527a72a605ce15beb76fbac7f4ce0e2ad080", + "sha256:a60ac33f70688ad07051edff1d5ed8089c8f0de1f69dc900be46e095ca20eed8" ], "markers": "python_version >= '3.9'", - "version": "==0.1.72" + "version": "==0.1.73" }, "langsmith": { "hashes": [ - "sha256:4167717a2cccc4dff5809dbddc439628e836f6fd13d4fdb31ea013bc8d5cfaf5", - "sha256:49444bd8ccd4e46402f1b9ff1d686fa8e3a31b175e7085e72175ab8ec6164a34" + "sha256:900e83fe59ee672bcf2f75c8bb47cd012bf8154d92a99c0355fc38b6485cbd3e", + "sha256:9189dbc9c60f2086ca3a1f0110cfe3aff6b0b7c2e0e3384f9572e70502e7933c" ], "markers": "python_version >= '3.9'", - "version": "==0.4.5" + "version": "==0.4.6" }, "markdown-it-py": { "hashes": [ @@ -521,89 +521,89 @@ }, "openai": { "hashes": [ - "sha256:54bc42df9f7142312647dd485d34cca5df20af825fa64a30ca55164be2cf4cc9", - "sha256:a7afc9dca7e7d616371842af8ea6dbfbcb739a85d183f5f664ab1cc311b9ef18" + "sha256:36e34b5aa2c9c0380c1934fa16ba53b3b3c6462450b4c008b98859b9b6424cf7", + "sha256:4dee023520f8a70ddeaa9f4d6fb247e6dcafd79d2ebb415e3f85932d95aa64a0" ], "markers": "python_version >= '3.8'", - "version": "==1.95.0" + "version": "==1.96.0" }, "orjson": { "hashes": [ - "sha256:0315317601149c244cb3ecef246ef5861a64824ccbcb8018d32c66a60a84ffbc", - "sha256:187aefa562300a9d382b4b4eb9694806e5848b0cedf52037bb5c228c61bb66d4", - "sha256:187ec33bbec58c76dbd4066340067d9ece6e10067bb0cc074a21ae3300caa84e", - "sha256:1ebeda919725f9dbdb269f59bc94f861afbe2a27dce5608cdba2d92772364d1c", - "sha256:22748de2a07fcc8781a70edb887abf801bb6142e6236123ff93d12d92db3d406", - "sha256:2783e121cafedf0d85c148c248a20470018b4ffd34494a68e125e7d5857655d1", - "sha256:2b819ed34c01d88c6bec290e6842966f8e9ff84b7694632e88341363440d4cc0", - "sha256:2d808e34ddb24fc29a4d4041dcfafbae13e129c93509b847b14432717d94b44f", - "sha256:2daf7e5379b61380808c24f6fc182b7719301739e4271c3ec88f2984a2d61f89", - "sha256:2f6c57debaef0b1aa13092822cbd3698a1fb0209a9ea013a969f4efa36bdea57", - "sha256:303565c67a6c7b1f194c94632a4a39918e067bd6176a48bec697393865ce4f06", - "sha256:356b076f1662c9813d5fa56db7d63ccceef4c271b1fb3dd522aca291375fcf17", - "sha256:3a83c9954a4107b9acd10291b7f12a6b29e35e8d43a414799906ea10e75438e6", - "sha256:3d600be83fe4514944500fa8c2a0a77099025ec6482e8087d7659e891f23058a", - "sha256:3f9478ade5313d724e0495d167083c6f3be0dd2f1c9c8a38db9a9e912cdaf947", - "sha256:50c15557afb7f6d63bc6d6348e0337a880a04eaa9cd7c9d569bcb4e760a24753", - "sha256:50ce016233ac4bfd843ac5471e232b865271d7d9d44cf9d33773bcd883ce442b", - "sha256:51f8c63be6e070ec894c629186b1c0fe798662b8687f3d9fdfa5e401c6bd7679", - "sha256:5232d85f177f98e0cefabb48b5e7f60cff6f3f0365f9c60631fecd73849b2a82", - "sha256:53a245c104d2792e65c8d225158f2b8262749ffe64bc7755b00024757d957a13", - "sha256:559eb40a70a7494cd5beab2d73657262a74a2c59aff2068fdba8f0424ec5b39d", - "sha256:57b5d0673cbd26781bebc2bf86f99dd19bd5a9cb55f71cc4f66419f6b50f3d77", - "sha256:5adf5f4eed520a4959d29ea80192fa626ab9a20b2ea13f8f6dc58644f6927103", - "sha256:5e3c9cc2ba324187cd06287ca24f65528f16dfc80add48dc99fa6c836bb3137e", - "sha256:5ef7c164d9174362f85238d0cd4afdeeb89d9e523e4651add6a5d458d6f7d42d", - "sha256:607eb3ae0909d47280c1fc657c4284c34b785bae371d007595633f4b1a2bbe06", - "sha256:641481b73baec8db14fdf58f8967e52dc8bda1f2aba3aa5f5c1b07ed6df50b7f", - "sha256:6612787e5b0756a171c7d81ba245ef63a3533a637c335aa7fcb8e665f4a0966f", - "sha256:69c34b9441b863175cc6a01f2935de994025e773f814412030f269da4f7be147", - "sha256:7115fcbc8525c74e4c2b608129bef740198e9a120ae46184dac7683191042056", - "sha256:73be1cbcebadeabdbc468f82b087df435843c809cd079a565fb16f0f3b23238f", - "sha256:755b6d61ffdb1ffa1e768330190132e21343757c9aa2308c67257cc81a1a6f5a", - "sha256:7592bb48a214e18cd670974f289520f12b7aed1fa0b2e2616b8ed9e069e08595", - "sha256:771474ad34c66bc4d1c01f645f150048030694ea5b2709b87d3bda273ffe505d", - "sha256:7ac6bd7be0dcab5b702c9d43d25e70eb456dfd2e119d512447468f6405b4a69c", - "sha256:7b672502323b6cd133c4af6b79e3bea36bad2d16bca6c1f645903fce83909a7a", - "sha256:7c14047dbbea52886dd87169f21939af5d55143dad22d10db6a7514f058156a8", - "sha256:7f39b371af3add20b25338f4b29a8d6e79a8c7ed0e9dd49e008228a065d07781", - "sha256:86314fdb5053a2f5a5d881f03fca0219bfdf832912aa88d18676a5175c6916b5", - "sha256:8770432524ce0eca50b7efc2a9a5f486ee0113a5fbb4231526d414e6254eba92", - "sha256:8e4b2ae732431127171b875cb2668f883e1234711d3c147ffd69fe5be51a8012", - "sha256:951775d8b49d1d16ca8818b1f20c4965cae9157e7b562a2ae34d3967b8f21c8e", - "sha256:9b0aa09745e2c9b3bf779b096fa71d1cc2d801a604ef6dd79c8b1bfef52b2f92", - "sha256:9da552683bc9da222379c7a01779bddd0ad39dd699dd6300abaf43eadee38334", - "sha256:9dca85398d6d093dd41dc0983cbf54ab8e6afd1c547b6b8a311643917fbf4e0c", - "sha256:9f72f100cee8dde70100406d5c1abba515a7df926d4ed81e20a9730c062fe9ad", - "sha256:a45e5d68066b408e4bc383b6e4ef05e717c65219a9e1390abc6155a520cac402", - "sha256:a6c7c391beaedd3fa63206e5c2b7b554196f14debf1ec9deb54b5d279b1b46f5", - "sha256:ad8eacbb5d904d5591f27dee4031e2c1db43d559edb8f91778efd642d70e6bea", - "sha256:aed411bcb68bf62e85588f2a7e03a6082cc42e5a2796e06e72a962d7c6310b52", - "sha256:afd14c5d99cdc7bf93f22b12ec3b294931518aa019e2a147e8aa2f31fd3240f7", - "sha256:b3ceff74a8f7ffde0b2785ca749fc4e80e4315c0fd887561144059fb1c138aa7", - "sha256:bb70d489bc79b7519e5803e2cc4c72343c9dc1154258adf2f8925d0b60da7c58", - "sha256:be3b9b143e8b9db05368b13b04c84d37544ec85bb97237b3a923f076265ec89c", - "sha256:c28082933c71ff4bc6ccc82a454a2bffcef6e1d7379756ca567c772e4fb3278a", - "sha256:c382a5c0b5931a5fc5405053d36c1ce3fd561694738626c77ae0b1dfc0242ca1", - "sha256:c95fae14225edfd699454e84f61c3dd938df6629a00c6ce15e704f57b58433bb", - "sha256:ce8d0a875a85b4c8579eab5ac535fb4b2a50937267482be402627ca7e7570ee3", - "sha256:e0a183ac3b8e40471e8d843105da6fbe7c070faab023be3b08188ee3f85719b8", - "sha256:e0da26957e77e9e55a6c2ce2e7182a36a6f6b180ab7189315cb0995ec362e049", - "sha256:e450885f7b47a0231979d9c49b567ed1c4e9f69240804621be87c40bc9d3cf17", - "sha256:e54ee3722caf3db09c91f442441e78f916046aa58d16b93af8a91500b7bbf273", - "sha256:e8da3947d92123eda795b68228cafe2724815621fe35e8e320a9e9593a4bcd53", - "sha256:e9e86a6af31b92299b00736c89caf63816f70a4001e750bda179e15564d7a034", - "sha256:f3c29eb9a81e2fbc6fd7ddcfba3e101ba92eaff455b8d602bf7511088bbc0eae", - "sha256:f54c1385a0e6aba2f15a40d703b858bedad36ded0491e55d35d905b2c34a4cc3", - "sha256:f872bef9f042734110642b7a11937440797ace8c87527de25e0c53558b579ccc", - "sha256:f9495ab2611b7f8a0a8a505bcb0f0cbdb5469caafe17b0e404c3c746f9900469", - "sha256:f9f94cf6d3f9cd720d641f8399e390e7411487e493962213390d1ae45c7814fc", - "sha256:fdba703c722bd868c04702cac4cb8c6b8ff137af2623bc0ddb3b3e6a2c8996c1", - "sha256:fdd9d68f83f0bc4406610b1ac68bdcded8c5ee58605cc69e643a06f4d075f429", - "sha256:fe8936ee2679e38903df158037a2f1c108129dee218975122e37847fb1d4ac68" + "sha256:02dd4f0a1a2be943a104ce5f3ec092631ee3e9f0b4bb9eeee3400430bd94ddef", + "sha256:05f094edd2b782650b0761fd78858d9254de1c1286f5af43145b3d08cdacfd51", + "sha256:0759b36428067dc777b202dd286fbdd33d7f261c6455c4238ea4e8474358b1e6", + "sha256:0846e13abe79daece94a00b92574f294acad1d362be766c04245b9b4dd0e47e1", + "sha256:08e191f8a55ac2c00be48e98a5d10dca004cbe8abe73392c55951bfda60fc123", + "sha256:105bca887532dc71ce4b05a5de95dea447a310409d7a8cf0cb1c4a120469e9ad", + "sha256:1235fe7bbc37164f69302199d46f29cfb874018738714dccc5a5a44042c79c77", + "sha256:1785df7ada75c18411ff7e20ac822af904a40161ea9dfe8c55b3f6b66939add6", + "sha256:2560b740604751854be146169c1de7e7ee1e6120b00c1788ec3f3a012c6a243f", + "sha256:28acd19822987c5163b9e03a6e60853a52acfee384af2b394d11cb413b889246", + "sha256:2a585042104e90a61eda2564d11317b6a304eb4e71cd33e839f5af6be56c34d3", + "sha256:2e4c129da624f291bcc607016a99e7f04a353f6874f3bd8d9b47b88597d5f700", + "sha256:2fb8ca8f0b4e31b8aaec674c7540649b64ef02809410506a44dc68d31bd5647b", + "sha256:325be41a8d7c227d460a9795a181511ba0e731cf3fee088c63eb47e706ea7559", + "sha256:359cbe11bc940c64cb3848cf22000d2aef36aff7bfd09ca2c0b9cb309c387132", + "sha256:41b38a894520b8cb5344a35ffafdf6ae8042f56d16771b2c5eb107798cee85ee", + "sha256:4305a638f4cf9bed3746ca3b7c242f14e05177d5baec2527026e0f9ee6c24fb7", + "sha256:4430ec6ff1a1f4595dd7e0fad991bdb2fed65401ed294984c490ffa025926325", + "sha256:475491bb78af2a0170f49e90013f1a0f1286527f3617491f8940d7e5da862da7", + "sha256:47a54e660414baacd71ebf41a69bb17ea25abb3c5b69ce9e13e43be7ac20e342", + "sha256:4a8ba9698655e16746fdf5266939427da0f9553305152aeb1a1cc14974a19cfb", + "sha256:4bfcfe498484161e011f8190a400591c52b026de96b3b3cbd3f21e8999b9dc0e", + "sha256:51646f6d995df37b6e1b628f092f41c0feccf1d47e3452c6e95e2474b547d842", + "sha256:51cdca2f36e923126d0734efaf72ddbb5d6da01dbd20eab898bdc50de80d7b5a", + "sha256:5579acd235dd134467340b2f8a670c1c36023b5a69c6a3174c4792af7502bd92", + "sha256:5587c85ae02f608a3f377b6af9eb04829606f518257cbffa8f5081c1aacf2e2f", + "sha256:57e8e7198a679ab21241ab3f355a7990c7447559e35940595e628c107ef23736", + "sha256:5f797d57814975b78f5f5423acb003db6f9be5186b72d48bd97a1000e89d331d", + "sha256:613e54a2b10b51b656305c11235a9c4a5c5491ef5c283f86483d4e9e123ed5e4", + "sha256:63c1c9772dafc811d16d6a7efa3369a739da15d1720d6e58ebe7562f54d6f4a2", + "sha256:64a6a3e94a44856c3f6557e6aa56a6686544fed9816ae0afa8df9077f5759791", + "sha256:67133847f9a35a5ef5acfa3325d4a2f7fe05c11f1505c4117bb086fc06f2a58f", + "sha256:6d09176a4a9e04a5394a4a0edd758f645d53d903b306d02f2691b97d5c736a9e", + "sha256:6d750b97d22d5566955e50b02c622f3a1d32744d7a578c878b29a873190ccb7a", + "sha256:720b4bb5e1b971960a62c2fa254c2d2a14e7eb791e350d05df8583025aa59d15", + "sha256:7cf728cb3a013bdf9f4132575404bf885aa773d8bb4205656575e1890fc91990", + "sha256:8335a0ba1c26359fb5c82d643b4c1abbee2bc62875e0f2b5bde6c8e9e25eb68c", + "sha256:84ae3d329360cf18fb61b67c505c00dedb61b0ee23abfd50f377a58e7d7bed06", + "sha256:8514f9f9c667ce7d7ef709ab1a73e7fcab78c297270e90b1963df7126d2b0e23", + "sha256:894635df36c0be32f1c8c8607e853b8865edb58e7618e57892e85d06418723eb", + "sha256:8bf058105a8aed144e0d1cfe7ac4174748c3fc7203f225abaeac7f4121abccb0", + "sha256:923301f33ea866b18f8836cf41d9c6d33e3b5cab8577d20fed34ec29f0e13a0d", + "sha256:93b64b254414e2be55ac5257124b5602c5f0b4d06b80bd27d1165efe8f36e836", + "sha256:9457ccbd8b241fb4ba516417a4c5b95ba0059df4ac801309bcb4ec3870f45ad9", + "sha256:99d17aab984f4d029b8f3c307e6be3c63d9ee5ef55e30d761caf05e883009949", + "sha256:9b6fbc2fc825aff1456dd358c11a0ad7912a4cb4537d3db92e5334af7463a967", + "sha256:9d4d86910554de5c9c87bc560b3bdd315cc3988adbdc2acf5dda3797079407ed", + "sha256:9dac7fbf3b8b05965986c5cfae051eb9a30fced7f15f1d13a5adc608436eb486", + "sha256:a2788f741e5a0e885e5eaf1d91d0c9106e03cb9575b0c55ba36fd3d48b0b1e9b", + "sha256:a57899bebbcea146616a2426d20b51b3562b4bc9f8039a3bd14fae361c23053d", + "sha256:a640e3954e7b4fcb160097551e54cafbde9966be3991932155b71071077881aa", + "sha256:aa1120607ec8fc98acf8c54aac6fb0b7b003ba883401fa2d261833111e2fa071", + "sha256:acf5a63ae9cdb88274126af85913ceae554d8fd71122effa24a53227abbeee16", + "sha256:b4089f940c638bb1947d54e46c1cd58f4259072fcc97bc833ea9c78903150ac9", + "sha256:b5a4214ea59c8a3b56f8d484b28114af74e9fba0956f9be5c3ce388ae143bf1f", + "sha256:b5a8243e73690cc6e9151c9e1dd046a8f21778d775f7d478fa1eb4daa4897c61", + "sha256:b8913baba9751f7400f8fa4ec18a8b618ff01177490842e39e47b66c1b04bc79", + "sha256:c27de273320294121200440cd5002b6aeb922d3cb9dab3357087c69f04ca6934", + "sha256:c4b48d9775b0cf1f0aca734f4c6b272cbfacfac38e6a455e6520662f9434afb7", + "sha256:c60c99fe1e15894367b0340b2ff16c7c69f9c3f3a54aa3961a58c102b292ad94", + "sha256:c7a1964a71c1567b4570c932a0084ac24ad52c8cf6253d1881400936565ed438", + "sha256:d2218629dbfdeeb5c9e0573d59f809d42f9d49ae6464d2f479e667aee14c3ef4", + "sha256:d69f95d484938d8fab5963e09131bcf9fbbb81fa4ec132e316eb2fb9adb8ce78", + "sha256:d79c180cfb3ae68f13245d0ff551dca03d96258aa560830bf8a223bd68d8272c", + "sha256:d9760217b84d1aee393b4436fbe9c639e963ec7bc0f2c074581ce5fb3777e466", + "sha256:dd7f9cd995da9e46fbac0a371f0ff6e89a21d8ecb7a8a113c0acb147b0a32f73", + "sha256:e8d38d9e1e2cf9729658e35956cf01e13e89148beb4cb9e794c9c10c5cb252f8", + "sha256:e98f02e23611763c9e5dfcb83bd33219231091589f0d1691e721aea9c52bf329", + "sha256:ebeecd5d5511b3ca9dc4e7db0ab95266afd41baf424cc2fad8c2d3a3cdae650a", + "sha256:f018ed1986d79434ac712ff19f951cd00b4dfcb767444410fbb834ebec160abf", + "sha256:fe36e5012f886ff91c68b87a499c227fa220e9668cea96335219874c8be5fab5", + "sha256:feaed3ed43a1d2df75c039798eb5ec92c350c7d86be53369bafc4f3700ce7df2" ], "markers": "python_version >= '3.9'", - "version": "==3.10.18" + "version": "==3.11.0" }, "ormsgpack": { "hashes": [ @@ -1202,7 +1202,7 @@ "sha256:38b39f4aeeab64884ce9f74c94263ef78f3c22467c8724005483154c26648d36", "sha256:d1e1e3b58374dc93031d6eda2420a48ea44a36c2b4766a4fdeb3710755731d76" ], - "markers": "python_version < '3.13'", + "markers": "python_version < '3.11'", "version": "==4.14.1" }, "typing-inspection": { @@ -1470,22 +1470,22 @@ "markers": "python_version < '3.12'", "version": "==1.2.0" }, - "bump2version": { + "build": { "hashes": [ - "sha256:37f927ea17cde7ae2d7baf832f8e80ce3777624554a653006c9144f8017fe410", - "sha256:762cb2bfad61f4ec8e2bdf452c7c267416f8c70dd9ecb1653fd0bbb01fa936e6" + "sha256:1d61c0887fa860c01971625baae8bdd338e517b836a2f70dd1f7aa3a6b2fc5b5", + "sha256:b36993e92ca9375a219c99e606a122ff365a760a2d4bba0caa09bd5278b608b7" ], "index": "pypi", - "markers": "python_version >= '3.5'", - "version": "==1.0.1" + "markers": "python_version >= '3.8'", + "version": "==1.2.2.post1" }, "certifi": { "hashes": [ - "sha256:c1d2ec05395148ee10cf672ffc28cd37ea0ab0d99f9cc74c43e588cbd111b079", - "sha256:d842783a14f8fdd646895ac26f719a061408834473cfc10203f6a575beb15d39" + "sha256:6b31f564a415d79ee77df69d757bb49a5bb53bd9f756cbbe24394ffd6fc1f4b2", + "sha256:8ea99dbdfaaf2ba2f9bac77b9249ef62ec5218e7c2b2e903378ed5fccf765995" ], "markers": "python_version >= '3.7'", - "version": "==2025.7.9" + "version": "==2025.7.14" }, "charset-normalizer": { "hashes": [ @@ -1632,7 +1632,7 @@ "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000", "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd" ], - "markers": "python_version < '3.10'", + "markers": "python_full_version < '3.10.2'", "version": "==8.7.0" }, "iniconfig": { @@ -1709,33 +1709,35 @@ }, "nh3": { "hashes": [ - "sha256:087ffadfdcd497658c3adc797258ce0f06be8a537786a7217649fc1c0c60c293", - "sha256:20979783526641c81d2f5bfa6ca5ccca3d1e4472474b162c6256745fbfe31cd1", - "sha256:2a5174551f95f2836f2ad6a8074560f261cf9740a48437d6151fd2d4d7d617ab", - "sha256:31eedcd7d08b0eae28ba47f43fd33a653b4cdb271d64f1aeda47001618348fde", - "sha256:4990e7ee6a55490dbf00d61a6f476c9a3258e31e711e13713b2ea7d6616f670e", - "sha256:55823c5ea1f6b267a4fad5de39bc0524d49a47783e1fe094bcf9c537a37df251", - "sha256:6141caabe00bbddc869665b35fc56a478eb774a8c1dfd6fba9fe1dfdf29e6efa", - "sha256:637d4a10c834e1b7d9548592c7aad760611415fcd5bd346f77fd8a064309ae6d", - "sha256:63ca02ac6f27fc80f9894409eb61de2cb20ef0a23740c7e29f9ec827139fa578", - "sha256:6ae319f17cd8960d0612f0f0ddff5a90700fa71926ca800e9028e7851ce44a6f", - "sha256:6c9c30b8b0d291a7c5ab0967ab200598ba33208f754f2f4920e9343bdd88f79a", - "sha256:713d16686596e556b65e7f8c58328c2df63f1a7abe1277d87625dcbbc012ef82", - "sha256:818f2b6df3763e058efa9e69677b5a92f9bc0acff3295af5ed013da544250d5b", - "sha256:9d67709bc0d7d1f5797b21db26e7a8b3d15d21c9c5f58ccfe48b5328483b685b", - "sha256:a5f77e62aed5c4acad635239ac1290404c7e940c81abe561fd2af011ff59f585", - "sha256:a772dec5b7b7325780922dd904709f0f5f3a79fbf756de5291c01370f6df0967", - "sha256:a7ea28cd49293749d67e4fcf326c554c83ec912cd09cd94aa7ec3ab1921c8283", - "sha256:ac7006c3abd097790e611fe4646ecb19a8d7f2184b882f6093293b8d9b887431", - "sha256:b3b5c58161e08549904ac4abd450dacd94ff648916f7c376ae4b2c0652b98ff9", - "sha256:b8d55ea1fc7ae3633d758a92aafa3505cd3cc5a6e40470c9164d54dff6f96d42", - "sha256:bb0014948f04d7976aabae43fcd4cb7f551f9f8ce785a4c9ef66e6c2590f8629", - "sha256:d002b648592bf3033adfd875a48f09b8ecc000abd7f6a8769ed86b6ccc70c759", - "sha256:d426d7be1a2f3d896950fe263332ed1662f6c78525b4520c8e9861f8d7f0d243", - "sha256:fcff321bd60c6c5c9cb4ddf2554e22772bb41ebd93ad88171bbbb6f271255286" + "sha256:0e9e93c67d1ec8db6d96e323832bd267cdfe94bdb8cc6adc88cbc0908ff59329", + "sha256:10e8d0a833431860620f7f1434792607ca12cdfda81450a2678b8d69642eda69", + "sha256:29baf3c22d6e9d26325128600355baeddb52eecd6206780621f84537ad4db966", + "sha256:2a6e33de39218eded7187aaf05aea71884b1b8002d50d080a95df734d3ad3a44", + "sha256:4743c9132e2ccf2109af88ce16074c5a7068df85be8f7b9840dbe683e50b9461", + "sha256:4f47991a9819f644918aebc2a93d175562c7c0c2ec41cbc525fbdbf676793c03", + "sha256:56b328457370401aaf2039a5039d7f587e72b2c08bc95dfe807ad96ae98e83e4", + "sha256:602ad5229c81a287c8632ea1bf2d6b3654b3e208b57b0bcab5beec93ff91866f", + "sha256:60e1d4429762745a5a346277dc3378aade0e24632f75077f0da3bfc29bf385fd", + "sha256:74039dfd41107bbb298fe814c4be5c39d66124855ff549d216e4947a69d3d9a1", + "sha256:7f186eea285ebf941fbaaecd1cd445e9506552a15435140ca73ca029334715da", + "sha256:87e532f885937c460ccbdc1b5ea03b0e420de8ef12dd5857621706298857b9aa", + "sha256:9bbeb3d253c1026a46e7b23bc2698fe1f00641b5a7bdad8e4c8937daaa1f2b51", + "sha256:9d10f4c195f3b84a8127417ec940e1393062a3e2f05d405270dde7846854e22c", + "sha256:a78a13f5bf5901f5de50580a74058a10734d3e836144cb090f0304ec5deb3df7", + "sha256:adbb35826fad998f88f68b969e3936dff53b70052c9e6e951ef9e49db9590611", + "sha256:b71ea8e987923e2976a99e4bb17e39cc186c93a330712075650e6143cb2fa89b", + "sha256:bcac2a186791c422ce55522cae332c8fa2135795b7b510e2475cb95a44f7b0ce", + "sha256:c61fbfe4131ceff1c83ed0663c39aebb72bd26c6b22157b14da0b43287ea15ed", + "sha256:ca015dbd477e20a29bee8660a966523c677da0c34dfeb474c6acb64462fbfc15", + "sha256:cb91663dcf139da2009d452aad23094e01579c45a6101b2a0b0c28181b8c496f", + "sha256:dbfaa924ba226331c75896a64fe161a0cbd21172e4da687b2a69b5101db2c3e9", + "sha256:e9762845ee47372df425b52ec4a133e994dbbedf95ad61eea4bfe6cb4d1401b4", + "sha256:f45f8a2347da8c9682f9b015cf9d492fdb8440cfb7bd523cceda1a705fd5a4bd", + "sha256:f94ed44f433e2f8799f5285000f799e9f3ca66559328e40066c0f96c4fbad346", + "sha256:fee209eb0d93830908e4f6fc549c08766def701f5681de2779637a00d48f288f" ], "markers": "python_version >= '3.8'", - "version": "==0.2.21" + "version": "==0.2.22" }, "packaging": { "hashes": [ @@ -1794,6 +1796,14 @@ "markers": "python_version >= '3.8'", "version": "==2.19.2" }, + "pyproject-hooks": { + "hashes": [ + "sha256:1e859bd5c40fae9448642dd871adf459e5e2084186e8d2c2a79a824c970da1f8", + "sha256:9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913" + ], + "markers": "python_version >= '3.7'", + "version": "==1.2.0" + }, "pytest": { "hashes": [ "sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7", @@ -1904,7 +1914,7 @@ "sha256:38b39f4aeeab64884ce9f74c94263ef78f3c22467c8724005483154c26648d36", "sha256:d1e1e3b58374dc93031d6eda2420a48ea44a36c2b4766a4fdeb3710755731d76" ], - "markers": "python_version < '3.13'", + "markers": "python_version < '3.11'", "version": "==4.14.1" }, "urllib3": { diff --git a/release-please-config.json b/release-please-config.json deleted file mode 100644 index 1d62617..0000000 --- a/release-please-config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "https://github.com/googleapis/release-please/blob/main/schemas/manifest-schema.json", - "packages": - { - ".": - { - "release-type": "python", - "skip-changelog": true - } - } -} \ No newline at end of file diff --git a/scripts/bump_version.py b/scripts/bump_version.py new file mode 100644 index 0000000..5266102 --- /dev/null +++ b/scripts/bump_version.py @@ -0,0 +1,63 @@ +import re +import subprocess +import sys +from pathlib import Path + +VERSION_FILE = Path("src/codius/version.py") + +def read_version(): + content = VERSION_FILE.read_text() + match = re.search(r'__version__ = "(\d+)\.(\d+)\.(\d+)"', content) + if not match: + sys.exit("Could not find version string.") + return tuple(map(int, match.groups())) + +def write_version(version): + major, minor, patch = version + new_content = re.sub( + r'__version__ = "(\d+)\.(\d+)\.(\d+)"', + f'__version__ = "{major}.{minor}.{patch}"', + VERSION_FILE.read_text(), + ) + VERSION_FILE.write_text(new_content) + print(f"Bumped to {major}.{minor}.{patch}") + +def detect_bump_type(): + result = subprocess.run( + ["git", "log", "$(git describe --tags --abbrev=0)..HEAD", "--pretty=format:%s"], + stdout=subprocess.PIPE, + text=True, + shell=True, + ) + + commits = result.stdout.splitlines() + + if any("BREAKING CHANGE" in c or "!" in c.split(":")[0] for c in commits): + return "major" + if any(c.startswith("feat:") for c in commits): + return "minor" + if any(c.startswith("fix:") for c in commits): + return "patch" + return "patch" + +def bump_version(bump_type): + major, minor, patch = read_version() + + if bump_type == "major": + major += 1 + minor = 0 + patch = 0 + elif bump_type == "minor": + minor += 1 + patch = 0 + elif bump_type == "patch": + patch += 1 + else: + sys.exit(f"Unknown bump type: {bump_type}") + + write_version((major, minor, patch)) + +if __name__ == "__main__": + bump_type = detect_bump_type() + print(f"Detected bump type: {bump_type}") + bump_version(bump_type) From ae3f6e23313707d4d89fc12d8b881345b0a2be35 Mon Sep 17 00:00:00 2001 From: David Runemalm Date: Tue, 15 Jul 2025 22:51:25 +0200 Subject: [PATCH 4/6] chore: install typing-extensions missing after uninstalled package --- Pipfile | 9 +++++---- Pipfile.lock | 8 +++++--- src/codius/version.py | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Pipfile b/Pipfile index 7bf5b70..5dd6037 100644 --- a/Pipfile +++ b/Pipfile @@ -17,13 +17,14 @@ prompt-toolkit = "*" rich = "*" tree-sitter = "0.23.2" tree-sitter-c-sharp = "*" +typing-extensions = "*" [dev-packages] -pytest = "*" -pyfakefs = "*" -pipfile-requirements = "*" +build = "*" flake8 = "*" +pipfile-requirements = "*" +pyfakefs = "*" +pytest = "*" twine = "*" -build = "*" [requires] diff --git a/Pipfile.lock b/Pipfile.lock index d901121..6fb45bc 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "698bab24f4c405b5fd60835eb5552be528e4693de3e67ffd9e39ea3373d32b05" + "sha256": "93c527c1b70181051a4db0bb43e5748cef182388ca4789c15f7b10a79ca02044" }, "pipfile-spec": 6, "requires": {}, @@ -1202,7 +1202,8 @@ "sha256:38b39f4aeeab64884ce9f74c94263ef78f3c22467c8724005483154c26648d36", "sha256:d1e1e3b58374dc93031d6eda2420a48ea44a36c2b4766a4fdeb3710755731d76" ], - "markers": "python_version < '3.11'", + "index": "pypi", + "markers": "python_version >= '3.9'", "version": "==4.14.1" }, "typing-inspection": { @@ -1914,7 +1915,8 @@ "sha256:38b39f4aeeab64884ce9f74c94263ef78f3c22467c8724005483154c26648d36", "sha256:d1e1e3b58374dc93031d6eda2420a48ea44a36c2b4766a4fdeb3710755731d76" ], - "markers": "python_version < '3.11'", + "index": "pypi", + "markers": "python_version >= '3.9'", "version": "==4.14.1" }, "urllib3": { diff --git a/src/codius/version.py b/src/codius/version.py index 1276d02..bbab024 100644 --- a/src/codius/version.py +++ b/src/codius/version.py @@ -1 +1 @@ -__version__ = "0.1.5" +__version__ = "0.1.4" From a16a2f1db572f0f67b4242e212f5315e3c3ccd4c Mon Sep 17 00:00:00 2001 From: David Runemalm Date: Tue, 15 Jul 2025 23:33:17 +0200 Subject: [PATCH 5/6] feat: add support for adding value object intents --- .../domain/model/intents/intent_type.py | 2 +- .../model/prompts/distill_intent_prompt.py | 8 ++-- .../model/prompts/plan_changes_prompt.py | 46 +++++++++++++++---- .../model/value_object/value_object.cs.j2 | 16 +++++++ tests/integration/behaviour/plan/__init__.py | 0 .../behaviour/plan/test_plan_value_objects.py | 46 +++++++++++++++++++ 6 files changed, 103 insertions(+), 15 deletions(-) create mode 100644 src/codius/infrastructure/services/code_generator/templates/domain/model/value_object/value_object.cs.j2 create mode 100644 tests/integration/behaviour/plan/__init__.py create mode 100644 tests/integration/behaviour/plan/test_plan_value_objects.py diff --git a/src/codius/domain/model/intents/intent_type.py b/src/codius/domain/model/intents/intent_type.py index 74f7793..1437659 100644 --- a/src/codius/domain/model/intents/intent_type.py +++ b/src/codius/domain/model/intents/intent_type.py @@ -12,8 +12,8 @@ class IntentType(str, Enum): REMOVE_AGGREGATE_METHOD_PARAMETER = "remove_aggregate_method_parameter" ADD_VALUE_OBJECT = "add_value_object" - REMOVE_VALUE_OBJECT = "remove_value_object" ADD_VALUE_OBJECT_PROPERTY = "add_value_object_property" + REMOVE_VALUE_OBJECT = "remove_value_object" REMOVE_VALUE_OBJECT_PROPERTY = "remove_value_object_property" ADD_REPOSITORY = "add_repository" diff --git a/src/codius/domain/model/prompts/distill_intent_prompt.py b/src/codius/domain/model/prompts/distill_intent_prompt.py index 9ce105a..3949d69 100644 --- a/src/codius/domain/model/prompts/distill_intent_prompt.py +++ b/src/codius/domain/model/prompts/distill_intent_prompt.py @@ -32,16 +32,16 @@ class DistillIntentPrompt: def as_prompt(self) -> str: example_intents = [ AddAggregateIntent, - RemoveAggregateIntent, AddAggregateMethodIntent, - RemoveAggregateMethodIntent, AddAggregatePropertyIntent, - RemoveAggregatePropertyIntent, AddAggregateMethodParameterIntent, + RemoveAggregateIntent, + RemoveAggregateMethodIntent, + RemoveAggregatePropertyIntent, RemoveAggregateMethodParameterIntent, AddValueObjectIntent, - RemoveValueObjectIntent, AddValueObjectPropertyIntent, + RemoveValueObjectIntent, RemoveValueObjectPropertyIntent, AddRepositoryIntent, AddRepositoryMethodIntent, diff --git a/src/codius/domain/model/prompts/plan_changes_prompt.py b/src/codius/domain/model/prompts/plan_changes_prompt.py index 6c060f7..cbf4bb4 100644 --- a/src/codius/domain/model/prompts/plan_changes_prompt.py +++ b/src/codius/domain/model/prompts/plan_changes_prompt.py @@ -49,6 +49,14 @@ def as_prompt(self) -> str: for step in example_steps ) + supported_templates = [ + "domain/model/aggregate/aggregate_root", + "domain/model/value_object/value_object", + # Add more here as needed + ] + + template_section = "\n".join(f"- {t}" for t in supported_templates) + sources_section = "\n\n".join( f"### File: {path}\n```csharp\n{content.strip()}\n```" for path, content in self.sources.items() @@ -69,34 +77,52 @@ def as_prompt(self) -> str: return f""" You are a Domain-Driven Design (DDD) planning assistant for OpenDDD.NET. -Your task is to plan the necessary code changes for the following modeling intents based on the current source files. +Your task is to plan the necessary code changes for the following modeling intents based on the current project metadata and source files. + +For each intent: + +- Determine if a new file must be created or an existing file modified. +- Describe each code change as a **plan step** using a JSON object with: + - `"type"`: `"create_file"` or `"modify_file"`. + - `"path"`: relative path where the file is created or modified. + - `"description"`: a short explanation of the change. + - For `"create_file"`: + - `"template"`: the name of the template used. Must match one of the supported templates listed below. + - `"context"`: all required data for the template. + - For `"modify_file"`: + - `"modification"`: the kind of modification (`add_method`, `add_property`, etc.). + - `"context"`: details about what to add or change. + +✅ All C# class, method, and property names must use PascalCase. +✅ Only return a **JSON list of plan steps** — no markdown, no explanations, no comments. + +--- -Each plan step should be a JSON object describing: -- Whether to **create a new file** (using a template) or **modify an existing file** -- What operation to perform (`create_file` or `modify_file`) -- Where to place it (`path`) -- Either: - - A template name and context for creation - - A modification type and context for modification -- All C# class and property names must use PascalCase. +## Supported Templates: -Only return a **list of plan steps as valid JSON** — no markdown, no prose, no explanation. +{template_section} --- ## Project Metadata: {project_context} +--- + ## Modeling Intents: ```json {intents_json} ``` +--- + ## Source Files: {sources_section} +--- + ## Example Plan Steps: {example_blocks} diff --git a/src/codius/infrastructure/services/code_generator/templates/domain/model/value_object/value_object.cs.j2 b/src/codius/infrastructure/services/code_generator/templates/domain/model/value_object/value_object.cs.j2 new file mode 100644 index 0000000..5f513be --- /dev/null +++ b/src/codius/infrastructure/services/code_generator/templates/domain/model/value_object/value_object.cs.j2 @@ -0,0 +1,16 @@ +namespace {{ namespace }} +{ + public class {{ value_object_name }} + { + {% for p in properties %} + public {{ p.type }} {{ p.name }} { get; set; } + {% endfor %} + + public {{ value_object_name }}({% for p in properties %}{{ p.type }} {{ p.name|lower }}{% if not loop.last %}, {% endif %}{% endfor %}) + { + {% for p in properties %} + {{ p.name }} = {{ p.name|lower }}; + {% endfor %} + } + } +} diff --git a/tests/integration/behaviour/plan/__init__.py b/tests/integration/behaviour/plan/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/integration/behaviour/plan/test_plan_value_objects.py b/tests/integration/behaviour/plan/test_plan_value_objects.py new file mode 100644 index 0000000..6befba8 --- /dev/null +++ b/tests/integration/behaviour/plan/test_plan_value_objects.py @@ -0,0 +1,46 @@ +import pytest +from codius.graph.nodes.plan_changes import plan_changes + + +@pytest.mark.integration +def test_plan_add_value_object_step(tmp_path): + # Arrange: simulate minimal project structure + state = { + "intent": [ + { + "intent": "add_value_object", + "target": "Color", + "properties": [ + { "name": "Name", "type": "string" }, + { "name": "HexCode", "type": "string" } + ] + } + ], + "sources": {}, + "project_metadata": { + "project_name": "MyApp", + "root_namespace": "MyApp", + "project_root": str(tmp_path), + "source_path": str(tmp_path), + "domain_path": str(tmp_path / "Domain"), + "application_path": str(tmp_path / "Application"), + "infrastructure_path": str(tmp_path / "Infrastructure"), + "interchange_path": str(tmp_path / "Interchange"), + "tests_path": str(tmp_path / "Tests") + } + } + + # Act + result = plan_changes(state) + + # Assert + assert "plan" in result + plan = result["plan"] + assert isinstance(plan, list) + + create_steps = [step for step in plan if step.get("type") == "create_file"] + assert any("Color.cs" in step.get("path", "") for step in create_steps) + + # Optional: print for manual inspection + for step in plan: + print(step) From 7ce2f15113da9fe62de223e84fb591f7dcf258e1 Mon Sep 17 00:00:00 2001 From: David Runemalm Date: Tue, 15 Jul 2025 23:39:30 +0200 Subject: [PATCH 6/6] chore: add missing permission to release workflow --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cad7a4a..3f2e365 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,6 +9,7 @@ on: permissions: contents: write id-token: write + checks: write jobs: unittests: