-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
feat: change TEST_ENVIRONMENT -> TEST_ENV and log base url for CI #1198
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this 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 afa6020 in 40 seconds
More details
- Looked at
60
lines of code in3
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. .github/workflows/run_js_test.yml:65
- Draft comment:
Use??
instead of||
for default values in GitHub Actions.
echo "Running test with environment: ${{ inputs.environment ?? 'prod' }}"
- Reason this comment was not posted:
Marked as duplicate.
2. .github/workflows/run_js_test.yml:68
- Draft comment:
Use??
instead of||
for default values in GitHub Actions.
run: cd js && TEST_ENV=${{ inputs.environment ?? 'prod' }} pnpm test:coverage --max-workers 16
- Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable:
The??
operator is the nullish coalescing operator that only falls back on null/undefined, while||
falls back on any falsy value. In GitHub Actions, when an input is not provided, it evaluates to undefined, not an empty string. Since the input has a default value of 'prod' defined in the workflow, it should never actually be undefined. The distinction between??
and||
is not meaningful in this context.
The comment might be technically correct as??
is generally preferred for default values in JavaScript. The change could still work with either operator.
While??
might be marginally better, the input already has a default value defined in the workflow, making this suggestion unnecessary. The current code works correctly either way.
Delete the comment as it suggests a change that would have no practical impact, given that the input already has a default value defined in the workflow configuration.
Workflow ID: wflow_UOzyuQu1CQKStyHR
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
There was a problem hiding this 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 e9fb1dc in 26 seconds
More details
- Looked at
26
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. js/src/sdk/index.ts:21
- Draft comment:
Duplicate import ofIS_DEVELOPMENT_OR_CI
. Remove the redundant import statement. - Reason this comment was not posted:
Comment looked like it was already resolved.
Workflow ID: wflow_H54Doe5gOm6Vrk2Q
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
js/src/sdk/index.ts
Outdated
|
||
|
||
if (IS_DEVELOPMENT_OR_CI) { | ||
logger.info( | ||
`Initializing Composio w API Key: [REDACTED] and baseURL: ${baseURLParsed}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logger level should be consistent; using 'debug' instead of 'info' for development environments can help avoid unnecessary log clutter.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
if (IS_DEVELOPMENT_OR_CI) { | |
logger.info( | |
`Initializing Composio w API Key: [REDACTED] and baseURL: ${baseURLParsed}` | |
if (IS_DEVELOPMENT_OR_CI) { | |
logger.debug( | |
`Initializing Composio w API Key: [REDACTED] and baseURL: ${baseURLParsed}` | |
); | |
} |
This comment was generated by github-actions[bot]! JS SDK Coverage Report📊 Coverage report for JS SDK can be found at the following URL: 📁 Test report folder can be found at the following URL: |
@@ -62,6 +63,11 @@ export class Composio { | |||
config?.apiKey | |||
); | |||
|
|||
if (IS_DEVELOPMENT_OR_CI) { | |||
logger.info( | |||
`Initializing Composio w API Key: [REDACTED] and baseURL: ${baseURLParsed}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a more structured logging format for initialization. Instead of string interpolation, use an object structure:
logger.info('Composio SDK Initialization', {
baseURL: baseURLParsed,
apiKeyPresent: !!apiKeyParsed,
environment: process.env.NODE_ENV
});
This would make log parsing and analysis easier in production environments.
@@ -18,6 +18,7 @@ import { Triggers } from "./models/triggers"; | |||
import { ZAuthMode } from "./types/integration"; | |||
import ComposioSDKContext from "./utils/composioContext"; | |||
import { getSDKConfig } from "./utils/config"; | |||
import { IS_DEVELOPMENT_OR_CI } from "./utils/constants"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The import of IS_DEVELOPMENT_OR_CI
has been moved to a better location at the top with other imports, which improves code organization. However, consider grouping related imports together (e.g., all utility imports, all type imports, etc.) for better code maintainability.
Code Review SummaryOverall, the changes look good with some minor suggestions for improvement. Here's a breakdown: Positive Aspects:✅ Improved logging system with proper redaction of sensitive information Suggestions for Improvement:
Security & Best Practices:✅ Proper handling of sensitive data in logs The changes are well-structured and maintain good coding practices. The suggestions above are minor and the PR can be merged after addressing them. Rating: 8/10 - Good quality changes with minor improvements suggested. |
console.log
withlogger.debug
insendProcessReq()
inexternal.ts
for better logging control.Composio
constructor inindex.ts
to log API key and baseURL whenIS_DEVELOPMENT_OR_CI
is true.inputs.environment
to 'prod' inrun_js_test.yml
if not provided.TEST_ENVIRONMENT
toTEST_ENV
inrun_js_test.yml
.This description was created by
<https://www.ellipsis.dev?ref=ComposioHQ%2Fcomposio&utm_source=github&utm_medium=referral%7Chttps://img.shields.io/badge/Ellipsis-blue?color=175173%7CEllipsis><sup> for e9fb1dc. It will automatically update as commits are pushed.