Skip to content

Conversation

@Boy132
Copy link
Member

@Boy132 Boy132 commented Sep 3, 2025

Some parts where already removed when we removed the old admin area. This removes the remaining leftovers.

@Boy132 Boy132 self-assigned this Sep 3, 2025
@coderabbitai
Copy link

coderabbitai bot commented Sep 3, 2025

📝 Walkthrough

Walkthrough

Batch handling for activity logs was removed across the codebase: model annotations and validation dropped, batch service and its DI binding deleted, service constructor updated to remove batch dependency and usage, transformer no longer outputs batch, and a migration drops the batch column with a down reversal.

Changes

Cohort / File(s) Summary of changes
Model: ActivityLog
app/Models/ActivityLog.php
Removed docblock `@property string
Service Provider bindings
app/Providers/ActivityLogServiceProvider.php
Removed import and scoped binding for ActivityLogBatchService; only ActivityLogTargetableService remains registered.
Services: Batch handling (removed)
app/Services/Activity/ActivityLogBatchService.php
Deleted file and class ActivityLogBatchService (uuid/start/end/transaction logic removed).
Services: ActivityLogService
app/Services/Activity/ActivityLogService.php
Constructor signature updated to remove ActivityLogBatchService dependency; getActivity() no longer assigns batch UUID.
API Transformer
app/Transformers/Api/Client/ActivityLogTransformer.php
Removed 'batch' => $model->batch from transformed output.
Database migration
database/migrations/2025_09_03_080547_remove_batch_column_from_activity_logs.php
New migration drops batch column on up(); restores nullable string(36) batch on down().

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant Svc as ActivityLogService
  participant DB as Database
  Note over Caller,Svc: Old flow (before removal)
  participant Batch as ActivityLogBatchService

  Caller->>Svc: getActivity()/log(...)
  Svc->>Batch: uuid()
  Batch-->>Svc: batch UUID
  Svc->>DB: create ActivityLog (includes batch)
  DB-->>Svc: ActivityLog saved
  Svc-->>Caller: result
Loading
sequenceDiagram
  autonumber
  actor Caller
  participant Svc as ActivityLogService
  participant DB as Database
  Note over Caller,Svc: New flow (after removal)
  Caller->>Svc: getActivity()/log(...)
  Svc->>DB: create ActivityLog (no batch)
  DB-->>Svc: ActivityLog saved
  Svc-->>Caller: result
Loading

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 0

🧹 Nitpick comments (3)
database/migrations/2025_09_03_080547_remove_batch_column_from_activity_logs.php (3)

12-17: Guard the drop and account for potential index.

To avoid failures on envs where the column is already gone (or to ease repeated deploys), consider guarding with Schema::hasColumn and optionally dropping any index before the column.

 public function up(): void
 {
-    Schema::table('activity_logs', function (Blueprint $table) {
-        $table->dropColumn('batch');
-    });
+    if (Schema::hasColumn('activity_logs', 'batch')) {
+        Schema::table('activity_logs', function (Blueprint $table) {
+            // If 'batch' was indexed, uncomment the next line:
+            // $table->dropIndex(['batch']);
+            $table->dropColumn('batch');
+        });
+    }
 }

24-26: Prefer uuid() for clarity; confirm original type/nullability.

If this was a UUID, using uuid() documents intent and maps to CHAR(36) on MySQL.

-            $table->string('batch', 36)->nullable();
+            $table->uuid('batch')->nullable();

12-17: Operational note: dropping a column on large tables can lock or rebuild.

Coordinate rollout during a low-traffic window and test on staging to estimate migration time for your DB engine/version.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 8f277aa and d7271c4.

📒 Files selected for processing (6)
  • app/Models/ActivityLog.php (0 hunks)
  • app/Providers/ActivityLogServiceProvider.php (0 hunks)
  • app/Services/Activity/ActivityLogBatchService.php (0 hunks)
  • app/Services/Activity/ActivityLogService.php (0 hunks)
  • app/Transformers/Api/Client/ActivityLogTransformer.php (0 hunks)
  • database/migrations/2025_09_03_080547_remove_batch_column_from_activity_logs.php (1 hunks)
💤 Files with no reviewable changes (5)
  • app/Transformers/Api/Client/ActivityLogTransformer.php
  • app/Providers/ActivityLogServiceProvider.php
  • app/Models/ActivityLog.php
  • app/Services/Activity/ActivityLogService.php
  • app/Services/Activity/ActivityLogBatchService.php
🔇 Additional comments (2)
database/migrations/2025_09_03_080547_remove_batch_column_from_activity_logs.php (2)

7-28: LGTM: Simple, symmetric migration.

The up/down pair is clean and matches the PR intent to remove the batch surface.


1-28: dropColumn('batch') migration is safe as-is: composer.json includes doctrine/dbal (~3.6.0), no indexes/uniques on batch exist, and there are no remaining code references.

@Boy132 Boy132 merged commit 7ace397 into main Sep 3, 2025
25 checks passed
@Boy132 Boy132 deleted the boy132/fix-batch-uuid branch September 3, 2025 20:26
@github-actions github-actions bot locked and limited conversation to collaborators Sep 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants