Skip to content

Commit

Permalink
chore(release): merge 3.3.2 to main (#2121)
Browse files Browse the repository at this point in the history
This merges all the bugfixes from the 3.3 branch to main.
  • Loading branch information
lengau authored Jan 27, 2025
2 parents c55b8a4 + 6785820 commit 0760303
Show file tree
Hide file tree
Showing 38 changed files with 643 additions and 1,042 deletions.
7 changes: 0 additions & 7 deletions charmcraft/application/commands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,8 @@
├── tests
│ ├── integration
│ │ └── test_charm.py - Integration tests
│ ├── spread
│ │ ├── lib
│ │ │ └── test-helpers.sh
│ │ └── general
│ │ └── integration
│ │ └── task.yaml - Run integration tests in spread back-end
│ └── unit
│ └── test_charm.py - Unit tests
├── spread.yaml - Spread testing configuration file
└── tox.ini - Configuration for tox, the tool to run all tests
You will need to edit at least charmcraft.yaml and README.md.
Expand Down
7 changes: 5 additions & 2 deletions charmcraft/application/commands/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -1655,6 +1655,7 @@ def run(self, parsed_args):
to_query = [{"lib_id": lib.lib_id, "api": lib.api} for lib in local_libs_data]
libs_tips = store.get_libraries_tips(to_query)
analysis = []
return_code = 0
for lib_data in local_libs_data:
emit.debug(f"Verifying local lib {lib_data}")
tip = libs_tips.get((lib_data.lib_id, lib_data.api))
Expand All @@ -1668,6 +1669,7 @@ def run(self, parsed_args):
pass
elif tip.patch > lib_data.patch:
# the store is more advanced than local
return_code = 1
error_message = (
f"Library {lib_data.full_name} is out-of-date locally, Charmhub has "
f"version {tip.api:d}.{tip.patch:d}, please "
Expand All @@ -1681,6 +1683,7 @@ def run(self, parsed_args):
)
else:
# but shouldn't as hash is different!
return_code = 1
error_message = (
f"Library {lib_data.full_name} version {tip.api:d}.{tip.patch:d} "
"is the same than in Charmhub but content is different"
Expand All @@ -1689,12 +1692,14 @@ def run(self, parsed_args):
# local is correctly incremented
if tip.content_hash == lib_data.content_hash:
# but shouldn't as hash is the same!
return_code = 1
error_message = (
f"Library {lib_data.full_name} LIBPATCH number was incorrectly "
"incremented, Charmhub has the "
f"same content in version {tip.api:d}.{tip.patch:d}."
)
else:
return_code = 1
error_message = (
f"Library {lib_data.full_name} has a wrong LIBPATCH number, it's too high "
"and needs to be consecutive, Charmhub "
Expand All @@ -1703,7 +1708,6 @@ def run(self, parsed_args):
analysis.append((lib_data, error_message))

# work on the analysis result, showing messages to the user if not programmatic output
return_code = 0
for lib_data, error_message in analysis:
if error_message is None:
store.create_library_revision(
Expand All @@ -1720,7 +1724,6 @@ def run(self, parsed_args):
)
else:
message = error_message
return_code = 1
if not parsed_args.format:
emit.message(message)

Expand Down
9 changes: 7 additions & 2 deletions charmcraft/application/commands/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
_overview = """
Run charm tests in different back-ends.
This command will run charm test suites using the spread tool. For further
This command will run charm test suites using the spread tool. The test
command is EXPERIMENTAL and may be changed without prior notice. For further
information, see the spread documentation: https://github.com/snapcore/spread
"""

Expand All @@ -37,7 +38,7 @@ class TestCommand(base.CharmcraftCommand):
"""Initialize a directory to be a charm project."""

name = "test"
help_msg = "Execute charm test suites"
help_msg = "Execute charm test suites (EXPERIMENTAL)"
overview = _overview
common = True

Expand Down Expand Up @@ -97,6 +98,10 @@ def run(self, parsed_args: argparse.Namespace):
else:
spread_tasks = ["multipass"]

emit.progress(
"WARNING: This is an EXPERIMENTAL command that can be changed without prior notice.",
permanent=True,
)
try:
with emit.pause():
subprocess.run([*cmd, *spread_tasks], check=True)
Expand Down
158 changes: 0 additions & 158 deletions charmcraft/templates/init-kubernetes/spread.yaml.j2

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 0760303

Please sign in to comment.