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

feat: parallel upload of test report #920

Merged
merged 10 commits into from
Nov 27, 2024
Merged

Conversation

himanshu-dixit
Copy link
Collaborator

@himanshu-dixit himanshu-dixit commented Nov 27, 2024

Important

Enhances GitHub Actions for parallel uploads and improves logging by sanitizing API keys and using structured logging.

  • GitHub Actions Workflow:
    • Updates run_js_test.yml to use himanshu-dixit/r2-upload-action-parallel@v1.3 for parallel uploads of coverage and jest html-reporters folders to R2.
    • Replaces ryand56/r2-upload-action@latest with himanshu-dixit/r2-upload-action-parallel@v1.3.
  • Logging:
    • In factory.ts, modifies logging in WorkspaceFactory.new() to sanitize composioAPIKey in workspaceConfig.
    • Replaces console.log with logger.info in Entity.ts and index.ts for better logging practices.
    • Introduces setAxiosClientConfig in config.ts to add request and response interceptors for logging API calls.
  • Misc:
    • Adds sample.ts as a new file for testing or demonstration purposes.

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

Copy link

vercel bot commented Nov 27, 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 27, 2024 7:24am

@himanshu-dixit himanshu-dixit changed the title feat: parallel upload feat: parallel upload of test report Nov 27, 2024
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 7e237f5 in 9 seconds

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

Workflow ID: wflow_9uzrNpu24DAO2QAb


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

@@ -37,7 +37,7 @@ jobs:

- name: Upload `coverage` folder to R2
if: ${{ always() }}
uses: ryand56/r2-upload-action@latest
uses: himanshu-dixit/r2-upload-action-parallel@v1
Copy link
Collaborator

Choose a reason for hiding this comment

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

While changing to a parallel upload action is a good optimization, there are a few concerns:

  1. The action change is only applied to the coverage folder upload but not to the HTML report upload (line 56). For consistency and optimal performance, consider updating both upload steps to use the parallel version.

  2. Using a specific version (@v1) is better than @latest, but please add:

    • Link to the action's source code repository
    • Brief comment explaining the performance benefits
    • Consider documenting any benchmarks/improvements seen
  3. Consider adding error handling or fallback mechanism in case the parallel upload fails.

@shreysingla11
Copy link
Collaborator

Code Review Summary

Changes Overview

  • Changed R2 upload action from ryand56/r2-upload-action@latest to himanshu-dixit/r2-upload-action-parallel@v1 for coverage folder upload

Positive Aspects

✅ Moving from @latest to a specific version (@v1) improves stability
✅ Introducing parallel upload capability should improve performance
✅ Maintains existing functionality while optimizing performance

Areas for Improvement

⚠️ Inconsistent usage of upload actions (parallel vs non-parallel)
⚠️ Missing documentation and source code references
⚠️ No error handling/fallback mechanism documented

Recommendations

  1. Apply parallel upload to both coverage and HTML report uploads
  2. Add documentation about performance benefits and source code references
  3. Consider adding error handling mechanisms
  4. Document any performance benchmarks or expected improvements

Overall Assessment

The change is a positive optimization but needs some additional work for completeness and reliability.
Rating: 7/10 - Good improvement but needs documentation and consistency updates.

Copy link

github-actions bot commented Nov 27, 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-12045612865/coverage/index.html

📁 Test report folder can be found at the following URL:
https://pub-92e668239ab84bfd80ee07d61e9d2f40.r2.dev/html-report-12045612865/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 94ed5a6 in 7 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. .github/workflows/run_js_test.yml:40
  • Draft comment:
    Ensure that the new version v1.1 of himanshu-dixit/r2-upload-action-parallel is compatible and doesn't introduce breaking changes compared to v1.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR updates the action version from v1 to v1.1, which is a minor version update. It's important to ensure that the new version is compatible and doesn't introduce breaking changes.

Workflow ID: wflow_9S3U71htNbvbFc6E


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 1d38206 in 8 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. .github/workflows/run_js_test.yml:56
  • Draft comment:
    The PR description mentions updating the upload action for the coverage folder, but the same action is also used for the html-report folder. Consider updating the PR description to reflect this.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR updates the action used for uploading the coverage folder to a parallel upload action. This change is correctly reflected in the workflow file. However, the PR description mentions updating the upload action for the coverage folder, but the same action is also used for the html-report folder. This should be clarified in the description.

Workflow ID: wflow_3NjCpkm04hGnWeAR


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 9cc20be in 9 seconds

More details
  • Looked at 22 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. .github/workflows/run_js_test.yml:40
  • Draft comment:
    Ensure that the action version v1.2 is compatible with your workflow requirements and doesn't introduce breaking changes.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions updating to version v1.2 of the action, but the diff shows the change from v1.1 to v1.2. This is consistent with the description, so no issue here.

Workflow ID: wflow_O9uxlt8LlMF1lVp5


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 2ad2cc6 in 9 seconds

More details
  • Looked at 52 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. .github/workflows/run_js_test.yml:40
  • Draft comment:
    The PR description mentions updating to version v1.2, but the code changes show an update to v1.3. Please update the PR description for consistency.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The PR description mentions updating to version v1.2, but the code changes show an update to v1.3. This discrepancy should be addressed for clarity.

Workflow ID: wflow_RJgbW2rz55rJ03aH


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 d0931d7 in 41 seconds

More details
  • Looked at 284 lines of code in 7 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 drafted comments based on config settings.
1. js/src/sdk/base.toolset.ts:171
  • Draft comment:
    Good job removing the console.log statement for cleaner production code.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The console.log statement in base.toolset.ts was removed, which is a good practice for production code. No further action needed.
2. js/src/sdk/index.ts:49
  • Draft comment:
    Good practice to redact API keys in logs for security.
  • Reason this comment was not posted:
    Confidence changes required: 10%
    The logger in index.ts now uses a redacted API key, which is a good security practice.

Workflow ID: wflow_v1X1wHVYYflotXUb


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.

js/sample.ts Outdated
import {Composio} from "./src/index"

async function main() {
const composio = new Composio("u7ta9pbl3iz37qap6wdnk");
Copy link
Contributor

Choose a reason for hiding this comment

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

Hardcoding API keys is a security risk. Consider using environment variables or a secure vault to manage sensitive information.

Suggested change
const composio = new Composio("u7ta9pbl3iz37qap6wdnk");
const composio = new Composio(process.env.COMPOSIO_API_KEY);

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 8dedad5 in 10 seconds

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

Workflow ID: wflow_MeGpVBGl58zRBM4I


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

const sanitizedConfig = {
...this.workspaceConfig,
host: this.workspaceConfig.config.composioBaseURL,
composioAPIKey: this.workspaceConfig.config.composioAPIKey ? "REDACTED" : "NOT DEFINED"
Copy link
Contributor

Choose a reason for hiding this comment

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

Chore: Let's use constant values for "REDACTED" and "NOT DEFINED". It would be easy to reuse and change in future, if required

*/
const getLogLevel = (): keyof typeof levels => {
const envLevel = getEnvVariable("COMPOSIO_DEBUG", "0");
return envLevel === "1" ? 'debug' : 'info';
const envLevel = getEnvVariable("COMPOSIO_LOGGING_LEVEL", "info");
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's use constants for this as well

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