Skip to content

Conversation

@akhil-testsigma
Copy link
Contributor

@akhil-testsigma akhil-testsigma commented Oct 31, 2025

Publish this addon as public

Addon Name: ExcelActions_cloud
Jarvis Link: https://jarvis.testsigma.com/ui/tenants/2817/addons
Jira : https://testsigma.atlassian.net/browse/CUS-8307
Added new class which supports upload section and modified createdownloadscopy function

Summary by CodeRabbit

  • New Features

    • Added support for writing values to specific cells in Excel files, with automatic handling of both local and remote file sources.
  • Bug Fixes

    • Enhanced temporary file creation and naming logic for downloaded files to improve stability and cross-browser compatibility.
  • Chores

    • Updated project version to 1.0.16.

@coderabbitai
Copy link

coderabbitai bot commented Oct 31, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request bumps the project version from 1.0.15 to 1.0.16, introduces a new WriteCellvalueWithSheetFilepath WebAction for writing values to Excel cells (supporting local and remote files), and refactors the temp file creation logic in Chrome and Edge browser utilities to more robustly reconstruct file names and sanitize temporary file naming.

Changes

Cohort / File(s) Summary
Version Update
excelActions_cloud/pom.xml
Maven project version bumped from 1.0.15 to 1.0.16
Browser Utility Enhancements
excelActions_cloud/src/main/java/com/testsigma/addons/util/ChromeExcelUtilities.java, excelActions_cloud/src/main/java/com/testsigma/addons/util/EdgeExcelUtilities.java
Refactored temp file creation logic to robustly extract original file name and extension from provided paths, sanitize file name prefixes (replacing non-alphanumeric characters), and create temporary files in system temp directory with derived metadata
New Excel Write Action
excelActions_cloud/src/main/java/com/testsigma/addons/web/WriteCellvalueWithSheetFilepath.java
New WebAction class that writes cell values to Excel sheets, supports both local and remote (HTTP/HTTPS) file sources, downloads remote files as temp files, persists file path and metadata to runtime data, and includes comprehensive error handling and logging

Sequence Diagram

sequenceDiagram
    participant Action as WriteCellvalueWithSheetFilepath
    participant FileUtil as File Utilities
    participant POI as Apache POI
    participant Runtime as Runtime Data
    participant Log as Logger

    Action->>Action: Validate input parameters
    
    alt excel-path is URL
        Action->>FileUtil: downloadFile(url)
        FileUtil->>FileUtil: Extract filename & extension
        FileUtil->>FileUtil: Create sanitized temp file
        FileUtil-->>Action: temp file path
    else excel-path is local
        Action->>Action: Use local path directly
    end
    
    Action->>POI: Open workbook
    POI-->>Action: Workbook instance
    
    Action->>POI: Get or create sheet
    Action->>POI: Get or create row
    Action->>POI: Get or create cell
    Action->>POI: Write datavalue to cell
    
    Action->>POI: Write workbook to file
    POI-->>Action: Write complete
    
    Action->>Runtime: Set variable-name = file path
    Runtime-->>Action: Success
    
    Action->>Log: Log completion
    Action-->>Action: Return SUCCESS
    
    Note over Action: On error: log exception,<br/>set error message,<br/>return FAILED
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • WriteCellvalueWithSheetFilepath.java: New public class with mixed concerns (remote file download, POI workbook manipulation, runtime data persistence)—requires verification that error handling and resource cleanup via try-with-resources are correct, and that the download logic aligns with browser utility patterns.
  • ChromeExcelUtilities.java & EdgeExcelUtilities.java: Parallel refactoring of temp file naming logic requires careful review to ensure both implementations match expectations and that sanitization logic correctly handles edge cases (empty names, special characters, etc.).

Possibly related PRs

Suggested reviewers

  • Ganesh-Testsigma
  • vigneshtestsigma

Poem

🐰 A spreadsheet hop, a cell to fill,
With downloads swift and runtime skill!
Names sanitized, extensions neat,
Excel actions now complete! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/CUS-8307-Added-new-class-which-supports-upload-section-and-modified-createdownloadscopy-function

📜 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 0519aeb and 5d4c7ff.

📒 Files selected for processing (4)
  • excelActions_cloud/pom.xml (1 hunks)
  • excelActions_cloud/src/main/java/com/testsigma/addons/util/ChromeExcelUtilities.java (2 hunks)
  • excelActions_cloud/src/main/java/com/testsigma/addons/util/EdgeExcelUtilities.java (1 hunks)
  • excelActions_cloud/src/main/java/com/testsigma/addons/web/WriteCellvalueWithSheetFilepath.java (1 hunks)

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.

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