WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Conversation

@subrata71
Copy link
Collaborator

@subrata71 subrata71 commented Dec 1, 2025

Add GET endpoint to fetch git commit logs in chronological order for git-connected artifacts. This endpoint can be helpful during troubleshooting calls with customers.

  • Add getCommitHistory method to CentralGitService and GitHandlingService
  • Implement commit history retrieval in GitFSServiceCEImpl
  • Add GET /{artifactId}/commits endpoint in GitArtifactControllerCE
  • Returns list of commits with author, message, and timestamp details

Description

Tip

Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team).

Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR.

Fixes #Issue Number
or
Fixes Issue URL

Warning

If no issue exists, please create an issue first, and check with the maintainers if the issue is valid.

Automation

/ok-to-test tags="@tag.Sanity"

🔍 Cypress test results

Tip

🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/19823507458
Commit: 09360db
Cypress dashboard.
Tags: @tag.Sanity
Spec:


Mon, 01 Dec 2025 13:35:42 UTC

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • New Features
    • Added new endpoint to retrieve commit history for git-connected artifacts with chronologically ordered logs.
    • Provides access to complete commit details and metadata.
    • Enables filtering by artifact ID and artifact type for targeted history viewing.

✏️ Tip: You can customize this high-level summary in your review settings.

Add GET endpoint to fetch git commit logs in chronological order for git-connected artifacts.

- Add getCommitHistory method to CentralGitService and GitHandlingService
- Implement commit history retrieval in GitFSServiceCEImpl
- Add GET /{artifactId}/commits endpoint in GitArtifactControllerCE
- Returns list of commits with author, message, and timestamp details
@subrata71 subrata71 requested a review from a team as a code owner December 1, 2025 12:58
@github-actions github-actions bot added the skip-changelog Adding this label to a PR prevents it from being listed in the changelog label Dec 1, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 1, 2025

Walkthrough

A new commit history retrieval feature is introduced across the git service layer. The implementation adds a vertical stack of methods from REST controller through central services to filesystem operations, enabling clients to fetch chronologically ordered commit logs for git-connected artifacts with permission checks and proper error handling.

Changes

Cohort / File(s) Summary
Commit History API Addition
app/server/appsmith-server/src/main/java/com/appsmith/server/git/controllers/GitArtifactControllerCE.java
Added new REST endpoint GET /{artifactId}/commits returning Mono<ResponseDTO<List<GitLogDTO>>> with artifact ID and type parameters; logs request and delegates to central git service
Central Git Service
app/server/appsmith-server/src/main/java/com/appsmith/server/git/central/CentralGitServiceCE.java,
app/server/appsmith-server/src/main/java/com/appsmith/server/git/central/CentralGitServiceCEImpl.java
Added interface and implementation of getCommitHistory(branchedArtifactId, artifactType, gitType) that resolves appropriate artifact helper, validates edit permissions, fetches branched artifact, and delegates to git handling service
Git Handling Service
app/server/appsmith-server/src/main/java/com/appsmith/server/git/central/GitHandlingServiceCE.java
Added public method getCommitHistory(Artifact branchedArtifact) as delegation point for commit history fetching
Git Filesystem Service
app/server/appsmith-server/src/main/java/com/appsmith/server/git/fs/GitFSServiceCEImpl.java
Implemented getCommitHistory(Artifact branchedArtifact) with git metadata validation, repository path computation, branch checkout, commit log retrieval, and error handling (GIT_ACTION_FAILED for checkout/log failures)

Sequence Diagram

sequenceDiagram
    participant Client
    participant Controller as GitArtifactControllerCE
    participant CentralSvc as CentralGitServiceCEImpl
    participant HandlingSvc as GitHandlingServiceCE
    participant FSService as GitFSServiceCEImpl
    participant Git as Git Repository

    Client->>Controller: GET /{artifactId}/commits?artifactType=X
    Controller->>CentralSvc: getCommitHistory(artifactId, artifactType, GIT_TYPE)
    
    CentralSvc->>CentralSvc: Resolve GitArtifactHelper by type
    CentralSvc->>CentralSvc: Check artifact edit permission
    CentralSvc->>CentralSvc: Fetch branched artifact by ID
    
    CentralSvc->>HandlingSvc: getCommitHistory(branchedArtifact)
    HandlingSvc->>FSService: getCommitHistory(branchedArtifact)
    
    FSService->>FSService: Validate GitArtifactMetadata & refName
    FSService->>FSService: Compute repository path
    FSService->>Git: Checkout target branch
    alt Checkout Success
        FSService->>Git: Fetch commit history (log)
        Git-->>FSService: List<GitLogDTO>
    else Checkout/Log Error
        FSService->>FSService: Wrap as GIT_ACTION_FAILED exception
    end
    
    FSService-->>HandlingSvc: Mono<List<GitLogDTO>>
    HandlingSvc-->>CentralSvc: Mono<List<GitLogDTO>>
    CentralSvc-->>Controller: Mono<List<GitLogDTO>>
    Controller-->>Client: ResponseDTO(200, List<GitLogDTO>)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Permission and artifact resolution logic in CentralGitServiceCEImpl — verify correct permission checks and artifact fetching flow
  • Git filesystem operations in GitFSServiceCEImpl — validate checkout branch logic, error wrapping (GIT_ACTION_FAILED codes), and commit log retrieval correctness
  • Layered delegation chain across all five files — confirm proper error propagation and type handling through the stack
  • GitLogDTO usage and imports — ensure DTO is properly defined and consistently used across layers

