feat: add easy-paging-demo (first runnable example)#2
Merged
Conversation
2 tasks
jlc488
added a commit
that referenced
this pull request
May 23, 2026
Two bugs in the workflow from #1 conspired to make path-filtered builds silently skip on every PR. Discovered while opening #2, the first demo PR, where the build job was reported as 'skipping' even though easy-paging-demo/ was clearly the changed directory. Bug 1 — GitHub Actions ternary trap on fetch-depth fetch-depth: ${{ github.event_name == 'pull_request' && 0 || 1 }} The intent was "0 (full history) on PRs, 1 (shallow) otherwise". But in Actions expressions, `0` is falsy, so `0 || 1` short-circuits to `1`. The expression evaluated to `1` on both PRs and main pushes, leaving PR checkouts with no history beyond the merge commit. Bug 2 — silent failure on git diff mapfile -t changed_files < <(git diff --name-only "$base" HEAD) With bug 1 in effect, `git diff` exited with "fatal: bad object" because the base SHA wasn't fetched. But process substitution does not propagate the subshell's exit status under `set -e`, so the script kept going with an empty `changed_files` array — and therefore an empty matrix and a "skipped" build job. CI looked green, but it had built nothing. Fix: - fetch-depth: 0 unconditionally. Cost is negligible for this repo and removes the ternary footgun entirely. - Run git diff in a separate statement so `set -e` actually catches a non-zero exit, with an explicit ::error:: pointer to the likely cause (shallow checkout) so the next person debugging this gets a head start. Verification will happen on the next PR (the rebase of #2) — the matrix should populate with easy-paging-demo and the build job should actually execute ./gradlew build instead of skipping.
First demo in this repo. Showcases the basic offset-pagination path of easy-paging-spring-boot-starter (0.4.0): one @AutoPaginate annotation on a controller method, plain MyBatis mapper with no LIMIT/OFFSET, and a Spring Data-shaped JSON envelope in the response. Stack: - Spring Boot 3.5.3 on Java 21 - MyBatis (transitive via the starter) - H2 in-memory DB, schema + 137 seeded report rows applied on startup - Standalone Gradle build (own settings.gradle.kts + gradlew) Includes a smoke test (ReportControllerTest) that boots the app and asserts the pagination envelope shape and maxSize clamping, so CI proves the starter wires up correctly end-to-end. Intentionally minimal — keyset/cursor pagination, custom response shapes, and the reactive starter will each get their own demos under this repo rather than bloating this one. Top-level README updated to link this demo and its Maven Central coordinates.
2b4d455 to
e4724e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First demo in this repo. Showcases the basic offset-pagination path of `easy-paging-spring-boot-starter` (0.4.0): one `@AutoPaginate` annotation on a controller, plain MyBatis mapper with no `LIMIT`/`OFFSET`, and a Spring Data-shaped JSON envelope in the response.
Also doubles as the template every future demo in this repo will copy from — independent Gradle build, standalone wrapper, self-contained DB.
Stack
What's in the diff
Verification
CI expectation
The `detect` job from the CI workflow added in #1 should:
If the matrix detection or path-filtering misbehaves, this PR will surface it.
What's next (not in this PR)
The starter has more features that each deserve their own demo rather than crowding this one:
Follow-up PRs.
Test plan