Skip to content

chore(rbxcloud): enable untyped function checks - #7043

Open
Chan-Developer wants to merge 1 commit into
canonical:mainfrom
Chan-Developer:codex/5445-type-rbxcloud
Open

chore(rbxcloud): enable untyped function checks#7043
Chan-Developer wants to merge 1 commit into
canonical:mainfrom
Chan-Developer:codex/5445-type-rbxcloud

Conversation

@Chan-Developer

@Chan-Developer Chan-Developer commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Proposed Commit Message

chore(rbxcloud): enable untyped function checks

Define structured types for the RbxCloud datasource payload, configuration,
network data, and gratuitous ARP entries. Add parameter and return types to
the module helpers and remove the check_untyped_defs exemption.

Refs GH-5445

Additional Context

The structured return type from get_md now flows into self.cfg, allowing
network_config to be accessed without typing.cast. The activation guard
also reflects that gratuitous ARP data is unavailable until datasource data
has been successfully read.

Test Steps

.tox/mypy/bin/mypy --platform linux cloudinit/sources/DataSourceRbxCloud.py
.tox/mypy/bin/mypy --platform linux cloudinit/
.tox/py3/bin/pytest -q tests/unittests/sources/test_rbx.py tests/unittests/sources/test_common.py
.tox/mypy/bin/ruff check cloudinit/sources/DataSourceRbxCloud.py
.tox/mypy/bin/black --check cloudinit/sources/DataSourceRbxCloud.py
.tox/mypy/bin/isort --check-only --diff cloudinit/sources/DataSourceRbxCloud.py
.tox/mypy/bin/pylint cloudinit/sources/DataSourceRbxCloud.py

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@blackboxsw blackboxsw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for the contribution @Chan-Developer.

Ideally, we want to better type all functions within this module: get_md, get_manage_etc_hosts, gratuitous_arp, generate_network_config and read_user_data_callback. If we can better type the expected return value details from get_md, then we shouldn't have to use typing.cast.

Comment thread cloudinit/sources/DataSourceRbxCloud.py Outdated
@blackboxsw blackboxsw self-assigned this Aug 31, 2026
@Chan-Developer
Chan-Developer force-pushed the codex/5445-type-rbxcloud branch from 93835a5 to b6134a0 Compare August 31, 2026 16:18
@Chan-Developer

Copy link
Copy Markdown
Contributor Author

Thank you for the review. I replaced the typing.cast with structured TypedDict types that flow from read_user_data_callback through get_md into self.cfg, and added parameter and return annotations to the requested helpers (plus the related IP and subprocess helpers). The focused RbxCloud tests, Linux full-source mypy, Ruff, Black, isort, and Pylint all pass.

@Chan-Developer
Chan-Developer force-pushed the codex/5445-type-rbxcloud branch from b6134a0 to 987aada Compare August 31, 2026 16:23
Comment thread cloudinit/sources/DataSourceRbxCloud.py Outdated
Comment thread cloudinit/sources/DataSourceRbxCloud.py Outdated
@Chan-Developer
Chan-Developer force-pushed the codex/5445-type-rbxcloud branch from 987aada to 47dbe2a Compare September 1, 2026 16:49
@Chan-Developer

Copy link
Copy Markdown
Contributor Author

@blackboxsw @holmanb All requested updates are now included in the latest commit, and I have resolved the corresponding outdated review threads. The full CI suite is green. When convenient, could you please take another look? Thank you.

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.

3 participants