Skip to content

Conversation

@ManojTestsigma
Copy link
Contributor

@ManojTestsigma ManojTestsigma commented Oct 6, 2025

jira

https://testsigma.atlassian.net/browse/TE-29657

Please review this and approve as Public

addon name: File actions
Jarvis link : https://jarvis.testsigma.com/ui/tenants/3072/addons

fix

renames the existing file name to new file name.

Summary by CodeRabbit

  • New Features

    • Introduced a file rename action that renames a file within the same directory.
    • Automatically preserves the original file extension if the new name omits it.
    • Validates inputs, prevents overwriting existing files, and provides clear success/error messages.
  • Chores

    • Added build configuration for a new module, including packaging and source attachment setup.
    • Included supporting configuration for SDK integration to enable the new action.

@ManojTestsigma ManojTestsigma merged commit 45e4093 into dev Oct 6, 2025
1 check passed
@coderabbitai
Copy link

coderabbitai bot commented Oct 6, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces a new Maven module for file actions, adds a RenameFileWebAction to rename files with extension handling and validations, and includes a Testsigma SDK properties file containing an API key.

Changes

Cohort / File(s) Summary
Module Setup and Build
file_actions/pom.xml
New Maven module with project coordinates, dependencies (testsigma SDK, Selenium, TestNG/JUnit, Lombok, Jackson), Java 11, and build plugins (shade, source).
Web Action Implementation
file_actions/src/main/java/com/testsigma/addons/web/RenameFileWebAction.java
New WebAction to rename a file within the same directory; validates inputs, preserves/handles extensions, ensures destination uniqueness, performs move, and logs results.
SDK Configuration
file_actions/src/main/resources/testsigma-sdk.properties
Adds testsigma-sdk.api.key property with token value for SDK usage in tests.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant Runtime as Testsigma Runtime
  participant Action as RenameFileWebAction
  participant FS as File System

  User->>Runtime: Trigger "Rename File" step
  Runtime->>Action: execute(sourcePath, newName)
  rect rgba(200,220,255,0.3)
    note over Action: Validate inputs and source file existence/type
    Action-->>Action: Derive target name (preserve/apply extension)
    Action->>FS: Check destination does not exist
    alt Destination exists
      Action-->>Runtime: Result: FAILED (exists)
    else Valid to move
      Action->>FS: Move source -> destination
      FS-->>Action: Success/IO error
      alt Success
        Action-->>Runtime: Result: SUCCESS (path)
      else Error
        Action-->>Runtime: Result: FAILED (reason)
      end
    end
  end
  Runtime-->>User: Step outcome and message
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • vigneshtestsigma
  • Ganesh-Testsigma

Poem

I twitch my ears at files that hide,
A hop, a skip—new names applied!
Extensions snug, they come along,
No clash, no crash—just right, not wrong.
Thump-thump! I stamp with shaded cheer,
Renamed and neat—my warren’s clear. 🐇📁

✨ 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 TE-29657

📜 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 6d1ed66 and f318f9a.

📒 Files selected for processing (3)
  • file_actions/pom.xml (1 hunks)
  • file_actions/src/main/java/com/testsigma/addons/web/RenameFileWebAction.java (1 hunks)
  • file_actions/src/main/resources/testsigma-sdk.properties (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