Skip to content

Commit 0c2959a

Browse files
Add missing endpoints and separate generated code (#324)
1 parent 813791b commit 0c2959a

File tree

876 files changed

+104959
-40599
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

876 files changed

+104959
-40599
lines changed

.github/workflows/pull_request.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ jobs:
6868
conductor-sdk-test:latest \
6969
/bin/sh -c "cd /package && COVERAGE_FILE=/package/${{ env.COVERAGE_DIR }}/.coverage.serdeser coverage run -m pytest tests/serdesertest -v"
7070
71+
- name: Run integration tests
72+
id: integration_tests
73+
continue-on-error: true
74+
run: |
75+
docker run --rm \
76+
-e CONDUCTOR_AUTH_KEY=${{ env.CONDUCTOR_AUTH_KEY }} \
77+
-e CONDUCTOR_AUTH_SECRET=${{ env.CONDUCTOR_AUTH_SECRET }} \
78+
-e CONDUCTOR_SERVER_URL=${{ env.CONDUCTOR_SERVER_URL }} \
79+
-v ${{ github.workspace }}/${{ env.COVERAGE_DIR }}:/package/${{ env.COVERAGE_DIR }}:rw \
80+
conductor-sdk-test:latest \
81+
/bin/sh -c "cd /package && COVERAGE_FILE=/package/${{ env.COVERAGE_DIR }}/.coverage.integration coverage run -m pytest -m v4 tests/integration -v"
82+
7183
- name: Generate coverage report
7284
id: coverage_report
7385
continue-on-error: true

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,6 @@ latest.txt
161161

162162
*.so
163163

164-
codegen/
165-
166164
.vscode/
167165
tests/unit/automator/_trial_temp/_trial_marker
168166
tests/unit/automator/_trial_temp/_trial_marker

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ Show support for the Conductor OSS. Please help spread the awareness by starrin
8282
- [Example Unit Testing Application](#example-unit-testing-application)
8383
- [Workflow Deployments Using CI/CD](#workflow-deployments-using-cicd)
8484
- [Versioning Workflows](#versioning-workflows)
85+
- [Development](#development)
86+
- [Client Regeneration](#client-regeneration)
87+
- [Sync Client Regeneration](#sync-client-regeneration)
88+
- [Async Client Regeneration](#async-client-regeneration)
8589

8690
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
8791

@@ -929,3 +933,32 @@ A powerful feature of Conductor is the ability to version workflows. You should
929933

930934
* Versioning allows safely testing changes by doing canary testing in production or A/B testing across multiple versions before rolling out.
931935
* A version can also be deleted, effectively allowing for "rollback" if required.
936+
937+
938+
## Development
939+
940+
### Client Regeneration
941+
942+
When updating to a new Orkes version, you may need to regenerate the client code to support new APIs and features. The SDK provides comprehensive guides for regenerating both sync and async clients:
943+
944+
#### Sync Client Regeneration
945+
946+
For the synchronous client (`conductor.client`), see the [Client Regeneration Guide](src/conductor/client/CLIENT_REGENERATION_GUIDE.md) which covers:
947+
948+
- Creating swagger.json files for new Orkes versions
949+
- Generating client code using Swagger Codegen
950+
- Replacing models and API clients in the codegen folder
951+
- Creating adapters and updating the proxy package
952+
- Running backward compatibility, serialization, and integration tests
953+
954+
#### Async Client Regeneration
955+
956+
For the asynchronous client (`conductor.asyncio_client`), see the [Async Client Regeneration Guide](src/conductor/asyncio_client/ASYNC_CLIENT_REGENERATION_GUIDE.md) which covers:
957+
958+
- Creating swagger.json files for new Orkes versions
959+
- Generating async client code using OpenAPI Generator
960+
- Replacing models and API clients in the http folder
961+
- Creating adapters for backward compatibility
962+
- Running async-specific tests and handling breaking changes
963+
964+
Both guides include detailed troubleshooting sections, best practices, and step-by-step instructions to ensure a smooth regeneration process while maintaining backward compatibility.

docs/authorization/README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ authorization_client = OrkesAuthorizationClient(configuration)
1818
Creates an application and returns a ConductorApplication object.
1919

2020
```python
21-
from conductor.client.http.models.create_or_update_application_request import CreateOrUpdateApplicationRequest
21+
from conductor.client.http.models import CreateOrUpdateApplicationRequest
2222
from conductor.client.orkes.orkes_authorization_client import OrkesAuthorizationClient
2323
from conductor.client.configuration.configuration import Configuration
2424

@@ -138,7 +138,7 @@ Creates or updates a user and returns a ConductorUser object.
138138

139139
```python
140140
from conductor.client.http.models.upsert_user_request import UpsertUserRequest
141-
from conductor.client.http.models.conductor_user import ConductorUser
141+
from conductor.client.http.models import ConductorUser
142142

143143
user_id = 'test.user@company.com'
144144
user_name = "Test User"
@@ -171,8 +171,7 @@ authorization_client.delete_user(user_id)
171171
Creates or updates a user group and returns a Group object.
172172

173173
```python
174-
from conductor.client.http.models.upsert_group_request import UpsertGroupRequest
175-
from conductor.client.http.models.group import Group
174+
from conductor.client.http.models import UpsertGroupRequest, Group
176175

177176
group_id = 'test_group'
178177
group_name = "Test Group"
@@ -225,9 +224,8 @@ authorization_client.remove_user_from_group(group_id, user_id)
225224
Grants a set of accesses to the specified Subject for a given Target.
226225

227226
```python
228-
from conductor.client.http.models.target_ref import TargetRef
227+
from conductor.client.http.models import TargetRef, SubjectRef
229228
from conductor.shared.http.enums.target_type import TargetType
230-
from conductor.client.http.models.subject_ref import SubjectRef
231229
from conductor.shared.http.enums.subject_type import SubjectType
232230
from conductor.client.orkes.models.access_type import AccessType
233231

@@ -247,7 +245,7 @@ Given the target, returns all permissions associated with it as a Dict[str, List
247245
In the returned dictionary, key is AccessType and value is a list of subjects.
248246

249247
```python
250-
from conductor.client.http.models.target_ref import TargetRef
248+
from conductor.client.http.models import TargetRef
251249
from conductor.shared.http.enums.target_type import TargetType
252250

253251
target = TargetRef(TargetType.WORKFLOW_DEF, WORKFLOW_NAME)
@@ -276,9 +274,8 @@ user_permissions = authorization_client.get_granted_permissions_for_user(user_id
276274
Removes a set of accesses from a specified Subject for a given Target.
277275

278276
```python
279-
from conductor.client.http.models.target_ref import TargetRef
277+
from conductor.client.http.models import TargetRef, SubjectRef
280278
from conductor.shared.http.enums.target_type import TargetType
281-
from conductor.client.http.models.subject_ref import SubjectRef
282279
from conductor.shared.http.enums.subject_type import SubjectType
283280
from conductor.client.orkes.models.access_type import AccessType
284281

docs/metadata/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ workflow.input_parameters(["a", "b"])
5757
You should be able to register your workflow at the Conductor Server:
5858

5959
```python
60-
from conductor.client.http.models.workflow_def import WorkflowDef
60+
from conductor.client.http.models import WorkflowDef
6161

6262
workflowDef = workflow.to_workflow_def()
6363
metadata_client.register_workflow_def(workflowDef, True)
@@ -98,7 +98,7 @@ metadata_client.unregister_workflow_def('python_workflow_example_from_code', 1)
9898
You should be able to register your task at the Conductor Server:
9999

100100
```python
101-
from conductor.client.http.models.task_def import TaskDef
101+
from conductor.client.http.models import TaskDef
102102

103103
taskDef = TaskDef(
104104
name="PYTHON_TASK",

docs/schedule/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ scheduler_client = OrkesSchedulerClient(configuration)
2121
### Saving Schedule
2222

2323
```python
24-
from conductor.client.http.models.save_schedule_request import SaveScheduleRequest
25-
from conductor.client.http.models.start_workflow_request import StartWorkflowRequest
24+
from conductor.client.http.models import SaveScheduleRequest, StartWorkflowRequest
2625

2726
startWorkflowRequest = StartWorkflowRequest(
2827
name="WORKFLOW_NAME", workflow_def=workflowDef

docs/testing/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A sample unit test code snippet is provided below.
1616
import json
1717
from conductor.shared.configuration.settings.authentication_settings import AuthenticationSettings
1818
from conductor.client.configuration.configuration import Configuration
19-
from conductor.client.http.models.workflow_test_request import WorkflowTestRequest
19+
from conductor.client.http.models import WorkflowTestRequest
2020
from conductor.client.orkes.orkes_workflow_client import OrkesWorkflowClient
2121

2222
TEST_WF_JSON_PATH = 'tests/integration/resources/test_data/calculate_loan_workflow.json'

docs/worker/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,7 @@ See [simple_cpp_lib.cpp](src/example/worker/cpp/simple_cpp_lib.cpp)
347347
and [simple_cpp_worker.py](src/example/worker/cpp/simple_cpp_worker.py) for complete working example.
348348

349349
```python
350-
from conductor.client.http.models.task import Task
351-
from conductor.client.http.models.task_result import TaskResult
350+
from conductor.client.http.models import Task, TaskResult
352351
from conductor.shared.http.enums import TaskResultStatus
353352
from conductor.client.worker.worker_interface import WorkerInterface
354353
from ctypes import cdll

examples/async/dynamic_workflow.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
import asyncio
99

10+
from conductor.asyncio_client.adapters import ApiClient
1011
from conductor.asyncio_client.automator.task_handler import TaskHandler
1112
from conductor.asyncio_client.configuration.configuration import Configuration
12-
from conductor.asyncio_client.adapters import ApiClient
1313
from conductor.asyncio_client.orkes.orkes_clients import OrkesClients
1414
from conductor.asyncio_client.worker.worker_task import worker_task
1515
from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow
@@ -31,6 +31,7 @@ async def main():
3131
# CONDUCTOR_AUTH_KEY : API Authentication Key
3232
# CONDUCTOR_AUTH_SECRET: API Auth Secret
3333
api_config = Configuration()
34+
api_config.apply_logging_config()
3435
task_handler = TaskHandler(configuration=api_config)
3536
task_handler.start_processes()
3637

examples/async/helloworld/helloworld.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
from greetings_workflow import greetings_workflow
44

5+
from conductor.asyncio_client.adapters import ApiClient
56
from conductor.asyncio_client.automator.task_handler import TaskHandler
67
from conductor.asyncio_client.configuration import Configuration
7-
from conductor.asyncio_client.adapters import ApiClient
88
from conductor.asyncio_client.workflow.conductor_workflow import AsyncConductorWorkflow
99
from conductor.asyncio_client.workflow.executor.workflow_executor import (
1010
AsyncWorkflowExecutor,
@@ -22,6 +22,7 @@ async def register_workflow(
2222
async def main():
2323
# points to http://localhost:8080/api by default
2424
api_config = Configuration()
25+
api_config.apply_logging_config()
2526
async with ApiClient(api_config) as api_client:
2627
workflow_executor = AsyncWorkflowExecutor(
2728
configuration=api_config, api_client=api_client

0 commit comments

Comments
 (0)