Skip to content

Develop: user profile endpoints, Traefik proxy and Google Books fixes - #27

Merged
felipemelozx merged 8 commits into
mainfrom
develop
Oct 28, 2026
Merged

felipemelozx merged 8 commits into
mainfrom
develop

Conversation

@felipemelozx

@felipemelozx felipemelozx commented May 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

Features

  • User profile endpoints — get, update, change password and delete account
  • Traefik integrated as reverse proxy

Fixes — Google Books search

  • Gateway now sends the configured GOOGLE_BOOKS_API_KEY as the key query param (the anonymous quota is 0/day, so every search returned 429)
  • Applies google.books.timeout-ms (connect/read) and google.books.max-results to the RestClient — previously ignored
  • 429 Too Many Requests is now mapped to a 503 with a clear message instead of a generic silent 500
  • RestExceptionHandler logs unexpected exceptions (was swallowing them without any log)
  • ExternalApiException now has a dedicated handler mapping its status code

Tests / CI

  • Google Books API mocked in gateway and controller integration tests (no more flaky tests hitting the real API)
  • SonarCloud: Java 21 requirement fix, deprecated actions update, warnings resolved

Validation

  • mvn checkstyle:check → 0 violations
  • 50/50 tests passing (BookControllerIntegrationTest 26, GoogleBooksGatewayImplTest 13, GoogleBooksMapperTest 5, SearchBooksUseCaseImplTest 6)
  • End-to-end verified with a local mock of the Google Books API: with key → 200 with volumes; without key → clean 503 quota message

Deploy note: set the GOOGLE_BOOKS_API_KEY environment variable so /books/search returns 200 (without it the endpoint responds 503 with a quota message).

…e account)

- GET/PUT/DELETE /users/me and PUT /users/me/password
- Edit name without password; email change requires current password
- Delete account requires current password; DB cascade via @onDelete
- Implement UserGateway findById/update/deleteById
- Fix GoogleBooksGatewayImpl CGLIB proxying for integration tests
- Update CORS front.url to localhost
- gateway now sends the configured GOOGLE_BOOKS_API_KEY as the key
  query param (anonymous quota is 0/day, so every search returned 429)
- apply google.books.timeout-ms to the RestClient (connect/read)
- use google.books.max-results instead of hardcoded 10
- map 429 to a 503 response with a clear message instead of a generic
  500 that was swallowed without logging
- log unexpected exceptions in RestExceptionHandler
- update gateway test stubs for the new onStatus handlers and uri form
@felipemelozx felipemelozx changed the title feat: integrate Traefik as reverse proxy Develop: user profile endpoints, Traefik proxy and Google Books fixes Oct 28, 2026
Native 'assert' statements are disabled unless the JVM runs with -ea,
so the verifications could silently never execute. Using JUnit
Assertions (assertEquals/assertTrue) also satisfies the SonarCloud
reliability rule S5961.
Setting build-mode: none enables buildless Java extraction and
silences the overlay warning ('build-mode is set to undefined instead
of none'). The Autobuild step is no longer needed with this mode.
Also re-enabled the workflow, which GitHub had disabled due to
inactivity (it only ran on schedule against main with the old
actions/cache@v4 + codeql-action@v3 versions).
@sonarqubecloud

Copy link
Copy Markdown

@felipemelozx
felipemelozx merged commit 093828f into main Oct 28, 2026
7 checks passed
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