Skip to content

feat: Add support for repository access tokens in VCS connections#158

Merged
rostilos merged 1 commit intomainfrom
1.5.3-rc
Mar 3, 2026
Merged

feat: Add support for repository access tokens in VCS connections#158
rostilos merged 1 commit intomainfrom
1.5.3-rc

Conversation

@rostilos
Copy link
Owner

@rostilos rostilos commented Mar 3, 2026

  • Introduced RepositoryTokenRequest DTO for handling repository access token requests.
  • Implemented methods in VcsConnectionWebService to create Bitbucket Cloud and GitHub connections using repository access tokens.
  • Updated BitbucketCloudController and GitHubController to handle new repository token creation endpoints.
  • Enhanced GitGraphController to integrate analyzed commits and improve commit graph retrieval.
  • Added new dependencies for commit graph and file content analysis in pom.xml.
  • Created TestHibernate class for basic compilation testing.
  • Updated Dockerfile to optimize Java runtime installation and streamline Python dependencies.

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for repository-scoped access tokens (Fine-grained PATs and Repository Access Tokens) for GitHub, Bitbucket, and GitLab integrations.
    • Added branch parameter to git graph queries for targeted branch visualization.
    • Enabled multi-line code snippet matching for improved issue reconciliation accuracy.
  • Bug Fixes

    • Fixed database constraint for snapshot analysis references to support null values.
    • Improved file existence validation with fallback API checks.
    • Enhanced merge commit detection in webhook handling.
  • Infrastructure

    • Migrated container image distribution from local tarballs to GitHub Container Registry (GHCR).
    • Updated deployment pipeline to pull images directly from GHCR.
    • Re-enabled frontend submodule synchronization.

- Introduced `RepositoryTokenRequest` DTO for handling repository access token requests.
- Implemented methods in `VcsConnectionWebService` to create Bitbucket Cloud and GitHub connections using repository access tokens.
- Updated `BitbucketCloudController` and `GitHubController` to handle new repository token creation endpoints.
- Enhanced `GitGraphController` to integrate analyzed commits and improve commit graph retrieval.
- Added new dependencies for commit graph and file content analysis in `pom.xml`.
- Created `TestHibernate` class for basic compilation testing.
- Updated Dockerfile to optimize Java runtime installation and streamline Python dependencies.
@codecrow-local
Copy link

codecrow-local bot commented Mar 3, 2026

⚠️ Code Analysis Results

Quality Gate Default Quality Gate: 🔴 FAILED

  • HIGH Issues by Severity > 0 (actual: 2) - FAILED
  • MEDIUM Issues by Severity > 0 (actual: 4) - FAILED

Summary

Pull Request Review: feat: Add support for repository access tokens in VCS connections

Status PASS WITH WARNINGS
Risk Level HIGH
Review Coverage 66 files analyzed in depth
Confidence HIGH

Executive Summary

This PR introduces support for repository access tokens across VCS connections, involving significant changes to the web-server, analysis engine, and database schema. While the feature set is comprehensive, the implementation introduces high-risk security inconsistencies in controller authorization and a potentially destructive database migration pattern. Additionally, there are concerns regarding redundant DTO structures and missing encryption layers for sensitive tokens.

Recommendation

Decision: PASS WITH WARNINGS

The PR is functionally complete but requires immediate remediation of the missing @HasOwnerOrAdminRights security annotations and a revision of the V1.9.0 migration strategy to prevent potential data loss. Approval is conditional on addressing these high-priority architectural and security gaps.


Issues Overview

Severity Count
🔴 High 2 Critical issues requiring immediate attention
🟡 Medium 4 Issues that should be addressed
🔵 Low 6 Minor issues and improvements
ℹ️ Info 1 Informational notes and suggestions

Analysis completed on 2026-03-03 01:18:48 | View Full Report | Pull Request


📋 Detailed Issues (13)

🔴 High Severity Issues

Id on Platform: 3635

Category: 🏗️ Architecture

File: .../request/RepositoryTokenRequest.java:1

Redundant DTO Implementation for Repository Access Tokens

Redundant DTO Implementation for Repository Access Tokens
The PR introduces a generic RepositoryTokenRequest that is functionally identical to the existing GitLabRepositoryTokenRequest. Both encapsulate the same fields (accessToken, repositoryPath, connectionName, baseUrl) and Jackson annotations.
Evidence: Stage 1 findings confirm identical field structures and annotations. Cross-module context shows multiple existing VcsConnection and VcsRepoInfo implementations (e.g., VcsRepoInfoImpl.java, VcsRepoBinding.java) that already handle connection metadata, suggesting a lack of a unified DTO strategy.
Business impact: Increased maintenance overhead and risk of logic drift. If validation rules or field names change for one provider, they may be missed for others, leading to inconsistent API behavior across VCS providers.
Also affects: java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/vcs/dto/request/gitlab/GitLabRepositoryTokenRequest.java

💡 Suggested Fix

Consolidate into a single 'RepositoryTokenRequest' DTO and refactor the GitLab-specific controller to use this shared class, or have them inherit from a common base interface/class.

View Issue Details


Id on Platform: 3642

Category: 🔒 Security

File: .../cloud/BitbucketCloudController.java:1

Inconsistent Authorization Pattern on Sensitive VCS Endpoints

Inconsistent Authorization Pattern on Sensitive VCS Endpoints
New endpoints for creating repository token connections lack the '@HasOwnerOrAdminRights' security annotation, which is the established pattern for sensitive connection management in this codebase.
Evidence: BitbucketCloudController.java line 138 and GitHubController.java line 141 omit the annotation present on adjacent methods (e.g., delete/update) and in VcsIntegrationController.
Business impact: Potential privilege escalation. Users with low-level access to a workspace might be able to link external repositories or rotate tokens without proper administrative authorization.
Also affects: java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/vcs/controller/github/GitHubController.java

💡 Suggested Fix

Apply '@HasOwnerOrAdminRights' to all new repository token creation and update endpoints to ensure consistency with the existing security architecture.

View Issue Details


🟡 Medium Severity Issues

Id on Platform: 3636

Category: ⚡ Performance

File: .../controller/GitGraphController.java:141

Sequential VCS API calls in loop may cause slow response

The controller iterates over 'branchesToFetch' and performs a blocking VCS API call ('vcsClient.getCommitHistory') for each. If multiple branches are requested or the default branch is large, this will significantly increase response latency. Since this is a web controller, sequential network I/O in a loop is a performance risk.

💡 Suggested Fix

Consider fetching commit history in parallel using CompletableFuture or limiting the number of branches that trigger a VCS fetch to exactly one (the active branch).

View Issue Details


Id on Platform: 3637

Category: 🐛 Bug Risk

File: .../service/WebhookDeduplicationService.java:88

Non-atomic update in ConcurrentHashMap

The code uses putIfAbsent followed by a conditional put. In a high-concurrency environment, another thread could update the entry between the existing != null check and the recentBranchEvents.put(key, newEntry) call, leading to lost updates or incorrect deduplication state.

💡 Suggested Fix

Use the atomic compute or merge methods provided by ConcurrentHashMap to ensure the check and update happen atomically.

View Issue Details


Id on Platform: 3639

Category: 🧹 Code Quality

File: .../managed/V1.9.0__replace_dag_with_analyzed_commits.sql:1

High-Risk Database Migration Pattern

High-Risk Database Migration Pattern
The migration V1.9.0 drops core DAG tables (git_commit_node, git_commit_edge) using CASCADE in a single transaction while the application logic is being switched to the new AnalyzedCommit model.
Evidence: The SQL migration uses 'DROP TABLE ... CASCADE' while the AnalyzedCommitService begins relying on the new schema immediately. There is no evidence of a multi-phase 'expand and contract' migration strategy.
Business impact: Potential for significant downtime or data loss if the migration fails mid-way or if the application needs to be rolled back. Large table drops with CASCADE can cause long-held locks in production.
Also affects: java-ecosystem/libs/commit-graph/src/main/java/org/rostilos/codecrow/commitgraph/service/AnalyzedCommitService.java

💡 Suggested Fix

Split the migration into two phases: 1) Create new tables and sync data, 2) Drop old tables in a subsequent release after verifying the new service logic.

View Issue Details


Id on Platform: 3640

Category: 🛡️ Error Handling

File: .../service/VcsConnectionWebService.java:562

Unclosed response body in validation logic

In syncBitbucketRepositoryTokenInfo, the error path calls response.body().string() but the response body is not explicitly closed if an exception occurs during string conversion or if the try-with-resources block doesn't cover all edge cases of OkHttp response handling. While try-with-resources is used, the response.body().string() call inside a log statement can be risky if the body is large or if the stream is already consumed.

💡 Suggested Fix

Ensure the response body is handled safely. OkHttp responses must be closed to avoid resource leaks.

View Issue Details


🔵 Low Severity Issues

Id on Platform: 3638

Category: ⚡ Performance

File: .../service/WebhookDeduplicationService.java:182

Incomplete cleanup of mergePrNumbers map

The cleanupOldEntries method removes entries from mergePrNumbers only if they exist in recentCommitAnalyses. However, new entries are now also keyed by branchPr: prefix (line 216), which are never present in recentCommitAnalyses. This will cause branchPr: entries to leak memory over time as they are never cleaned up.

💡 Suggested Fix

Update the cleanup logic to also check against recentBranchEvents or use a time-based eviction for mergePrNumbers directly.

--- a/java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/generic/service/WebhookDeduplicationService.java
+++ b/java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/generic/service/WebhookDeduplicationService.java
@@ -179,5 +179,7 @@
         // Also clean up stale PR number entries (use a wider window since
         // repo:push may arrive slightly later than the dedup window)
-        mergePrNumbers.entrySet().removeIf(entry -> !recentCommitAnalyses.containsKey(entry.getKey()));
+        mergePrNumbers.entrySet().removeIf(entry -> 
+            !recentCommitAnalyses.containsKey(entry.getKey()) && 
+            !recentBranchEvents.containsKey(entry.getKey().replace("branchPr:", "")));
     }

View Issue Details


Id on Platform: 3641

Category: ✨ Best Practices

File: .../file-content/.gitignore:38

Potential accidental inclusion of Node.js/TypeScript patterns

The .gitignore file for a Java library contains 'index.ts', '.env', and 'server.log'. While '.env' and 'server.log' are generic, 'index.ts' is specific to TypeScript. If this is a pure Java module, these entries are unnecessary and might indicate a copy-paste from a different project type.

💡 Suggested Fix

Remove the TypeScript-specific 'index.ts' if this module does not contain frontend or Node.js code.

View Issue Details


Id on Platform: 3643

Category: ✨ Best Practices

File: .../web-server/TestHibernate.class:1

Compiled class file committed to repository

The file 'TestHibernate.class' is a binary artifact generated during compilation. Committing binaries increases repository size unnecessarily and can lead to merge conflicts or environment-specific execution issues. It should be removed and ignored via .gitignore.

💡 Suggested Fix

Remove the .class file from the repository and ensure *.class is covered in the root .gitignore.

View Issue Details


Id on Platform: 3644

Category: ✨ Best Practices

File: .../web-server/TestHibernate.java:3

Temporary test file in production source tree

The class 'TestHibernate' with a main method printing 'Just a compilation test' appears to be a temporary debugging tool. Such files should not be committed to the main codebase. If it is a legitimate test, it should be moved to the 'src/test/java' directory and follow the project's testing patterns.

💡 Suggested Fix

Delete this file if it was for one-time testing, or move it to the appropriate test directory if it serves a permanent purpose.

View Issue Details


Id on Platform: 3645

Category: ✨ Best Practices

File: .../commit-graph/.gitignore:38

Irrelevant ignore patterns in Java library

The .gitignore includes 'index.ts', which is specific to TypeScript/JavaScript projects. This is a Java library module ('codecrow-commit-graph'). Including irrelevant patterns can be confusing and suggests a copy-paste from a different project type.

💡 Suggested Fix

Remove 'index.ts' and other non-Java related patterns if they are not applicable to this module.

View Issue Details


Id on Platform: 3647

Category: 🧪 Testing

File: .../java/TestSaveEdges.java:3

Use of main method for testing instead of JUnit

The file uses a public static void main method for testing/verification. In this ecosystem (as seen in CodeAnalysisServiceTest.java), JUnit 5 is the standard for testing. Manual main methods in the test source set are often leftovers from local debugging.

💡 Suggested Fix

Convert this to a JUnit test case if it is intended to be part of the automated suite, or remove it if it was for one-time manual verification.

View Issue Details


ℹ️ Informational Notes

Id on Platform: 3646

Category: ✨ Best Practices

File: .../java/TestSaveEdges.java:1

Missing package declaration

The Java file is placed in a deep directory structure (org.rostilos.codecrow.core...) but lacks a package declaration. This can lead to classpath issues and violates project structure standards seen in other files like CodeAnalysisServiceTest.java which uses package org.rostilos.codecrow.core.service;.

