Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass auth scheme to _get_integration_for_app #882

Merged
merged 10 commits into from
Nov 22, 2024
Merged

Conversation

tushar-composio
Copy link
Contributor

@tushar-composio tushar-composio commented Nov 21, 2024

Important

Add auth_scheme parameter to initiate_connection() in toolset.py for filtering integrations by authentication scheme, and update type annotations in collections.py.

  • Behavior:
    • Add auth_scheme parameter to initiate_connection() in toolset.py for filtering integrations by authentication scheme.
    • Pass auth_scheme to _get_integration_for_app() to filter integrations by authentication scheme.
  • Type Annotations:
    • Change auth_mode type to AuthSchemeType in AppAuthScheme and create() in collections.py.
  • Misc:
    • Minor formatting changes in toolset.py.

This description was created by Ellipsis for 931ac03. It will automatically update as commits are pushed.

Copy link

vercel bot commented Nov 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
composio ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 11:13am

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to 94ba575 in 20 seconds

More details
  • Looked at 23 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. python/composio/tools/toolset.py:1331
  • Draft comment:
    The addition of the auth_scheme parameter to initiate_connection and its subsequent use in _get_integration_for_app is consistent with the method signature of _get_integration_for_app. This change allows filtering integrations by auth_scheme when initiating a connection, which seems to be the intended behavior.
  • Reason this comment was not posted:
    Confidence changes required: 0%
    The PR adds an auth_scheme parameter to the initiate_connection method and passes it to _get_integration_for_app. This change is consistent with the method signature of _get_integration_for_app, which accepts an auth_scheme parameter. The change seems to be intended to allow filtering integrations by auth_scheme when initiating a connection.

Workflow ID: wflow_NNEjIebq6g7xMJsk


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@shreysingla11
Copy link
Collaborator

Code Review Summary

Overall Assessment

The changes look good and fix the immediate issue of passing the auth_scheme parameter to _get_integration_for_app. The code is well-structured and maintains type safety with proper type hints.

Suggestions for Improvement

  1. Add validation for auth_scheme values to prevent silent failures with invalid schemes
  2. Consider adding docstring documentation for the new auth_scheme parameter
  3. The error handling between _get_integration_for_app and initiate_connection could be more consistent

Code Quality Rating: 8/10

  • ✅ Type hints properly used
  • ✅ Good use of keyword-only parameter
  • ✅ Maintains backward compatibility
  • ⚠️ Could use better parameter validation
  • ⚠️ Documentation could be improved

The changes are safe to merge after considering the suggested improvements.

Copy link

github-actions bot commented Nov 21, 2024

This comment was generated by github-actions[bot]!

JS SDK Coverage Report

📊 Coverage report for JS SDK can be found at the following URL:
https://pub-92e668239ab84bfd80ee07d61e9d2f40.r2.dev/coverage-11971517010/coverage/index.html

📁 Test report folder can be found at the following URL:
https://pub-92e668239ab84bfd80ee07d61e9d2f40.r2.dev/html-report-11971517010/html-report/report.html

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 4bae1f2 in 19 seconds

More details
  • Looked at 86 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. python/composio/tools/toolset.py:1327
  • Draft comment:
    Consider using AUTH_SCHEMES directly in the error message for consistency and maintainability.
raise ComposioSDKError(f"'auth_scheme' must be one of {AUTH_SCHEMES}")
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The PR introduces a new parameter auth_scheme to the initiate_connection method. This parameter is checked against a predefined list of valid schemes (AUTH_SCHEMES). If the provided auth_scheme is not in this list, an error is raised. This is a good practice to ensure that only valid authentication schemes are used.

Workflow ID: wflow_pQ3QXXEFmpqK9n2V


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on 7b9057b in 38 seconds

More details
  • Looked at 32 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_2ClsfqWQ8bjqeIO9


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

python/composio/client/__init__.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 50e349e in 12 seconds

More details
  • Looked at 12 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_VCVoCIEnJEcypfpK


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 71260eb in 27 seconds

More details
  • Looked at 84 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. python/composio/tools/toolset.py:1148
  • Draft comment:
    The auth_scheme parameter should be passed to _get_integration_for_app to filter integrations by authentication scheme.
                scheme = t.cast(AuthSchemeType, scheme)
  • Reason this comment was not posted:
    Comment was not on a valid diff hunk.

Workflow ID: wflow_jwW9Yp8yrsd5xM3b


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 931ac03 in 30 seconds

More details
  • Looked at 92 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. python/composio/tools/toolset.py:32
  • Draft comment:
    Redundant import of AuthSchemeType. It's already imported from collections.py.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The import of AuthSchemeType in toolset.py is unnecessary since it is already imported from collections.py. This redundancy should be removed to clean up the code.
2. python/composio/tools/toolset.py:27
  • Draft comment:
    Redundant import of AUTH_SCHEMES. It's already imported from collections.py.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The import of AUTH_SCHEMES in toolset.py is unnecessary since it is already imported from collections.py. This redundancy should be removed to clean up the code.

Workflow ID: wflow_56ja4P042TEuIrqV


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@tushar-composio tushar-composio merged commit 1b96973 into master Nov 22, 2024
9 checks passed
@tushar-composio tushar-composio deleted the ENG-2505 branch November 22, 2024 12:09
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