Skip to content

test: cover the API endpoints added without tests - #1261

Merged
mnapoli merged 1 commit into
productionfrom
test/cover-api-endpoints
Oct 28, 2026
Merged

mnapoli merged 1 commit into
productionfrom
test/cover-api-endpoints

Conversation

@mnapoli

@mnapoli mnapoli commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

752f4f3 added 14 API endpoints to production without tests, so coverage fell to 98% and every tests run since has failed the exact-100% gate.

This adds feature tests for pins, restoration, translation, commit and user search, mention and issue suggestions, scheduled commits, devices, and the settings, timezone and translation preferences. No app code changes.

Summary by CodeRabbit

  • Tests
    • Expanded coverage for signed API workflows, including commit pinning, restoration, search, translation, scheduling, device management, and user settings.
    • Added checks for authentication, authorization, validation errors, ownership boundaries, and expected responses across API endpoints.
    • Covered edge cases such as stale requests, retries, timeouts, deleted records, and invalid preferences.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 01042fb3-4a63-43b7-8f4e-bb049e6b3a06
Commits

Reviewing files that changed from the base of the PR and between 9184f62 and 7cf8445.

Files selected for processing: 14
  • tests/Feature/Controllers/Api/CommitPinControllerTest.php
  • tests/Feature/Controllers/Api/CommitRestorationControllerTest.php
  • tests/Feature/Controllers/Api/CommitSearchControllerTest.php
  • tests/Feature/Controllers/Api/CommitTranslationControllerTest.php
  • tests/Feature/Controllers/Api/DeviceControllerTest.php
  • tests/Feature/Controllers/Api/IssueSuggestionControllerTest.php
  • tests/Feature/Controllers/Api/MentionSuggestionControllerTest.php
  • tests/Feature/Controllers/Api/ScheduledCommitControllerTest.php
  • tests/Feature/Controllers/Api/ScheduledCommitSubmissionControllerTest.php
  • tests/Feature/Controllers/Api/UserAutomaticTranslationControllerTest.php
  • tests/Feature/Controllers/Api/UserSearchControllerTest.php
  • tests/Feature/Controllers/Api/UserSettingsControllerTest.php
  • tests/Feature/Controllers/Api/UserTimezoneControllerTest.php
  • tests/Feature/Controllers/Api/UserTranslationLanguageControllerTest.php

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

Adds feature tests for API endpoints covering commits, scheduled commits, suggestions, search, devices, and user settings. The tests check signed-request access, validation, response data, ownership, and state changes.

Changes: Commit API tests

Layer / File(s) Summary
Commit pinning and access cases
tests/Feature/Controllers/Api/CommitPinControllerTest.php
Tests pin replacement and removal, stale unpin requests, ownership, eligible commits, and signed requests.
Commit restoration outcomes
tests/Feature/Controllers/Api/CommitRestorationControllerTest.php
Tests restoration responses, timing limits, repeated requests, ownership, deleted commits, and signed requests.
Commit search results and validation
tests/Feature/Controllers/Api/CommitSearchControllerTest.php
Tests result ordering and fields, filtering, limits, query validation, and signed requests.
Commit translation responses
tests/Feature/Controllers/Api/CommitTranslationControllerTest.php
Tests translation results, eligibility, validation, provider failures and retries, stored-body preservation, and signed requests.

Scheduled-commit API tests

Layer / File(s) Summary
Queue, scheduling, and cancellation
tests/Feature/Controllers/Api/ScheduledCommitControllerTest.php
Tests queue contents, scheduling inputs and outcomes, cancellation, ownership, timeouts, and signed requests.
Scheduled-commit submission
tests/Feature/Controllers/Api/ScheduledCommitSubmissionControllerTest.php
Tests submission state and commit linkage, duplicate or canceled submissions, ownership, timeouts, and signed requests.

Suggestion and search API tests

Layer / File(s) Summary
Mention suggestion results and context
tests/Feature/Controllers/Api/MentionSuggestionControllerTest.php
Tests follow ordering, filtering, organization and reply or quote context, validation, and signed requests.
User search results
tests/Feature/Controllers/Api/UserSearchControllerTest.php
Tests matching, follow-state fields, private-field omission, muted and blocked-user filtering, validation, and signed requests.
Issue suggestion lookup
tests/Feature/Controllers/Api/IssueSuggestionControllerTest.php
Tests GitHub lookup responses, query validation, and signed requests.

Device and user API tests

Layer / File(s) Summary
Device listing and revocation
tests/Feature/Controllers/Api/DeviceControllerTest.php
Tests device listing and revocation, ownership, signing-device revocation, and signed requests.
User settings response
tests/Feature/Controllers/Api/UserSettingsControllerTest.php
Tests configured and default settings, language entries and sorting, admin-handle matching, and signed requests.
User preference updates
tests/Feature/Controllers/Api/UserAutomaticTranslationControllerTest.php, tests/Feature/Controllers/Api/UserTimezoneControllerTest.php, tests/Feature/Controllers/Api/UserTranslationLanguageControllerTest.php
Tests preference updates, validation, clearing values, response fields, and signed requests.

Priority: High

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Possibly related PRs

Suggested reviewers: nunomaduro, simonhamp

Merge Risk: Minimal · up to 7cf84

No merge-blocking issue is established. Run the normal test suite before merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "test: cover the API endpoints added without tests" matches the changeset. All the files add feature tests for API endpoints (pins, restoration, translation, search, suggestions, scheduled c…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "test: cover the API endpoints added without tests" matches the changeset. All the files add feature tests for API endpoints (pins, restoration, translation, search, suggestions, scheduled commits, devices, settings, timezone, and translation language). The PR makes no application-code changes, and the title says so through the "test:" prefix. It names the main change without a file list, and it is specific enough for a teammate scanning history to understand the change.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 14 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@mnapoli
mnapoli merged commit 67d3647 into production Oct 28, 2026
10 checks passed
@mnapoli
mnapoli deleted the test/cover-api-endpoints branch October 28, 2026 13:23
richardkeep pushed a commit to richardkeep/dev-null.sh that referenced this pull request Oct 30, 2026
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