Skip to content

Conversation

@michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Apr 25, 2025

  • Removes unnecessary test files
  • Refactor for clarity

Updates per this Slack convo

Summary by CodeRabbit

  • Refactor

    • Streamlined Google Search Console actions for site performance data and URL indexing, simplifying input handling and error reporting.
    • Centralized and improved API request logic for authentication and interaction with Google APIs.
    • Improved consistency in naming and method usage across actions.
  • Chores

    • Removed local test scripts, test data, and related documentation to clean up development files.
    • Updated package version to 0.7.1.
  • Documentation

    • Deleted internal README files for actions and tests.

@vercel
Copy link

vercel bot commented Apr 25, 2025

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

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Ignored (Inspect) Visit Preview Apr 25, 2025 8:56pm
pipedream-docs ⬜️ Ignored (Inspect) Apr 25, 2025 8:56pm
pipedream-docs-redirect-do-not-edit ⬜️ Ignored (Inspect) Apr 25, 2025 8:56pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 25, 2025

Walkthrough

This update refactors the Google Search Console integration by removing custom property metadata handling, centralizing API request logic within the app module, and delegating HTTP calls to new app methods. Both the "Retrieve Site Performance Data" and "Submit URL for Indexing" actions are simplified to use these new methods, with direct axios usage replaced and props explicitly declared. Additionally, all local development test scripts, test data, and associated README files are deleted. The package version is incremented to reflect these changes.

Changes

File(s) Change Summary
components/google_search_console/actions/retrieve-site-performance-data/README.md
components/google_search_console/actions/submit-url-for-indexing/README.md
components/google_search_console/common/tests/README.md
Deleted documentation files describing action usage, test structure, and internal logic.
components/google_search_console/actions/retrieve-site-performance-data/retrieve-site-performance-data.mjs Refactored: removed custom prop metadata, switched to explicit prop declarations, replaced direct axios with app method, simplified control flow, updated app import.
components/google_search_console/actions/submit-url-for-indexing/submit-url-for-indexing.mjs Refactored: replaced direct axios with app method, renamed app prop, improved variable handling, updated error reporting, incremented version.
components/google_search_console/common/tests/action-tests/test-retrieve-site-performance-data.mjs
components/google_search_console/common/tests/action-tests/test-submit-url-for-indexing.mjs
components/google_search_console/common/tests/get-token.mjs
components/google_search_console/common/tests/methods/bogus-data/bogus-data-google-date.mjs
components/google_search_console/common/tests/methods/bogus-data/bogus-data-url.mjs
components/google_search_console/common/tests/methods/test-checkIfUrlValid.mjs
components/google_search_console/common/tests/methods/test-throwIfNotYMDDashDate.mjs
components/google_search_console/common/tests/mockery-dollar.mjs
Deleted all local test scripts, test data, and mocks used for local development and validation.
components/google_search_console/common/utils.mjs Removed exported function removeCustomPropFields, leaving only trimIfString.
components/google_search_console/google_search_console.app.mjs Added centralized API request method _makeRequest, and public methods getSitePerformanceData and submitUrlForIndexing. Removed stub method authKeys.
components/google_search_console/package.json Incremented version from 0.7.0 to 0.7.1.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Action
    participant GoogleSearchConsoleApp
    participant GoogleAPI

    User->>Action: Provide input props
    Action->>GoogleSearchConsoleApp: Call getSitePerformanceData/submitUrlForIndexing
    GoogleSearchConsoleApp->>GoogleAPI: Make authenticated POST request
    GoogleAPI-->>GoogleSearchConsoleApp: Return API response
    GoogleSearchConsoleApp-->>Action: Return processed response
    Action-->>User: Output summary and data
Loading

Possibly related PRs

  • PipedreamHQ/pipedream#16378: Refactored and simplified the initial implementation of the same Google Search Console actions, directly related to the changes in this update.

Suggested labels

User submitted

Poem

🐇 In the code burrow deep,
Old docs and tests now sleep.
Calls once tangled, now aligned,
With app methods well-defined.
Props trimmed neat, no warnings chase,
A cleaner, simpler action space.
🥕✨ Hop on, progress in place!

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

components/google_search_console/actions/retrieve-site-performance-data/retrieve-site-performance-data.mjs

