Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow removed collection information from previous major releases #174

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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