Skip to content

Remove endpoint to fetch all data in one go for an album#4124

Merged
ildyria merged 2 commits intomasterfrom
drop-main-album-controller-function
Feb 27, 2026
Merged

Remove endpoint to fetch all data in one go for an album#4124
ildyria merged 2 commits intomasterfrom
drop-main-album-controller-function

Conversation

@ildyria
Copy link
Member

@ildyria ildyria commented Feb 27, 2026

Summary by CodeRabbit

  • Chores
    • Removed the public album retrieval API endpoint; clients must use the newer album endpoints or head-based calls.
  • Tests
    • Updated integration tests to target the new album endpoints and removed a legacy backward-compatibility test validating the old endpoint.

@ildyria ildyria requested a review from a team as a code owner February 27, 2026 12:15
@coderabbitai
Copy link

coderabbitai bot commented Feb 27, 2026

📝 Walkthrough

Walkthrough

This PR removes the album retrieval API endpoint and its related resource classes. The GET /Album route, AlbumController::get(), and four album resource classes (AbstractAlbumResource, AlbumResource, SmartAlbumResource, TagAlbumResource) were deleted; associated tests were adjusted or removed.

Changes

Cohort / File(s) Summary
API Route & Controller
routes/api_v2.php, app/Http/Controllers/Gallery/AlbumController.php
Deleted the GET /Album route and the controller method AlbumController::get(...), removing endpoint logic and AlbumVisit dispatch.
Album Resource Classes
app/Http/Resources/Models/AbstractAlbumResource.php, app/Http/Resources/Models/AlbumResource.php, app/Http/Resources/Models/SmartAlbumResource.php, app/Http/Resources/Models/TagAlbumResource.php
Removed four data/resource classes and their constructors, properties, traits, and factory methods that serialized album, smart-album, tag-album, and abstract album data.
Tests
tests/Feature_v2/Album/AlbumTest.php, tests/Feature_v2/PaginationIntegrationTest.php
Updated AlbumTest::testGet to call Album::head instead of Album; removed the backward-compatibility test testBackwardCompatibilityWithLegacyEndpoint from pagination tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 I nibble lines of code so neat,
I hop where old endpoints used to meet,
Deleted crumbs and tidied seams,
New routes dream bright in morning beams,
A rabbit's cheer for leaner streams 🥕

🚥 Pre-merge checks | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

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.

🧹 Nitpick comments (1)
tests/Feature_v2/Album/AlbumTest.php (1)

25-32: Consider renaming the test method for clarity.

The method name testGet was appropriate when testing the removed /Album GET endpoint, but now that it tests the Album::head endpoint's validation, a more descriptive name like testHeadRequiresAlbumId would better reflect its purpose.

✨ Optional rename for improved readability
-	public function testGet(): void
+	public function testHeadRequiresAlbumId(): void
 	{
 		$response = $this->getJson('Album::head');
 		$this->assertUnprocessable($response);
 		$response->assertJson([
 			'message' => 'The album id field is required.',
 		]);
 	}

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e68883d and 54b2d14.

📒 Files selected for processing (2)
  • tests/Feature_v2/Album/AlbumTest.php
  • tests/Feature_v2/PaginationIntegrationTest.php
💤 Files with no reviewable changes (1)
  • tests/Feature_v2/PaginationIntegrationTest.php

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.46%. Comparing base (71053b2) to head (54b2d14).
⚠️ Report is 2 commits behind head on master.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ildyria ildyria merged commit 90b0c8b into master Feb 27, 2026
44 checks passed
@ildyria ildyria deleted the drop-main-album-controller-function branch February 27, 2026 15:26
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