Oops! Something went wrong! :(

ESLint: 8.57.1

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
at packageResolve (node:internal/modules/esm/resolve:839:9)
at moduleResolve (node:internal/modules/esm/resolve:908:18)
at defaultResolve (node:internal/modules/esm/resolve:1038:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:557:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:525:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:246:38)
at ModuleJob._link (node:internal/modules/esm/module_job:126:49)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e59865 and 08fd18a.

📒 Files selected for processing (1)
  • components/google_search_console/actions/retrieve-site-performance-data/retrieve-site-performance-data.mjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/google_search_console/actions/retrieve-site-performance-data/retrieve-site-performance-data.mjs
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Lint Code Base
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
components/google_search_console/actions/retrieve-site-performance-data/retrieve-site-performance-data.mjs (1)

112-115: Minor: bubble up original stack trace for easier debugging

Re-throwing a new Error hides the original stack. Consider either throw error after enriching error.message, or attach error.stack to the new error instance.
(Just a suggestion; not blocking.)

components/google_search_console/actions/submit-url-for-indexing/submit-url-for-indexing.mjs (2)

38-45: Formatting: first list item in warnings.join("\n- ") is missing a bullet

Because the join string starts with \n- , the first warning lacks the leading dash. Prefix the bullet before joining:

-  throw new Error(`Failed to fetch data ( ${thrower.whoThrew} error ) : ${error.message}. ` + warnings.join("\n- "));
+  const formattedWarnings = warnings.length ? `\n- ${warnings.join("\n- ")}` : "";
+  throw new Error(`Failed to fetch data ( ${thrower.whoThrew} error ) : ${error.message}.${formattedWarnings}`);

Apply the same change to the success summary below.


43-46: Use trimmed URL consistently

You trim siteUrl for the request but export the un-trimmed value in the summary.
Using the same (trimmed) value avoids surprises such as stray whitespace:

-  $.export("$summary", ` URL submitted to Google: ${this.siteUrl}`  + warnings.join("\n- "));
+  $.export("$summary", `URL submitted to Google: ${siteUrl}` + formattedWarnings);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eda5597 and 8e59865.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (16)
  • components/google_search_console/actions/retrieve-site-performance-data/README.md (0 hunks)
  • components/google_search_console/actions/retrieve-site-performance-data/retrieve-site-performance-data.mjs (1 hunks)
  • components/google_search_console/actions/submit-url-for-indexing/README.md (0 hunks)
  • components/google_search_console/actions/submit-url-for-indexing/submit-url-for-indexing.mjs (1 hunks)
  • components/google_search_console/common/tests/README.md (0 hunks)
  • components/google_search_console/common/tests/action-tests/test-retrieve-site-performance-data.mjs (0 hunks)
  • components/google_search_console/common/tests/action-tests/test-submit-url-for-indexing.mjs (0 hunks)
  • components/google_search_console/common/tests/get-token.mjs (0 hunks)
  • components/google_search_console/common/tests/methods/bogus-data/bogus-data-google-date.mjs (0 hunks)
  • components/google_search_console/common/tests/methods/bogus-data/bogus-data-url.mjs (0 hunks)
  • components/google_search_console/common/tests/methods/test-checkIfUrlValid.mjs (0 hunks)
  • components/google_search_console/common/tests/methods/test-throwIfNotYMDDashDate.mjs (0 hunks)
  • components/google_search_console/common/tests/mockery-dollar.mjs (0 hunks)
  • components/google_search_console/common/utils.mjs (0 hunks)
  • components/google_search_console/google_search_console.app.mjs (2 hunks)
  • components/google_search_console/package.json (1 hunks)
💤 Files with no reviewable changes (12)
  • components/google_search_console/common/utils.mjs
  • components/google_search_console/actions/submit-url-for-indexing/README.md
  • components/google_search_console/common/tests/mockery-dollar.mjs
  • components/google_search_console/common/tests/methods/test-checkIfUrlValid.mjs
  • components/google_search_console/common/tests/methods/test-throwIfNotYMDDashDate.mjs
  • components/google_search_console/common/tests/methods/bogus-data/bogus-data-google-date.mjs
  • components/google_search_console/common/tests/README.md
  • components/google_search_console/actions/retrieve-site-performance-data/README.md
  • components/google_search_console/common/tests/methods/bogus-data/bogus-data-url.mjs
  • components/google_search_console/common/tests/action-tests/test-retrieve-site-performance-data.mjs
  • components/google_search_console/common/tests/action-tests/test-submit-url-for-indexing.mjs
  • components/google_search_console/common/tests/get-token.mjs
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: pnpm publish
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base
🔇 Additional comments (1)
components/google_search_console/package.json (1)

15-17: Confirm platform peer compatibility before publishing

@pipedream/platform is pinned with a caret (^3.0.0).
Ensure the refactor was tested against the latest 3.x – breaking changes in minor versions could slip through. Locking to an exact version or adding it as a peer dependency can prevent unexpected runtime issues.

Copy link
Collaborator

@jcortes jcortes left a comment

Choose a reason for hiding this comment

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

Hi @michelle0927 lgtm! Ready for QA!

@jcortes jcortes moved this from Ready for PR Review to Ready for QA in Component (Source and Action) Backlog Apr 25, 2025
@SokolovskyiK
Copy link
Contributor

Hi @michelle0927
I saw your refactoring and took some time to study it carefully.
Apologies for any inconvenience — this was actually my first contribution. I'll definitely try to stick to the project's patterns more closely next time.
Thanks a lot for the extra work you did and for helping me learn. 🙏

@vunguyenhung vunguyenhung moved this from Ready for QA to In QA in Component (Source and Action) Backlog Apr 27, 2025
@vunguyenhung vunguyenhung moved this from In QA to Ready for Release in Component (Source and Action) Backlog Apr 27, 2025
@vunguyenhung
Copy link
Collaborator

Hi everyone, all test cases are passed! Ready for release!

Test report
https://vunguyenhung.notion.site/Google-Search-Console-remove-test-files-and-refactor-1e0bf548bb5e8108a436f8c3408d1d22

@vunguyenhung vunguyenhung merged commit 1b10426 into master Apr 27, 2025
11 checks passed
@vunguyenhung vunguyenhung deleted the google_search_console_updates branch April 27, 2025 13:17
@github-project-automation github-project-automation bot moved this from Ready for Release to Done in Component (Source and Action) Backlog Apr 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants