Skip to content

Match Cycles: Implemented getting a list of match cycles based on filter criteria - #128

Draft
Allimonae wants to merge 1 commit into
graphite-base/128from
get-filter-match-cycle
Draft

Allimonae wants to merge 1 commit into
graphite-base/128from
get-filter-match-cycle

Conversation

@Allimonae

@Allimonae Allimonae commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Overview

Adds a GET /api/admin/match_cycles endpoint for listing match cycles.

The endpoint accepts optional period, startTime, endTime, and isDraft query parameters, which are passed to the existing repo-level filtering as a MatchCycleFilterCriteria. With no parameters, it returns every match cycle. The response is wrapped in the standard ApiResponder with the message "Match Cycles retrieved successfully".

MatchCycleService.filterMatchCycles replaces the commented-out stub. It delegates to MatchCycleRepo.filterMatchCycles and maps each result to a MatchCycleResponse.

MatchCycleSqlRepo.filterMatchCycles now appends ORDER BY run_at DESC, so results come back newest run first.

Testing

Added automated tests covering each layer:

  • MatchCycleControllerTest (new, @WebMvcTest):
    • A request returns 200 with the expected payload and message.
    • A request with no parameters passes empty criteria to the service.
    • Every query parameter (period, startTime, endTime, isDraft) is parsed and passed into the criteria.
    • A non-ISO startTime such as yesterday returns 400 with success: false, and the service is never called.
  • MatchCycleServiceTest (new):
    • Repo results are mapped to responses in the order the repo returns them.
    • The criteria is passed through to the repo unchanged, and an empty result comes back as an empty list.
  • MatchCycleSqlRepoTest (updated): the expected SQL for the filter query now includes ORDER BY run_at DESC.

UI Changes

No UI changes. This is a backend API addition only.

Allimonae commented Oct 6, 2026 •

Copy link
Copy Markdown
Member Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Allimonae
Allimonae force-pushed the get-filter-match-cycle branch from 01d6012 to 84dd53a Compare October 6, 2026 20:52
@sonarqubecloud

sonarqubecloud Bot commented Oct 6, 2026

Copy link
Copy Markdown

}

@PatchMapping("/admin/{id}/score")
@PatchMapping("/{id}/score")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we taking this out? i thought we were gated by this somewhere

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.

2 participants