Skip to content

P3.1: generate Python SDK prerelease - #1

Merged
jaavid merged 2 commits into
mainfrom
agent/p3-1-generated-sdk
Jul 24, 2026
Merged

P3.1: generate Python SDK prerelease#1
jaavid merged 2 commits into
mainfrom
agent/p3-1-generated-sdk

Conversation

@jaavid

@jaavid jaavid commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Part of CoreLinkPlatform/platform#94; depends on CoreLinkPlatform/api-contracts#2 and CoreLinkPlatform/platform#144.

Generated with OpenAPI Generator 7.12.0 from corelink-public-v1.yaml at contract commit 701e693.

  • adds generated Python client and PEP 517 package metadata
  • records generator/contract provenance and reproducible command
  • marks the package prerelease-only; no publishing claim

Validation: package wheel built successfully; generated modules compile and import against the platform test environment.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e5ff22dfd7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +95 to +98
_obj = cls.model_validate({
"firmware_release_id": obj.get("firmware_release_id"),
"name": obj.get("name"),
"metadata": obj.get("metadata")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve omitted fields in update factories

When DeviceUpdate.from_dict() or from_json() receives a partial update such as {"metadata": {...}}, these unconditional obj.get() entries pass None for the omitted fields and mark them as explicitly set. to_dict() consequently includes both firmware_release_id and name as null, so update_device() sends a PATCH that can unintentionally clear existing values. Construct the validation input using only keys actually present in obj.

Useful? React with 👍 / 👎.

def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Encode datetimes before dumping model JSON

Calling Command.to_json() always reaches this statement with required created_at and updated_at values, but to_dict() uses Pydantic's default Python-mode model_dump, which leaves them as datetime objects. The standard json.dumps() encoder therefore raises TypeError: Object of type datetime is not JSON serializable; the same issue affects the other generated models containing datetimes. Use Pydantic's JSON-mode serialization or otherwise encode datetime values first.

Useful? React with 👍 / 👎.

Comment thread pyproject.toml Outdated
readme = "README.md"
requires-python = ">=3.9"
authors = [{ name = "CoreLink Platform" }]
license = "Proprietary"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Use valid PEP 621 license metadata

This value is not a valid SPDX license expression, so supported setuptools versions reject the project metadata before building a wheel; for example, setuptools 79 reports that project.license matches none of its permitted definitions. Older setuptools versions covered by the declared setuptools>=68 requirement expect the table form instead, so the package is not reliably buildable as configured. Use a valid LicenseRef-* expression with a sufficiently new setuptools floor, or use the compatible { text = "Proprietary" } form.

Useful? React with 👍 / 👎.

Comment thread corelink_sdk/rest.py
"ca_certs": configuration.ssl_ca_cert,
"cert_file": configuration.cert_file,
"key_file": configuration.key_file,
"ca_cert_data": configuration.ca_cert_data,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid unsupported ca_cert_data on allowed urllib3 versions

In environments using urllib3 2.0.7, which satisfies the declared urllib3>=1.25.3,<3.0.0 dependency, passing this key into PoolManager causes every API request to fail before network I/O with TypeError: PoolKey.__new__() got an unexpected keyword argument 'key_ca_cert_data'. Omit the argument when it is unset or raise the urllib3 lower bound to a version whose pool key supports it.

Useful? React with 👍 / 👎.

@jaavid
jaavid merged commit a6839b4 into main Jul 24, 2026
@jaavid
jaavid deleted the agent/p3-1-generated-sdk branch July 24, 2026 19:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 047fe3cb24

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md
## Planned capabilities
- Contract: `corelink-public-v1.yaml`, version `1.0.0-draft`
- Source branch: `agent/p3-1-contracts`
- Source commit: `701e693`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Record the actual contract commit

The README attributes this generated SDK to 701e693, while both .corelink-contract.json and CODEGEN.md identify the authoritative input as 2fb0dc8. This makes the documented provenance ambiguous and could cause a release or regeneration audit to select the wrong contract revision; update this entry to match the authoritative metadata.

Useful? React with 👍 / 👎.

Comment thread CODEGEN.md
-g python \
-o . \
--additional-properties=packageName=corelink_sdk,projectName=corelink-sdk,packageVersion=0.1.0.dev0 \
--global-property=apiDocs=false,modelDocs=false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make the regeneration command reproduce the checked-in tree

Running this documented command in a clean worktree also generates supporting files recorded in .openapi-generator/FILES, including setup.py, setup.cfg, tox.ini, and several CI workflows; a repo-wide path check confirms those files are absent here, and .openapi-generator-ignore does not suppress them. Consequently the stated procedure cannot produce a clean generated diff without undocumented manual deletion, undermining deterministic regeneration; constrain the generated supporting files or document the cleanup step.

Useful? React with 👍 / 👎.

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.

1 participant