Skip to content

Conversation

@cmworkato
Copy link
Collaborator

No description provided.

@github-actions
Copy link

github-actions bot commented Oct 20, 2025

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py52296%10–11
cli
   __init__.py52394%49, 51, 60
   containers.py270100% 
cli/commands
   __init__.py00100% 
   api_clients.py286996%24, 297, 442–443, 476, 486, 576, 607, 615
   api_collections.py253398%25, 178, 340
   assets.py46295%51–52
   connections.py520599%578, 580, 586, 624, 973
   data_tables.py163596%28, 248, 262, 316–317
   guide.py166199%106
   init.py850100% 
   profiles.py1970100% 
   properties.py95198%18
   pull.py171298%190–191
   workspace.py38294%57, 67
cli/commands/connectors
   __init__.py00100% 
   command.py88297%103, 152
   connector_manager.py203498%176, 292, 300–301
cli/commands/projects
   __init__.py00100% 
   command.py2691096%353–356, 367, 433–435, 485, 489
   project_manager.py166795%48, 66, 263–264, 276, 317, 325
cli/commands/push
   __init__.py00100% 
   command.py132496%101, 104, 222, 300
cli/commands/recipes
   __init__.py00100% 
   command.py423997%113, 129–130, 267–270, 397, 703
   validator.py6991697%174, 870, 1123, 1210, 1300–1302, 1398–1399, 1458–1459, 1648–1649, 1677–1679
cli/utils
   __init__.py30100% 
   exception_handler.py198696%137, 184, 211, 238, 295, 330
   gitignore.py140100% 
   ignore_patterns.py230100% 
   spinner.py430100% 
   version_checker.py135695%24, 26, 33–34, 72, 102
cli/utils/config
   __init__.py50100% 
   manager.py4541397%125, 136–138, 141, 154, 332, 456, 670, 828–829, 890, 949
   models.py330100% 
   profiles.py3091096%93, 189–190, 193, 228–230, 255–257
   workspace.py680100% 
TOTAL541612297% 

@oalami oalami requested a review from Copilot October 20, 2025 23:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an AttributeError where code was attempting to call .strip() on coroutine objects returned by click.prompt(). The fix makes click.prompt() calls async by adding await, ensuring the method returns a string instead of a coroutine object.

Key changes:

  • Updated click.prompt() calls in ConfigManager to be awaited properly
  • Converted test mock functions from synchronous to asynchronous to match the updated production code

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/workato_platform/cli/utils/config/manager.py Added await to five click.prompt() calls to properly handle async returns
tests/unit/config/test_manager.py Converted mock prompt functions from sync to async and replaced inline lambdas with named async functions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@cmworkato cmworkato requested a review from oalami October 21, 2025 19:19
Breaking change in asyncclick 8.3.0 made click.prompt async, causing
inconsistent behavior across Python versions:
- Python 3.13 + asyncclick 8.2.2: click.prompt synchronous, await caused TypeError
- Python 3.11 + asyncclick 8.3.0: click.prompt async, missing await caused AttributeError

Changes made:
- Made ProfileManager.select_region_interactive() async and added await to click.prompt
- Made ConnectorManager.prompt_for_oauth_parameters() async and added await to click.prompt calls
- Updated connections.create() to await prompt_for_oauth_parameters()
- Updated all test functions to be async with @pytest.mark.asyncio decorators
- Changed test mocks from Mock to AsyncMock for async functions
- Fixed test monkeypatch to return coroutines for async click.prompt

Affected commands:
- workato init (region selection with custom URL)
- workato connections create (OAuth parameter prompting)

Files modified:
- src/workato_platform/cli/utils/config/profiles.py
- src/workato_platform/cli/commands/connectors/connector_manager.py
- src/workato_platform/cli/commands/connections.py
- tests/unit/config/test_profiles.py
- tests/unit/commands/connectors/test_connector_manager.py
- tests/unit/commands/connections/test_commands.py
- tests/unit/commands/test_connections.py
- Fix line length violations in test function signatures
- Add type annotations to async mock function
- Auto-format code with ruff
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 11 out of 12 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

uv.lock Outdated
@@ -1,5 +1,5 @@
version = 1
revision = 3
revision = 2
Copy link
Collaborator

Choose a reason for hiding this comment

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

looks like your are using an older version of uv to generate this lock file? not sure the implications of going back to 2, can you generate this with a newer version of uv?

.workato-ignore Outdated
@@ -0,0 +1,67 @@
# Workato CLI ignore patterns
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove this file from the PR

- Remove .workato-ignore file that was accidentally added
- Revert uv.lock to revision 3 from main branch
@cmworkato cmworkato requested a review from oalami October 21, 2025 20:55
@oalami oalami requested a review from Copilot October 21, 2025 21:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator

@oalami oalami left a comment

Choose a reason for hiding this comment

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

Added back a correctly generated uv.lock file, the rest LGTM

@oalami oalami merged commit 422536c into main Oct 21, 2025
5 checks passed
@oalami oalami deleted the async-fix branch October 21, 2025 22:29
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