Skip to content

xapi,network: add type hints#402

Merged
glehmann merged 9 commits intomasterfrom
gln/xapi-network-typehints
Apr 17, 2026
Merged

xapi,network: add type hints#402
glehmann merged 9 commits intomasterfrom
gln/xapi-network-typehints

Conversation

@glehmann
Copy link
Copy Markdown
Member

@glehmann glehmann commented Feb 15, 2026

This allows more validation both in the CI and when writing the tests in our IDEs.

This work was mostly done with AI, validated by the code checkers, and manually cleaned up by me.

This PR is part of a stack containing 9 PRs:

  1. master
  2. Run the code checkers on the whole repository #387
  3. ssh: only allow string command #398
  4. add type hints to ./lib/ and ./conftest.py #399
  5. tests/storage: add type hints #400
  6. misc tests: add type hints #401
  7. "xapi,network: add type hints" (this PR)
  8. xen, guest_tools: add type hints #403
  9. misc type related enhancements #460
  10. chore: add ty type checker and reorder make commands for faster feedback #476

@glehmann glehmann requested review from a team as code owners February 15, 2026 22:02
@glehmann glehmann force-pushed the gln/xapi-network-typehints branch from b3d821d to 7b59763 Compare February 15, 2026 22:06
Copy link
Copy Markdown
Contributor

@semarie semarie left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks

logging.info(f"Check that the host certificate exists on host {h}")
cert_uuid = hostA1.xe('certificate-list', {'host': h.uuid, 'type': 'host_internal'}, minimal=True)
assert len(cert_uuid) > 0, f"A host_internal certificate must exist on host {h}"
yield hostA1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree that yielding hostA1 is the intented purpose of the fixture.

The current code relies only on the side effect to ensuring that TLS verification is enabled (using assert), but it could be changed (later) to really use the fixture (instead of marking it used and use hostA1).

Fine with me as it.

Copy link
Copy Markdown
Contributor

@olivierh-pro olivierh-pro left a comment

Choose a reason for hiding this comment

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

Nice Job !

@glehmann glehmann force-pushed the gln/xapi-network-typehints branch from 7b59763 to 50754ce Compare February 16, 2026 09:39
@gduperrey gduperrey requested a review from a team February 16, 2026 09:45
@stormi
Copy link
Copy Markdown
Member

stormi commented Feb 16, 2026

Do the changes require running a few tests to verify everything works well, or are they riskless?

@glehmann glehmann force-pushed the gln/xapi-network-typehints branch 2 times, most recently from 4c9b247 to 7b6389e Compare February 17, 2026 21:40
@glehmann glehmann force-pushed the gln/misc-typehints branch 2 times, most recently from 1488c49 to 99bce99 Compare February 19, 2026 21:29
@glehmann glehmann force-pushed the gln/xapi-network-typehints branch from 7b6389e to 6c7b248 Compare February 19, 2026 21:29
@glehmann glehmann force-pushed the gln/xapi-network-typehints branch from 6c7b248 to 1c70a06 Compare February 19, 2026 21:49
@glehmann glehmann force-pushed the gln/xapi-network-typehints branch from 1c70a06 to e712aec Compare March 2, 2026 22:23
@glehmann glehmann force-pushed the gln/misc-typehints branch from 47c708a to ba07031 Compare March 2, 2026 22:23
@glehmann glehmann force-pushed the gln/xapi-network-typehints branch from e712aec to b383dfa Compare March 9, 2026 20:53
@glehmann glehmann force-pushed the gln/misc-typehints branch from ba07031 to 4a34482 Compare March 9, 2026 20:53
@glehmann glehmann force-pushed the gln/misc-typehints branch from 4a34482 to 76857b0 Compare April 7, 2026 05:37
@glehmann glehmann requested review from a team as code owners April 7, 2026 05:37
@glehmann glehmann force-pushed the gln/xapi-network-typehints branch from b383dfa to 24c6041 Compare April 7, 2026 05:37
@glehmann glehmann force-pushed the gln/xapi-network-typehints branch from 24c6041 to 7cd4b16 Compare April 7, 2026 05:44
@glehmann glehmann force-pushed the gln/misc-typehints branch 2 times, most recently from 5d94a87 to bcad48f Compare April 7, 2026 09:31
@glehmann glehmann force-pushed the gln/xapi-network-typehints branch from 7cd4b16 to 6253147 Compare April 7, 2026 09:31
@glehmann glehmann force-pushed the gln/misc-typehints branch from bcad48f to 9a8d4f3 Compare April 13, 2026 20:50
@glehmann glehmann force-pushed the gln/xapi-network-typehints branch 2 times, most recently from 35a5f7c to bb50707 Compare April 15, 2026 17:07
@glehmann glehmann force-pushed the gln/misc-typehints branch from 9a8d4f3 to 12ba52a Compare April 15, 2026 17:07
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
@glehmann glehmann force-pushed the gln/misc-typehints branch from 12ba52a to ed74ec4 Compare April 15, 2026 20:46
@glehmann glehmann force-pushed the gln/xapi-network-typehints branch from bb50707 to 1468f65 Compare April 15, 2026 20:46
Base automatically changed from gln/misc-typehints to master April 17, 2026 13:48
@glehmann glehmann merged commit 1358ffc into master Apr 17, 2026
9 checks passed
@glehmann glehmann deleted the gln/xapi-network-typehints branch April 17, 2026 13:48
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.

4 participants