💡 Suggested Fix

Add the appropriate package declaration at the top of the file to match its directory structure.

View Issue Details


Files Affected

  • .../java/TestSaveEdges.java: 2 issues
  • .../service/WebhookDeduplicationService.java: 2 issues
  • .../file-content/.gitignore: 1 issue
  • .../request/RepositoryTokenRequest.java: 1 issue
  • .../commit-graph/.gitignore: 1 issue
  • .../web-server/TestHibernate.java: 1 issue
  • .../service/VcsConnectionWebService.java: 1 issue
  • .../controller/GitGraphController.java: 1 issue
  • .../web-server/TestHibernate.class: 1 issue
  • .../cloud/BitbucketCloudController.java: 1 issue

@coderabbitai
Copy link

coderabbitai bot commented Mar 3, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 25f9d64 and 8329c14.

⛔ Files ignored due to path filters (1)
  • java-ecosystem/services/web-server/TestHibernate.class is excluded by !**/*.class
📒 Files selected for processing (72)
  • .github/workflows/deploy.yml
  • deployment/build/production-build.sh
  • deployment/ci/ci-build.sh
  • deployment/ci/server-deploy.sh
  • deployment/docker-compose.prod.yml
  • frontend
  • java-ecosystem/libs/analysis-engine/pom.xml
  • java-ecosystem/libs/analysis-engine/src/main/java/module-info.java
  • java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/dag/DagContext.java
  • java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/processor/analysis/BranchAnalysisProcessor.java
  • java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/processor/analysis/PullRequestAnalysisProcessor.java
  • java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/service/branch/BranchDiffFetcher.java
  • java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/service/branch/BranchFileOperationsService.java
  • java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/service/branch/BranchHealthService.java
  • java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/service/branch/BranchIssueReconciliationService.java
  • java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/service/dag/DagSyncService.java
  • java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/service/gitgraph/GitGraphSyncService.java
  • java-ecosystem/libs/analysis-engine/src/test/java/org/rostilos/codecrow/analysisengine/processor/analysis/BranchAnalysisProcessorTest.java
  • java-ecosystem/libs/analysis-engine/src/test/java/org/rostilos/codecrow/analysisengine/processor/analysis/PullRequestAnalysisProcessorTest.java
  • java-ecosystem/libs/codecrow-queue/src/main/java/module-info.java
  • java-ecosystem/libs/commit-graph/.gitignore
  • java-ecosystem/libs/commit-graph/pom.xml
  • java-ecosystem/libs/commit-graph/src/main/java/module-info.java
  • java-ecosystem/libs/commit-graph/src/main/java/org/rostilos/codecrow/commitgraph/dag/CommitRangeContext.java
  • java-ecosystem/libs/commit-graph/src/main/java/org/rostilos/codecrow/commitgraph/model/AnalyzedCommit.java
  • java-ecosystem/libs/commit-graph/src/main/java/org/rostilos/codecrow/commitgraph/persistence/AnalyzedCommitRepository.java
  • java-ecosystem/libs/commit-graph/src/main/java/org/rostilos/codecrow/commitgraph/service/AnalyzedCommitService.java
  • java-ecosystem/libs/commit-graph/src/main/java/org/rostilos/codecrow/commitgraph/service/BranchCommitService.java
  • java-ecosystem/libs/commit-graph/src/main/java/org/rostilos/codecrow/commitgraph/service/CommitCoverageService.java
  • java-ecosystem/libs/core/src/main/java/module-info.java
  • java-ecosystem/libs/core/src/main/java/org/rostilos/codecrow/core/dto/bitbucket/BitbucketCloudDTO.java
  • java-ecosystem/libs/core/src/main/java/org/rostilos/codecrow/core/model/branch/Branch.java
  • java-ecosystem/libs/core/src/main/java/org/rostilos/codecrow/core/model/gitgraph/CommitAnalysisStatus.java
  • java-ecosystem/libs/core/src/main/java/org/rostilos/codecrow/core/model/gitgraph/CommitNode.java
  • java-ecosystem/libs/core/src/main/java/org/rostilos/codecrow/core/persistence/repository/gitgraph/CommitNodeRepository.java
  • java-ecosystem/libs/core/src/main/java/org/rostilos/codecrow/core/service/CodeAnalysisService.java
  • java-ecosystem/libs/core/src/main/resources/db/migration/1.8.0/V1.8.1__fix_snapshot_analysis_id_nullable.sql
  • java-ecosystem/libs/core/src/main/resources/db/migration/managed/V1.8.1__fix_snapshot_analysis_id_nullable.sql
  • java-ecosystem/libs/core/src/main/resources/db/migration/managed/V1.9.0__replace_dag_with_analyzed_commits.sql
  • java-ecosystem/libs/core/src/test/java/TestSaveEdges.java
  • java-ecosystem/libs/file-content/.gitignore
  • java-ecosystem/libs/file-content/pom.xml
  • java-ecosystem/libs/file-content/src/main/java/module-info.java
  • java-ecosystem/libs/file-content/src/main/java/org/rostilos/codecrow/filecontent/model/AnalyzedFileContent.java
  • java-ecosystem/libs/file-content/src/main/java/org/rostilos/codecrow/filecontent/model/AnalyzedFileSnapshot.java
  • java-ecosystem/libs/file-content/src/main/java/org/rostilos/codecrow/filecontent/model/BranchFile.java
  • java-ecosystem/libs/file-content/src/main/java/org/rostilos/codecrow/filecontent/persistence/AnalyzedFileContentRepository.java
  • java-ecosystem/libs/file-content/src/main/java/org/rostilos/codecrow/filecontent/persistence/AnalyzedFileSnapshotRepository.java
  • java-ecosystem/libs/file-content/src/main/java/org/rostilos/codecrow/filecontent/persistence/BranchFileRepository.java
  • java-ecosystem/libs/file-content/src/main/java/org/rostilos/codecrow/filecontent/service/FileSnapshotService.java
  • java-ecosystem/libs/file-content/src/test/java/org/rostilos/codecrow/filecontent/model/BranchFileTest.java
  • java-ecosystem/libs/vcs-client/pom.xml
  • java-ecosystem/libs/vcs-client/src/main/java/module-info.java
  • java-ecosystem/pom.xml
  • java-ecosystem/services/pipeline-agent/pom.xml
  • java-ecosystem/services/pipeline-agent/src/main/java/module-info.java
  • java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/ProcessingApplication.java
  • java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/bitbucket/webhookhandler/BitbucketCloudBranchWebhookHandler.java
  • java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/generic/controller/ProviderWebhookController.java
  • java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/generic/service/WebhookDeduplicationService.java
  • java-ecosystem/services/web-server/TestHibernate.java
  • java-ecosystem/services/web-server/pom.xml
  • java-ecosystem/services/web-server/src/main/java/module-info.java
  • java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/WebserverApplication.java
  • java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/analysis/controller/GitGraphController.java
  • java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/analysis/service/FileViewService.java
  • java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/project/service/ProjectService.java
  • java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/vcs/controller/cloud/BitbucketCloudController.java
  • java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/vcs/controller/github/GitHubController.java
  • java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/vcs/dto/request/RepositoryTokenRequest.java
  • java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/vcs/service/VcsConnectionWebService.java
  • python-ecosystem/inference-orchestrator/Dockerfile

📝 Walkthrough

Walkthrough

This pull request replaces the repository-based DAG (Directed Acyclic Graph) commit tracking system with a lightweight, VCS-backed analyzed-commit model. It introduces new commit-graph and file-content modules, migrates Git commit data to an analyzed_commit table, refactors analysis processors to use BranchCommitService and AnalyzedCommitService, and updates deployment to push Docker images directly to GitHub Container Registry instead of using tarballs.

Changes

Cohort / File(s) Summary
Deployment Configuration
.github/workflows/deploy.yml, deployment/build/production-build.sh, deployment/ci/ci-build.sh, deployment/ci/server-deploy.sh, deployment/docker-compose.prod.yml
Updated deployment to use GHCR for image storage; removed tarball-based image transfer; added GHCR authentication and repository owner variable; activated frontend submodule sync logic.
Database Migrations & Schema
java-ecosystem/libs/core/src/main/resources/db/migration/.../V1.8.1__fix_snapshot_analysis_id_nullable.sql, java-ecosystem/libs/core/src/main/resources/db/migration/managed/V1.9.0__replace_dag_with_analyzed_commits.sql
Added analyzed_commit table with project/commit-hash uniqueness; migrated analysis data from git_commit_node; added last_known_head_commit column to branch table; removed obsolete DAG tables (git_commit_edge, git_commit_node).
New commit-graph Module
java-ecosystem/libs/commit-graph/...
Created new module with CommitRangeContext, AnalyzedCommit entity, AnalyzedCommitRepository, BranchCommitService, AnalyzedCommitService, CommitCoverageService; includes module descriptor and configuration.
New file-content Module
java-ecosystem/libs/file-content/...
Created new module; relocated BranchFile, AnalyzedFileContent, AnalyzedFileSnapshot models and related repositories/services from core to this module; includes module descriptor.
Analysis Engine Core Changes
java-ecosystem/libs/analysis-engine/pom.xml, java-ecosystem/libs/analysis-engine/src/main/java/module-info.java, java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/dag/DagContext.java, java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/service/dag/DagSyncService.java, java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/service/gitgraph/GitGraphSyncService.java
Removed DagContext, DagSyncService, and GitGraphSyncService entirely; added dependencies on codecrow-commit-graph and codecrow-file-content; adjusted module-info to remove git-graph exports.
BranchAnalysisProcessor Refactoring
java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/processor/analysis/BranchAnalysisProcessor.java, java-ecosystem/libs/analysis-engine/src/test/java/org/rostilos/codecrow/analysisengine/processor/analysis/BranchAnalysisProcessorTest.java
Replaced DagSyncService with BranchCommitService and AnalyzedCommitService; updated to use CommitRangeContext; added merge-commit safety logic; updated metrics calls; added first-analysis detection and skip paths.
PullRequestAnalysisProcessor Refactoring
java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/processor/analysis/PullRequestAnalysisProcessorTest.java, java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/processor/analysis/PullRequestAnalysisProcessor.java
Replaced GitGraphSyncService with AnalyzedCommitService; simplified markPrCommitsAnalyzed to directly record PR HEAD commit; removed DAG traversal logic.
BranchDiffFetcher Refactoring
java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/service/branch/BranchDiffFetcher.java
Replaced DagContext with CommitRangeContext; restructured diff resolution to support first-analysis baseline, PR-scoped diffs, and range-based fallbacks; added multiple diff strategy tiers.
BranchHealthService & Related Updates
java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/service/branch/BranchHealthService.java, java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/service/branch/BranchFileOperationsService.java, java-ecosystem/libs/analysis-engine/src/main/java/org/rostilos/codecrow/analysisengine/service/branch/BranchIssueReconciliationService.java
Updated BranchHealthService to use AnalyzedCommitService and renamed markDagCommitsAnalyzed to recordCommitsAnalyzed; updated BranchFileOperationsService to import from filecontent module; refactored BranchIssueReconciliationService for per-line snippet matching instead of block-level hashing.
Core Module Updates
java-ecosystem/libs/core/src/main/java/module-info.java, java-ecosystem/libs/core/src/main/java/org/rostilos/codecrow/core/model/branch/Branch.java, java-ecosystem/libs/core/src/main/java/org/rostilos/codecrow/core/model/gitgraph/CommitAnalysisStatus.java, java-ecosystem/libs/core/src/main/java/org/rostilos/codecrow/core/model/gitgraph/CommitNode.java, java-ecosystem/libs/core/src/main/java/org/rostilos/codecrow/core/persistence/repository/gitgraph/CommitNodeRepository.java
Added lastKnownHeadCommit field to Branch; removed CommitAnalysisStatus enum, CommitNode entity, and CommitNodeRepository; removed git-graph exports from module-info; expanded exports for new packages.
CodeAnalysisService & Bitbucket Updates
java-ecosystem/libs/core/src/main/java/org/rostilos/codecrow/core/service/CodeAnalysisService.java, java-ecosystem/libs/core/src/main/java/org/rostilos/codecrow/core/dto/bitbucket/BitbucketCloudDTO.java
Refactored CodeAnalysisService line correction for multi-line snippets (per-line hashing); updated BitbucketCloudDTO.fromGitConfiguration to handle REPOSITORY_TOKEN connections.
VCS Client Updates
java-ecosystem/libs/vcs-client/pom.xml, java-ecosystem/libs/vcs-client/src/main/java/module-info.java
Added kotlin-stdlib dependency for OkHttp 4.x support in JPMS.
Pipeline Agent Module Updates
java-ecosystem/services/pipeline-agent/pom.xml, java-ecosystem/services/pipeline-agent/src/main/java/module-info.java, java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/ProcessingApplication.java, java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/bitbucket/webhookhandler/BitbucketCloudBranchWebhookHandler.java, java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/generic/controller/ProviderWebhookController.java, java-ecosystem/services/pipeline-agent/src/main/java/org/rostilos/codecrow/pipelineagent/generic/service/WebhookDeduplicationService.java
Added commit-graph and file-content module dependencies; updated component and repository scanning; added branch-level deduplication and cross-event PR number enrichment; added methods for recording PR numbers by branch name.
Web Server Module Updates
java-ecosystem/services/web-server/pom.xml, java-ecosystem/services/web-server/src/main/java/module-info.java, java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/WebserverApplication.java, java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/analysis/controller/GitGraphController.java, java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/analysis/service/FileViewService.java, java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/project/service/ProjectService.java
Added commit-graph, file-content, analysis-engine module dependencies; updated scans and repository configuration; replaced CommitNodeRepository with AnalyzedCommitRepository in ProjectService; refactored GitGraphController to fetch commits from VCS API with real-time analysis enrichment; updated file service import paths.
VCS Connection Service Updates
java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/vcs/dto/request/RepositoryTokenRequest.java, java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/vcs/controller/cloud/BitbucketCloudController.java, java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/vcs/controller/github/GitHubController.java, java-ecosystem/services/web-server/src/main/java/org/rostilos/codecrow/webserver/vcs/service/VcsConnectionWebService.java
Added RepositoryTokenRequest DTO; added repository-token connection creation endpoints for Bitbucket Cloud and GitHub; extended VcsConnectionWebService with token-based connection methods and TokenEncryptionService dependency; added repository validation logic for token-based connections.
Build and Infrastructure
java-ecosystem/pom.xml, java-ecosystem/libs/codecrow-queue/src/main/java/module-info.java, python-ecosystem/inference-orchestrator/Dockerfile, frontend (submodule), java-ecosystem/libs/core/src/test/java/TestSaveEdges.java, java-ecosystem/services/web-server/TestHibernate.java
Added commit-graph, file-content modules to parent POM and dependency management; removed codecrow-queue module descriptor; updated Docker build to use eclipse-temurin JRE and adjusted Python entrypoint; updated frontend submodule commit; added placeholder test files.

Sequence Diagram(s)

sequenceDiagram
    participant VC as VCS Client
    participant BCS as BranchCommitService
    participant ACS as AnalyzedCommitService
    participant DB as Database
    participant AP as Analysis Processor

    VC->>BCS: resolveCommitRange(project, branch, headCommit)
    BCS->>DB: getLastKnownHeadCommit(branch)
    DB-->>BCS: lastKnownHead
    
    alt First Analysis
        BCS->>BCS: Create firstAnalysis context
        BCS-->>AP: CommitRangeContext(headCommit, null, false)
    else Normal Path
        BCS->>VC: fetchRecentCommits(branch, limit)
        VC-->>BCS: commits list
        BCS->>BCS: Build unanalyzed list (from lastKnownHead to HEAD)
        BCS->>ACS: filterUnanalyzed(unanalyzedCommits)
        ACS->>DB: Check analyzed_commit table
        DB-->>ACS: already-analyzed hashes
        ACS-->>BCS: filtered unanalyzed
        BCS-->>AP: CommitRangeContext(unanalyzedCommits, lastKnownHead, false)
    end
    
    AP->>AP: Perform analysis on unanalyzedCommits
    AP->>ACS: recordBranchCommitsAnalyzed(commits)
    ACS->>DB: Insert into analyzed_commit
    DB-->>ACS: Success
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • PR #126: Directly related — this PR removes the CommitNode/GitGraphSyncService/CommitNodeRepository DAG infrastructure that was introduced in PR #126, replacing it with the new AnalyzedCommit/commit-graph model and services.
  • PR #146: Related — both PRs modify the same production-build.sh frontend submodule synchronization logic, specifically the fetch and reset behavior for the frontend submodule.
  • PR #59: Related — both PRs update the frontend submodule pointer by changing the submodule commit reference.

Poem

🐰 Graphs of commits once stored, now cast aside,
Range-based analysis takes the helm with pride,
GHCR catches images in the cloud,
File-content and commit-graph, modular and proud!
The DAG era ends, fresh logic arrives—
CodeCrow's refactored heart now thrives. 🐇✨

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 1.5.3-rc

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.

1 participant