Poem

🌿 Git commits bloom in ordered rows,
Through layers deep the query flows,
From REST to store, the history gleams—
A chronicle of developer dreams! ✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ⚠️ Warning PR description is incomplete and does not follow the required template structure. Missing issue reference, TL;DR for technical content, and incomplete template sections. Add issue number/URL reference (currently shows placeholder #Issue Number), provide TL;DR given the technical nature, and complete all template sections before merging.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding an endpoint to retrieve commit history for artifacts, which aligns with all file-level changes.
✨ 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 chore/view-commit-history

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.

@subrata71 subrata71 self-assigned this Dec 1, 2025
@subrata71 subrata71 added the ok-to-test Required label for CI label Dec 1, 2025
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 (1)
app/server/appsmith-server/src/main/java/com/appsmith/server/git/central/CentralGitServiceCEImpl.java (1)

5-5: Consider aligning commit-history flow with existing locking/analytics patterns

The implementation correctly enforces edit permission and delegates to gitHandlingService.getCommitHistory, but unlike other git flows that touch the working tree (status, commit, pull, merge, discard), this path doesn’t acquire a Redis git lock or emit analytics.

Since the FS implementation performs a checkoutToBranch before reading logs, you may want to (a) wrap this in the usual gitRedisUtils.acquireGitLock/usingWhen pattern and (b) optionally add a small analytics hook, for consistency and to avoid races with other git operations. Not a blocker, but worth considering.

Also applies to: 2890-2900

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7e119f9 and 09360db.

📒 Files selected for processing (5)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/git/central/CentralGitServiceCE.java (2 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/git/central/CentralGitServiceCEImpl.java (2 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/git/central/GitHandlingServiceCE.java (2 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/git/controllers/GitArtifactControllerCE.java (1 hunks)
  • app/server/appsmith-server/src/main/java/com/appsmith/server/git/fs/GitFSServiceCEImpl.java (1 hunks)
⏰ 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). (5)
  • GitHub Check: perform-test / server-build / server-unit-tests
  • GitHub Check: perform-test / client-build / client-build
  • GitHub Check: perform-test / rts-build / build
  • GitHub Check: server-unit-tests / server-unit-tests
  • GitHub Check: server-spotless / spotless-check
🔇 Additional comments (2)
app/server/appsmith-server/src/main/java/com/appsmith/server/git/central/GitHandlingServiceCE.java (1)

3-3: New commit-history service contract looks consistent

The GitLogDTO import and getCommitHistory(Artifact branchedArtifact) signature align cleanly with the rest of the git handling API and downstream implementations. No issues from the interface side.

Also applies to: 137-138

app/server/appsmith-server/src/main/java/com/appsmith/server/git/central/CentralGitServiceCE.java (1)

3-3: Central git commit-history API is well-shaped

The getCommitHistory(String branchedArtifactId, ArtifactType artifactType, GitType gitType) signature is consistent with existing central-git methods (e.g., getStatus, pullArtifact) and exposes the right inputs for downstream resolution. Looks good.

Also applies to: 106-106

@github-actions
Copy link

github-actions bot commented Dec 1, 2025

Failed server tests

  • com.appsmith.server.helpers.UserUtilsTest#makeInstanceAdministrator_WhenUserAlreadyAdmin_MaintainsPermissionsSuccessfully

@subrata71 subrata71 merged commit 780c3c8 into release Dec 2, 2025
59 of 61 checks passed
@subrata71 subrata71 deleted the chore/view-commit-history branch December 2, 2025 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Required label for CI skip-changelog Adding this label to a PR prevents it from being listed in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants