Skip to content

Commit

Permalink
Allow removed collection information from previous major releases. (#174
Browse files Browse the repository at this point in the history
)
  • Loading branch information
felixfontein authored Oct 8, 2024
1 parent e2cf806 commit 4f65622
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/174-removed-in-previous.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Allow information on removed collections from previous major releases in collection metadata schema (https://github.com/ansible-community/antsibull-core/pull/174).
4 changes: 2 additions & 2 deletions src/antsibull_core/collection_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ def _validate_collection(
def _validate_removal_for_removed(
self, collection: str, removal: RemovedRemovalInformation, prefix: str
) -> None:
if removal.version.major != self.major_release:
if removal.version.major > self.major_release:
self.errors.append(
f"{prefix} version: Major version of removal version {removal.version} must"
f" be current major version {self.major_release}"
f" not be larger than current major version {self.major_release}"
)

if (
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/test_collection_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@
"collections: No metadata present for not.there",
"removed_collections -> bad.baz1 -> repository: Required field not provided",
"removed_collections -> bad.baz2 -> removal -> announce_version: Major version of 9.3.0 must be less than the current major version 9",
"removed_collections -> bad.baz2 -> removal -> version: Major version of removal version 10.2.1 must be current major version 9",
"removed_collections -> bad.baz2 -> removal -> version: Major version of removal version 10.2.1 must not be larger than current major version 9",
"removed_collections -> foo.bar: Collection in ansible.in",
],
),
Expand Down

0 comments on commit 4f65622

Please sign in to comment.