Skip to content

Fix broken CLI when we add new API versions#105

Merged
olivhoenen merged 3 commits into
iterorganization:developfrom
Yannicked:fix/api-version-negotiation
Jul 20, 2026
Merged

Fix broken CLI when we add new API versions#105
olivhoenen merged 3 commits into
iterorganization:developfrom
Yannicked:fix/api-version-negotiation

Conversation

@Yannicked

Copy link
Copy Markdown
Collaborator

The CLI previously selected the latest API version advertised by the server (even when it's unsupported by the client), so deploying a new API version would immediately switch all existing clients onto it (and break them).

This PR will select the highest version supported by both sides.

@olivhoenen olivhoenen left a comment

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.

Looks fine to me, but as discussed with @prasad-sawantdesai and in #103, we will need to explicitly tell about API versioning rules in the dev documentation.

@Yannicked

Copy link
Copy Markdown
Collaborator Author

Add decorators to API calls in client

@Yannicked

Copy link
Copy Markdown
Collaborator Author

@prasad-sawantdesai Using this PR in #70 you could add

@versioned_method('v1.3')
@try_request
def get_simulation_data(...)

and update the CLIENT_API_VERSIONS = ("v1.2",) to CLIENT_API_VERSIONS = ("v1.2","v1.3")

@olivhoenen
olivhoenen merged commit 722b689 into iterorganization:develop Jul 20, 2026
8 checks passed
@prasad-sawantdesai

Copy link
Copy Markdown
Contributor

@prasad-sawantdesai Using this PR in #70 you could add

@versioned_method('v1.3')
@try_request
def get_simulation_data(...)

and update the CLIENT_API_VERSIONS = ("v1.2",) to CLIENT_API_VERSIONS = ("v1.2","v1.3")

Thanks. Updated #70

@prasad-sawantdesai

prasad-sawantdesai commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

@Yannicked Do you understand why it failed? #70

$ simdb remote pr-70 test
Error: 'get_api_version' is not supported by the negotiated API version 'v1.3'. It requires one of: v1.2.

simdb.cfg

[remote "pr-70"]
url = http://10.154.84.240:5101/
default = True

@prasad-sawantdesai

Copy link
Copy Markdown
Contributor

@Yannicked Do you understand why it failed? #70

$ simdb remote pr-70 test
Error: 'get_api_version' is not supported by the negotiated API version 'v1.3'. It requires one of: v1.2.

simdb.cfg

[remote "pr-70"]
url = http://10.154.84.240:5101/
default = True

It worked with these changes 8964e06
aligned with #83
Thanks

$ simdb remote pr-70 test
Remote is valid (remote API version: 1.3)

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