Skip to content

Conversation

@IgorChvyrov-sm
Copy link
Contributor

@IgorChvyrov-sm IgorChvyrov-sm commented Sep 25, 2025

Changes:

Added Orkes Event Clients for sync and async sdk clients
Added integration tests

@IgorChvyrov-sm IgorChvyrov-sm marked this pull request as ready for review September 25, 2025 07:22
@IgorChvyrov-sm IgorChvyrov-sm changed the title Feature tags field for event handler Tags field for event handler Sep 25, 2025
@codecov
Copy link

codecov bot commented Sep 25, 2025

@IgorChvyrov-sm IgorChvyrov-sm changed the base branch from feature_workflow_model_helper_methods to main October 8, 2025 14:12
@IgorChvyrov-sm IgorChvyrov-sm changed the base branch from main to feature_workflow_model_helper_methods October 8, 2025 14:13
@nthmost-orkes
Copy link

nthmost-orkes commented Oct 23, 2025

I wanted a moment to look at the different API parameter orders, so I had Claude generate the following. Just wanted to put this somewhere since "developer intuition" (let's call it) is something we don't currently value in our API design and I wish we did.

If you wouldn't mind, @IgorChvyrov-sm could you add a few comments in the code just to acknowledge the asymmetry?

Thanks.

Technical Note: Sync vs Async API Signature Asymmetry

During review, we identified that the sync and async event tag APIs have different parameter orders due to different code generation tools:

Observed Behavior

  • Sync API (src/conductor/client/codegen/api/event_resource_api.py):

    • put_tag_for_event_handler(self, body, name, **kwargs)
    • delete_tag_for_event_handler(self, body, name, **kwargs)
    • Body param comes before name param (swagger-codegen behavior)
  • Async API (src/conductor/asyncio_client/http/api/event_resource_api.py):

    • put_tag_for_event_handler(self, name: StrictStr, tag: List[Tag], ...)
    • delete_tag_for_event_handler(self, name: StrictStr, tag: List[Tag], ...)
    • Name param comes before tag param (matches server signature)

Root Cause

Different code generators:

  • Sync: swagger-codegen (older tool, puts body params before path params)
  • Async: Likely openapi-generator (newer tool, preserves natural parameter order)

Implementation in This PR

This PR correctly adapts to both signatures:

  • Sync calls use positional args: put_tag_for_event_handler(tags, name)
  • Async calls use keyword args: put_tag_for_event_handler(name=name, tag=tags)

Both approaches are correct and will work as expected. Code comments have been added to help future maintainers understand this asymmetry.

Future Work

Consider regenerating the sync client with updated tooling to align parameter orders across sync/async APIs (tracked separately as technical debt).

Verified Against:

  • Orkes server signature: EventResource.java:142 - putTagForEventHandler(String name, List<Tag> tags)
  • Both Python implementations correctly map to PUT /event/{name}/tags with tags in request body

Copy link

@nthmost-orkes nthmost-orkes left a comment

Choose a reason for hiding this comment

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

See my longer reply above -- I just want to put comments into the spots where we're having to use different parameter orders for what should really be totally symmetrical API calls.

@IgorChvyrov-sm
Copy link
Contributor Author

Hi, @nthmost-orkes.

I agree with your point about inconsistencies. Added a comment to highlight the inconsistency. Good catch, thank you!

@IgorChvyrov-sm IgorChvyrov-sm changed the base branch from feature_workflow_model_helper_methods to main October 27, 2025 08:35
@nthmost-orkes nthmost-orkes self-requested a review October 27, 2025 17:42
Copy link

@nthmost-orkes nthmost-orkes left a comment

Choose a reason for hiding this comment

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

Great TY!

@EugeneKisel-sm EugeneKisel-sm merged commit 83ba070 into main Oct 27, 2025
2 of 3 checks passed
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