Skip to content

Conversation

michelle0927
Copy link
Collaborator

@michelle0927 michelle0927 commented Sep 30, 2025

Resolves #17905

Summary by CodeRabbit

  • New Features

    • Added "Update Formatting" action for Google Sheets to set borders, colors, font styles, and alignment across a specified range.
    • Added predefined border styles and horizontal alignment options.
  • Chores

    • Bumped Google Sheets package to 0.9.0.
    • Incremented versions for multiple Google Sheets actions and sources; no behavioral changes.

Copy link

vercel bot commented Sep 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
pipedream-docs Ignored Ignored Oct 1, 2025 5:10pm
pipedream-docs-redirect-do-not-edit Ignored Ignored Oct 1, 2025 5:10pm

Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

Walkthrough

Version bumps across many Google Sheets actions and sources; added a new "Update Formatting" action that builds Sheets API batchUpdate requests for borders and cell formatting; introduced BORDER_STYLES and HORIZONTAL_ALIGNMENTS constants; bumped package version to 0.9.0. No other logic changes.

Changes

Cohort / File(s) Summary
New action: Update Formatting
components/google_sheets/actions/update-formatting/update-formatting.mjs
New action that constructs and sends spreadsheets.batchUpdate requests to apply borders and cell formatting (colors, fonts, alignment) using updateBorders and repeatCell.
Common constants
components/google_sheets/common/constants.mjs
Added and exported BORDER_STYLES and HORIZONTAL_ALIGNMENTS.
Package version
components/google_sheets/package.json
Bumped package version 0.8.120.9.0.
Action version bumps
components/google_sheets/actions/add-column/add-column.mjs, .../add-multiple-rows/add-multiple-rows.mjs, .../add-single-row/add-single-row.mjs, .../clear-cell/clear-cell.mjs, .../clear-rows/clear-rows.mjs, .../copy-worksheet/copy-worksheet.mjs, .../create-spreadsheet/create-spreadsheet.mjs, .../create-worksheet/create-worksheet.mjs, .../delete-rows/delete-rows.mjs, .../delete-worksheet/delete-worksheet.mjs, .../find-row/find-row.mjs, .../get-cell/get-cell.mjs, .../get-spreadsheet-by-id/get-spreadsheet-by-id.mjs, .../get-values-in-range/get-values-in-range.mjs, .../insert-anchored-note/insert-anchored-note.mjs, .../insert-comment/insert-comment.mjs, .../list-worksheets/list-worksheets.mjs, .../update-cell/update-cell.mjs, .../update-multiple-rows/update-multiple-rows.mjs, .../update-row/update-row.mjs, .../upsert-row/upsert-row.mjs
Incremented exported version strings only; no logic or control-flow changes.
Source version bumps
components/google_sheets/sources/new-comment/new-comment.mjs, .../new-row-added-polling/new-row-added-polling.mjs, .../new-row-added/new-row-added.mjs, .../new-updates/new-updates.mjs, .../new-worksheet/new-worksheet.mjs
Incremented exported version strings only; no logic or control-flow changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Action as Update Formatting Action
  participant Sheets as Google Sheets API

  User->>Action: Provide spreadsheetId, sheet/range, formatting props
  Action->>Action: Parse A1 range → compute start/end row & col indices
  Action->>Action: Build requests[] (updateBorders?, repeatCell?)
  Action->>Sheets: spreadsheets.batchUpdate(requests)
  Sheets-->>Action: BatchUpdateResponse
  Action-->>User: Summary + API response
  note over Action,Sheets: Only provided formatting props are included in request fields
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Google sheets type fix #18411 — similar batch of version bumps across Google Sheets actions; touches related files and metadata (also adjusts worksheetID prop types).

Suggested labels

User submitted

Suggested reviewers

  • jcortes
  • GTFalcao

Poem

A hop, a twirl, I paint the grid,
Borders lined and colors hid.
Cells wear fonts with jaunty cheer,
Sheets now sparkle, crisp and clear.
Hooray for batch updates — carrots near! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Out of Scope Changes Check ⚠️ Warning In addition to the update-formatting functionality, the pull request includes version bumps for all existing Google Sheets actions and sources, which are unrelated to the linked issue and extend beyond the feature’s scope. Please remove or separate the version updates for unrelated actions and sources so that this pull request focuses solely on the formatting feature and its required package version bump.
Description Check ⚠️ Warning The pull request description does not follow the repository’s template because it omits the required “## WHY” section and contains only a reference to the issue number without any explanation of the motivation or context. Please update the description to include a “## WHY” section that explains the motivation for the change and how it addresses issue #17905, following the repository’s description template.
✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title concisely identifies the main change by naming the new Google Sheets action “update-formatting” and clearly signals what feature is being added without extraneous detail.
Linked Issues Check ✅ Passed The pull request fully implements the linked issue’s requirements by adding an update-formatting action that constructs and executes Sheets API batchUpdate requests for cell formatting—including colors, borders, and alignment—and introduces the necessary BORDER_STYLES and HORIZONTAL_ALIGNMENTS constants to support those formatting properties.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue-17905

📜 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 3600521 and 81605a7.

📒 Files selected for processing (1)
  • components/google_sheets/actions/update-formatting/update-formatting.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/google_sheets/actions/update-formatting/update-formatting.mjs (2)
components/google_sheets/common/constants.mjs (2)
  • HORIZONTAL_ALIGNMENTS (103-107)
  • BORDER_STYLES (93-101)
components/google_sheets/google_sheets.app.mjs (4)
  • startRow (142-142)
  • endRow (143-145)
  • startCol (138-138)
  • endCol (139-141)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
  • GitHub Check: Lint Code Base

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@michelle0927 michelle0927 marked this pull request as ready for review September 30, 2025 19:10
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: 5

🧹 Nitpick comments (1)
components/google_sheets/actions/update-formatting/update-formatting.mjs (1)

47-82: Consider validating RGB color values.

The RGB color props accept strings but expect values in the interval [0, 1]. The code does not validate this constraint before passing to the API, which could result in API errors if users provide invalid values (e.g., "255" or "1.5").

Consider adding validation in the run method or using a custom validator:

// In the run method, before building requests:
const validateColorValue = (value, name) => {
  if (value !== undefined) {
    const num = parseFloat(value);
    if (isNaN(num) || num < 0 || num > 1) {
      throw new Error(`${name} must be a number between 0 and 1, got: ${value}`);
    }
    return num;
  }
  return undefined;
};

// Then validate each color prop before use
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 61d0151 and 3600521.

📒 Files selected for processing (29)
  • components/google_sheets/actions/add-column/add-column.mjs (1 hunks)
  • components/google_sheets/actions/add-multiple-rows/add-multiple-rows.mjs (1 hunks)
  • components/google_sheets/actions/add-single-row/add-single-row.mjs (1 hunks)
  • components/google_sheets/actions/clear-cell/clear-cell.mjs (1 hunks)
  • components/google_sheets/actions/clear-rows/clear-rows.mjs (1 hunks)
  • components/google_sheets/actions/copy-worksheet/copy-worksheet.mjs (1 hunks)
  • components/google_sheets/actions/create-spreadsheet/create-spreadsheet.mjs (1 hunks)
  • components/google_sheets/actions/create-worksheet/create-worksheet.mjs (1 hunks)
  • components/google_sheets/actions/delete-rows/delete-rows.mjs (1 hunks)
  • components/google_sheets/actions/delete-worksheet/delete-worksheet.mjs (1 hunks)
  • components/google_sheets/actions/find-row/find-row.mjs (1 hunks)
  • components/google_sheets/actions/get-cell/get-cell.mjs (1 hunks)
  • components/google_sheets/actions/get-spreadsheet-by-id/get-spreadsheet-by-id.mjs (1 hunks)
  • components/google_sheets/actions/get-values-in-range/get-values-in-range.mjs (1 hunks)
  • components/google_sheets/actions/insert-anchored-note/insert-anchored-note.mjs (1 hunks)
  • components/google_sheets/actions/insert-comment/insert-comment.mjs (1 hunks)
  • components/google_sheets/actions/list-worksheets/list-worksheets.mjs (1 hunks)
  • components/google_sheets/actions/update-cell/update-cell.mjs (1 hunks)
  • components/google_sheets/actions/update-formatting/update-formatting.mjs (1 hunks)
  • components/google_sheets/actions/update-multiple-rows/update-multiple-rows.mjs (1 hunks)
  • components/google_sheets/actions/update-row/update-row.mjs (1 hunks)
  • components/google_sheets/actions/upsert-row/upsert-row.mjs (1 hunks)
  • components/google_sheets/common/constants.mjs (1 hunks)
  • components/google_sheets/package.json (1 hunks)
  • components/google_sheets/sources/new-comment/new-comment.mjs (1 hunks)
  • components/google_sheets/sources/new-row-added-polling/new-row-added-polling.mjs (1 hunks)
  • components/google_sheets/sources/new-row-added/new-row-added.mjs (1 hunks)
  • components/google_sheets/sources/new-updates/new-updates.mjs (1 hunks)
  • components/google_sheets/sources/new-worksheet/new-worksheet.mjs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/google_sheets/actions/update-formatting/update-formatting.mjs (2)
components/google_sheets/common/constants.mjs (2)
  • HORIZONTAL_ALIGNMENTS (103-107)
  • BORDER_STYLES (93-101)
components/google_sheets/google_sheets.app.mjs (4)
  • startRow (142-142)
  • endRow (143-145)
  • startCol (138-138)
  • endCol (139-141)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Lint Code Base
  • GitHub Check: Publish TypeScript components
  • GitHub Check: Verify TypeScript components
🔇 Additional comments (27)
components/google_sheets/actions/update-row/update-row.mjs (1)

13-13: LGTM: Version bump aligns with package release.

The version increment from 0.1.15 to 0.1.16 is consistent with the broader versioning pass across Google Sheets actions in this PR.

components/google_sheets/actions/list-worksheets/list-worksheets.mjs (1)

7-7: LGTM: Version bump aligns with package release.

The version increment from 0.1.11 to 0.1.12 is consistent with the coordinated versioning update across multiple Google Sheets actions.

components/google_sheets/actions/add-column/add-column.mjs (1)

7-7: LGTM: Version bump aligns with package release.

The version increment from 0.1.11 to 0.1.12 is consistent with the package-wide versioning update accompanying the new formatting feature.

components/google_sheets/actions/upsert-row/upsert-row.mjs (1)

27-27: Version bump looks good

No behavioral changes introduced; the metadata update keeps the action versioning consistent with the rest of the suite.

components/google_sheets/sources/new-row-added-polling/new-row-added-polling.mjs (1)

11-11: Source version increment verified

Version metadata now reflects the new release while leaving logic untouched.

components/google_sheets/actions/add-multiple-rows/add-multiple-rows.mjs (1)

14-14: Action version update acknowledged

The version increment matches the broader release adjustments and preserves existing behavior.

components/google_sheets/sources/new-updates/new-updates.mjs (1)

12-12: LGTM! Version bump is appropriate.

The patch version increment aligns with the package-level update and contains no functional changes.

components/google_sheets/actions/update-multiple-rows/update-multiple-rows.mjs (1)

12-12: LGTM! Version bump is appropriate.

The patch version increment aligns with the package-level update and contains no functional changes.

components/google_sheets/actions/insert-anchored-note/insert-anchored-note.mjs (1)

8-8: LGTM! Version bump is appropriate.

The patch version increment aligns with the package-level update and contains no functional changes.

components/google_sheets/actions/add-single-row/add-single-row.mjs (1)

13-13: LGTM! Version bump is appropriate.

The patch version increment aligns with the package-level update and contains no functional changes.

components/google_sheets/package.json (1)

3-3: LGTM! Minor version bump is appropriate for the new formatting action.

The version increment from 0.8.12 to 0.9.0 correctly follows semantic versioning, reflecting the addition of the new Update Formatting action and associated constants (BORDER_STYLES, HORIZONTAL_ALIGNMENTS).

components/google_sheets/actions/get-cell/get-cell.mjs (1)

10-10: LGTM! Metadata version bump.

The version increment is consistent with the package-wide release (0.9.0) accompanying the new Update Formatting action.

components/google_sheets/actions/find-row/find-row.mjs (1)

10-10: LGTM! Metadata version bump.

The version increment aligns with the coordinated release for new formatting capabilities.

components/google_sheets/actions/copy-worksheet/copy-worksheet.mjs (1)

7-7: LGTM! Metadata version bump.

The version increment is consistent with the package release strategy.

components/google_sheets/actions/get-spreadsheet-by-id/get-spreadsheet-by-id.mjs (1)

7-7: LGTM! Version bump is appropriate.

The patch version increment aligns with the package release that includes the new Update Formatting action.

components/google_sheets/sources/new-worksheet/new-worksheet.mjs (1)

12-12: LGTM! Version bump is appropriate.

The patch version increment aligns with the package release that includes the new Update Formatting action.

components/google_sheets/actions/get-values-in-range/get-values-in-range.mjs (1)

10-10: LGTM! Version bump is appropriate.

The patch version increment aligns with the package release that includes the new Update Formatting action.

components/google_sheets/sources/new-comment/new-comment.mjs (1)

9-9: LGTM! Version bump is appropriate.

The patch version increment aligns with the package release that includes the new Update Formatting action.

components/google_sheets/actions/delete-worksheet/delete-worksheet.mjs (1)

7-7: LGTM - Coordinated version bump.

The version increment aligns with the package-level update to 0.9.0 and the introduction of new formatting capabilities in this PR.

components/google_sheets/common/constants.mjs (1)

113-114: LGTM - New constants properly exported.

The new formatting constants are correctly added to the module exports for use in the update-formatting action.

components/google_sheets/actions/update-formatting/update-formatting.mjs (7)

1-11: LGTM - Clean imports and metadata.

The action properly imports the new constants and references the official Google Sheets formatting documentation.


83-155: LGTM - Comprehensive formatting props.

The prop definitions cover font styling, alignment, and border options effectively. Using the imported constants for options ensures consistency with the API.


175-229: LGTM - Border request logic is correct.

The conditional assembly of the updateBorders request properly includes only the border properties that were specified by the user.


238-253: LGTM - Background color logic is correct.

The background color properties are conditionally assembled and the field is properly tracked for the fields mask.


254-270: LGTM - Text color logic is correct.

The foreground color is properly nested under textFormat and tracked in the fields mask with the correct path textFormat.foregroundColor.


292-296: LGTM - Horizontal alignment and fields mask are correct.

The horizontal alignment is properly added to userEnteredFormat, and the fields mask is correctly constructed by joining all tracked field paths.


302-309: LGTM - API call and response handling are correct.

The batchUpdate call is properly structured with the assembled requests, and the summary export provides useful feedback to the user.

Copy link
Collaborator

@luancazarine luancazarine 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!

@vunguyenhung vunguyenhung merged commit 2da7d96 into master Oct 2, 2025
10 checks passed
@vunguyenhung vunguyenhung deleted the issue-17905 branch October 2, 2025 06:34
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.

Google Sheet - Batch Update Spreadsheet & Allow cell formatting props
3 participants