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

Migrate remaining schemas to pydantic 2 #333

Merged
merged 14 commits into from
Sep 23, 2024

Conversation

felixfontein
Copy link
Collaborator

@felixfontein felixfontein commented Sep 15, 2024

Currently contains #331. Will rebase once that has been merged.

@felixfontein felixfontein force-pushed the pydantic-2 branch 3 times, most recently from aa5fb91 to 6aeab3a Compare September 15, 2024 20:38
@felixfontein
Copy link
Collaborator Author

@gotmax23 I managed to convert all pydantic v1 models to pydantic v2. That also means that ansible-community/antsibull-core#169 is sufficient as-is and does not need more changes for the documentation schemas.

#
# Since our attribute names are all lower-case and our class
# names all start with an upper-case letter, this effectively
# removes all class names from the location sequence.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, the reasoning doesn't work due to how options etc. work - the keys there are arbitrary strings that users provide. There exist modules whose option names are starting with upper-case letters :(

For example, amazon.aws.elb_application_lb has a (nested) option listeners.DefaultActions[].TargetGroupName.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in adcc19f.

@felixfontein felixfontein force-pushed the pydantic-2 branch 2 times, most recently from 5371006 to 7c51156 Compare September 17, 2024 16:39
@felixfontein felixfontein changed the title [WIP] Migrate remaining schemas to pydantic 2 Migrate remaining schemas to pydantic 2 Sep 17, 2024
src/antsibull_docs/collection_config.py Outdated Show resolved Hide resolved
src/antsibull_docs/collection_links.py Outdated Show resolved Hide resolved
src/antsibull_docs/docs_parsing/__init__.py Outdated Show resolved Hide resolved
src/antsibull_docs/process_docs.py Outdated Show resolved Hide resolved
src/antsibull_docs/process_docs.py Show resolved Hide resolved
src/antsibull_docs/process_docs.py Show resolved Hide resolved
src/antsibull_docs/process_docs.py Outdated Show resolved Hide resolved
src/antsibull_docs/schemas/docs/ansible_doc.py Outdated Show resolved Hide resolved
src/antsibull_docs/schemas/docs/plugin.py Show resolved Hide resolved
@gotmax23
Copy link
Collaborator

Looks like everything except coverage (with a less than 1% difference...) is passing. I'll do one last look through, and also try to run a test package docs build in ansible-documentation's CI.

@gotmax23
Copy link
Collaborator

try to run a test package docs build in ansible-documentation's CI

ansible/ansible-documentation#1923

Copy link
Collaborator

@gotmax23 gotmax23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've addressed my feedback, and I looked at this pretty closely the first time, so ACK, pending the new antsibull-core release and version pin updates.

@felixfontein felixfontein marked this pull request as ready for review September 23, 2024 17:08
@felixfontein felixfontein merged commit f866406 into ansible-community:main Sep 23, 2024
12 of 13 checks passed
@felixfontein felixfontein deleted the pydantic-2 branch September 23, 2024 17:14
@felixfontein
Copy link
Collaborator Author

@gotmax23 thanks for reviewing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants