Skip to content

Add pagination and tighten API boundaries - #6

Merged
DataTideHH merged 2 commits into
mainfrom
agent/add-pagination-validation-logging
Aug 5, 2026
Merged

Add pagination and tighten API boundaries#6
DataTideHH merged 2 commits into
mainfrom
agent/add-pagination-validation-logging

Conversation

@DataTideHH

Copy link
Copy Markdown
Owner

What changed

  • paginate and sort process-check list queries
  • return Spring Data PagedModel responses instead of serializing PageImpl directly
  • cap requested page sizes at 100
  • limit processName and owner to 120 characters in both request validation and JPA columns
  • rely on JPA dirty checking for managed updates
  • add restrained SLF4J logging for create, update and delete operations
  • extend integration tests and update the README and project page

Why

The API previously returned every matching row and did not align text-length validation with the generated database schema. This keeps the project compact while making its list behavior, persistence constraints and operational logging more deliberate.

Review notes

The logging intentionally excludes full request bodies and read requests. Pagination uses Spring Data's lightweight PagedModel; no custom response framework or additional abstraction was introduced.

Validation

GitHub Actions runs the repository's Java 21 Maven Wrapper command: ./mvnw --batch-mode --no-transfer-progress clean verify.

@DataTideHH
DataTideHH marked this pull request as ready for review August 5, 2026 07:43
Copilot AI lite review requested due to automatic review settings August 5, 2026 07:43
@DataTideHH
DataTideHH merged commit b4faffd into main Aug 5, 2026
2 checks passed
@DataTideHH
DataTideHH deleted the agent/add-pagination-validation-logging branch August 5, 2026 07:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the process-check API to return bounded, pageable list responses with stable page metadata, while tightening persistence/API constraints and adding lightweight operational logging.

Changes:

  • Switch list endpoint + service/repository to Spring Data Pageable and return PagedModel instead of serializing PageImpl.
  • Align validation and database constraints by capping processName/owner to 120 chars and enforcing max page size of 100.
  • Add write-operation logging and extend integration tests + docs to reflect pagination and constraints.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/test/java/de/datatidehh/processapi/processcheck/ProcessCheckApiIntegrationTests.java Updates list assertions for paged responses and adds validation tests for oversized fields.
src/main/resources/application.properties Configures Spring Data web pageable max page size.
src/main/java/de/datatidehh/processapi/processcheck/ProcessCheckService.java Adds pageable query support, relies on dirty checking for updates, and logs create/update/delete operations.
src/main/java/de/datatidehh/processapi/processcheck/ProcessCheckRequest.java Enforces max-length validation for processName and owner.
src/main/java/de/datatidehh/processapi/processcheck/ProcessCheckRepository.java Updates repository query method to return Page and accept Pageable.
src/main/java/de/datatidehh/processapi/processcheck/ProcessCheckController.java Exposes pageable list endpoint and returns PagedModel responses with default sorting.
src/main/java/de/datatidehh/processapi/processcheck/ProcessCheck.java Aligns entity schema with API constraints (nullability + column lengths).
README.md Documents pagination, response shape, logging, and updated validation constraints.
docs/index.md Updates project page to reflect paginated API behavior and constraints.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

spring.jpa.show-sql=false
spring.jpa.open-in-view=false

spring.data.web.pageable.max-page-size=100

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a00e476c12

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +27 to +28
? repository.findAll(pageable)
: repository.findAllByStatus(status, pageable);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Validate pageable sort fields before querying

When a caller supplies an unsupported sort key, such as sort=process_name,asc or any typo, the Pageable is passed straight into Spring Data JPA and the repository tries to resolve that value as an entity property path. Because the app only handles not-found exceptions explicitly, this invalid client input propagates as a server error instead of the expected 400-style API boundary; please whitelist allowed sort fields or translate invalid sort properties before calling the repository.

Useful? React with 👍 / 👎.

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