pydantic 2 version not always including charm source
Metadata
Current evaluation
Fixed by merged PR #1815 (commit 2a0eb973), restoring default parts for bases charms after the Pydantic 2 migration so source files are packaged.
Resolution: closed resolved
Reason: PR #1815 corrected YAML default-part handling and was merged as commit 2a0eb973. This restored the implicit charm part for bases charms, preventing metadata-only archives.
Evaluated by: mr-cal-bot
No scores available.
Issue body
### Bug Description
the pydantic 2 release sometimes just includes metadata. Seems to happen for bases charms but not platforms ones
### To Reproduce
Run spread tests
### Environment
n/a
### charmcraft.yaml
```shell
n/a
```
### Relevant log output
```shell
2024-08-14 14:58:29 Error executing multipass:ubuntu-22.04-64:tests/spread/smoketests/basic:jammy_bases (multipass:ubuntu-22.04-64) :
-----
+ cd charm
+ charmcraft pack --verbose
2024-08-14 14:57:54.271 Starting charmcraft, version 3.1.1.post65+g70078b0
2024-08-14 14:57:54.271 Logging execution to '/root/.local/state/charmcraft/log/charmcraft-20240814-145754.270839.log'
2024-08-14 14:57:54.271 Log verbosity level set to DEBUG
Starting charmcraft, version 3.1.1.post65+g70078b0
Logging execution to '/root/.local/state/charmcraft/log/charmcraft-20240814-145754.270839.log'
Launching managed ubuntu 22.04 instance...
Creating instance from base instance
Starting instance
Starting charmcraft, version 3.1.1.post65+g70078b0
Logging execution to '/tmp/charmcraft.log'
Starting charmcraft, version 3.1.1.post65+g70078b0
Logging execution to '/tmp/charmcraft.log'
Initialising lifecycle
Installing build-packages
Packing...
Packing charm jammy_ubuntu-22.04-amd64.charm
Packed jammy_ubuntu-22.04-amd64.charm
+ test -f jammy_ubuntu-22.04-amd64.charm
+ unzip -l jammy_ubuntu-22.04-amd64.charm
+ MATCH src/charm.py
grep error: pattern not found, got:
Archive: jammy_ubuntu-22.04-amd64.charm
Length Date Time Name
--------- ---------- ----- ----
271 2024-08-14 14:58 manifest.yaml
156 2024-08-14 14:58 metadata.yaml
--------- -------
427 2 files
-----
.
```
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR #1815 (commit 2a0eb973), restoring default parts for bases charms after the Pydantic 2 migration so source files are packaged. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed by merged PR #1815 (commit 2a0eb973), correcting YAML default-part handling so base charms include source files again after the Pydantic 2 migration. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Pydantic 2 migration caused charmcraft to occasionally omit source files, packaging only metadata. Resolved and closed after being fixed in pull request #1815. | |
| qwen/qwen3.6-35b-a3b | — | — | Pydantic 2 packaging occasionally omitted charm source files, including only metadata. Resolved and merged in pull request #1815. | |
| qwen/qwen3.6-35b-a3b | — | — | Pydantic 2 migration caused charmcraft pack to omit source files, including only metadata. The bug was fixed and merged in pull request #1815, restoring correct packaging behavior. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Charmcraft pack on the pydantic 2 branch occasionally omitted charm source files, including only metadata. The bug was fixed and merged in pull request #1815. |
Update history
No update history recorded yet.
Related work
-
Likely Fixed By:
charmcraft#1815
(confidence 100%)
Merged fix for correctly adding default parts after the Pydantic 2 migration.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1768 Migrate to Pydantic 2 | charmcraft | closed | Migrated Charmcraft to Pydantic 2 via merged PR #1777 (70078b03), with the feature branch merged to main in #1817 (394e6e55). | |
| #1777 feat(deps)!: switch to pydantic 2 | charmcraft | merged | Breaking PR #1777 (commit 70078b03) migrated charmcraft to pydantic 2, absorbing the #1776 unused-code cleanup; merged into main via #1817 (394e6e55) after #1815 fixed YAML default-parts. | |
| #1141 pydantic: split base and charmcraft config models | charmcraft | merged | Merged as commit 17ad0211: common Pydantic models moved to basic.py, and the Charmcraft config moved to charmcraft.py and renamed CharmcraftConfig. |