Skip to content

Release v1.2.0#49

Merged
mklocek merged 1 commit intomainfrom
release-v1.2.0
Mar 23, 2026
Merged

Release v1.2.0#49
mklocek merged 1 commit intomainfrom
release-v1.2.0

Conversation

@piobeny
Copy link
Copy Markdown
Contributor

@piobeny piobeny commented Mar 9, 2026

Motivation

  • Release version 1.2.0

Changes

  • Add Stats & Email Logs API

Summary by CodeRabbit

  • Documentation
    • Updated installation documentation and setup guides to reflect the latest mailtrap-java library version across Maven, Gradle Groovy, and Gradle Kotlin DSL package manager instructions.

@piobeny piobeny requested a review from VladimirTaytor March 9, 2026 10:06
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 38a04bf0-63d3-493d-b499-09d809f59c44

📥 Commits

Reviewing files that changed from the base of the PR and between ed5e9a0 and 59d2d66.

📒 Files selected for processing (3)
  • README.md
  • docs/getting-started.md
  • pom.xml
✅ Files skipped from review due to trivial changes (3)
  • docs/getting-started.md
  • README.md
  • pom.xml

📝 Walkthrough

Walkthrough

Updated the mailtrap-java dependency version from 1.1.0 to 1.2.0 across documentation and project configuration files, including Maven, Gradle Groovy, and Gradle Kotlin DSL installation snippets.

Changes

Cohort / File(s) Summary
Documentation Updates
README.md, docs/getting-started.md
Bumped mailtrap-java dependency version from 1.1.0 to 1.2.0 in Maven, Gradle Groovy, and Gradle Kotlin DSL installation examples.
Project Configuration
pom.xml
Updated Maven artifact version from 1.1.0 to 1.2.0.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • Release v1.1.0 #43: Modifies pom.xml version and README installation snippets for dependency version updates.
  • Updated README.md #45: Updates README install snippets with mailtrap-java dependency version changes.

Suggested reviewers

  • vitalii-t
  • IgorDobryn

Poem

🐰 Version bumps up from one to two,
Dependencies fresh and code made new,
Docs and config now in sync,
A tiny hop towards the brink! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 21.74% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Release v1.2.0' directly matches the main change shown in the raw summary, which is updating the library version from 1.1.0 to 1.2.0 across all configuration files.
Description check ✅ Passed The PR description includes Motivation and Changes sections but omits the 'How to test' and 'Images and GIFs' sections from the template. However, for a version release PR updating dependencies, the core information is present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release-v1.2.0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@piobeny piobeny requested a review from mklocek March 9, 2026 10:07
@piobeny piobeny changed the base branch from main to stats-api March 10, 2026 13:22
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/io/mailtrap/client/api/MailtrapGeneralApi.java (1)

15-23: ⚠️ Potential issue | 🔴 Critical

The breaking constructor change remains unresolved; suggested fix was not applied.

The code still uses @RequiredArgsConstructor on line 17 without a backward-compatible 4-arg constructor overload. Adding the stats field to this annotation changes the generated public constructor from 4 args to 5 args. External consumers upgrading to 1.2.0 and calling new MailtrapGeneralApi(accountAccesses, accounts, billing, permissions) will encounter a compilation error or NoSuchMethodError, making this a breaking change for a minor version.

To preserve API compatibility, either remove @RequiredArgsConstructor and provide explicit constructors (including a 4-arg overload that delegates to the 5-arg version), or bump to version 2.0.0.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/io/mailtrap/client/api/MailtrapGeneralApi.java` around lines 15
- 23, The class MailtrapGeneralApi currently uses `@RequiredArgsConstructor` which
generates a 5-arg public constructor after adding the stats field and thereby
breaks the existing 4-arg API; restore backward compatibility by removing
`@RequiredArgsConstructor` and adding explicit constructors: a public
four-argument constructor MailtrapGeneralApi(AccountAccesses, Accounts, Billing,
Permissions) that delegates to a new five-argument constructor, and a public
five-argument constructor MailtrapGeneralApi(AccountAccesses, Accounts, Billing,
Permissions, Stats) that initializes all fields (or keep the five-arg and have
the four-arg call it with a default/null stats), ensuring both constructors
exist to avoid breaking callers of MailtrapGeneralApi(accountAccesses, accounts,
billing, permissions).
🧹 Nitpick comments (3)
src/main/java/io/mailtrap/api/stats/StatsFilter.java (1)

8-16: Prefer LocalDate for the date filters.

startDate and endDate as raw Strings create a type-safety gap; the builder currently passes them directly to query parameters without format validation. Exposing LocalDate here aligns with the pattern used elsewhere in the codebase for temporal data and ensures date-range bounds are type-checked at compile time.

♻️ Proposed refactor
-import java.util.List;
+import java.time.LocalDate;
+import java.util.List;
@@
-    private String startDate;
-    private String endDate;
+    private LocalDate startDate;
+    private LocalDate endDate;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/io/mailtrap/api/stats/StatsFilter.java` around lines 8 - 16,
Change StatsFilter.startDate and endDate from String to java.time.LocalDate to
gain type safety: update the class fields in StatsFilter, replace the imports
(add java.time.LocalDate), keep Lombok annotations (`@Data`, `@Builder`, etc.), and
adjust any call sites or builders that pass String values so they parse/format
using LocalDate.parse(...) or accept LocalDate directly; also update any
serialization or query-parameter construction logic that previously relied on
raw strings to format the LocalDate (e.g., .toString() or a DateTimeFormatter)
before sending to downstream queries.
src/main/java/io/mailtrap/model/response/stats/SendingStatGroupResponse.java (1)

9-18: name is the group field key, not the grouped value.

Line 16 stores keys like "sending_domain_id" / "category" in name, while the actual grouped value ends up in value. Since this is a brand-new public model, I’d make that explicit now with something like groupField / groupValue before 1.2.0 locks the API shape.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/io/mailtrap/model/response/stats/SendingStatGroupResponse.java`
around lines 9 - 18, The current SendingStatGroupResponse stores the group key
in name and the grouped value in value, which is confusing for a public model;
rename the fields name -> groupField and value -> groupValue (update their
declarations and usages) and adjust the JsonAnySetter method
setDynamicField(String key, Object value) to set groupField/groupValue (keeping
stats as-is), and update any getters/setters/serializers referencing name or
value to the new identifiers so the public API clearly reflects "group field" vs
"group value".
src/test/java/io/mailtrap/api/stats/StatsImplTest.java (1)

28-40: Add one test that exercises the list-based filters.

This suite only validates start_date/end_date. StatsImpl also serializes sending_domain_ids[], sending_streams[], categories[], and email_service_providers[], and TestHttpClient requires an exact query-param match. A regression in any of those keys would still pass here, even though list-filter serialization is part of the new API surface.

Also applies to: 51-144

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/test/java/io/mailtrap/api/stats/StatsImplTest.java` around lines 28 - 40,
The tests only cover the start_date/end_date query params but miss verifying
list-based filters; add a new unit test in StatsImplTest that calls the
StatsImpl method (via the same setup using TestHttpClient) with non-empty lists
for sending_domain_ids, sending_streams, categories, and email_service_providers
so the client serializes keys like sending_domain_ids[], sending_streams[],
categories[], and email_service_providers[]; register a matching DataMock in the
TestHttpClient (use the same baseUrl endpoints as in init) that includes the
exact list query params and assert the request was matched, ensuring StatsImpl’s
serialization logic for those parameters is exercised (refer to StatsImpl,
StatsImplTest, TestHttpClient, and DataMock to locate relevant code).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/main/java/io/mailtrap/client/api/MailtrapGeneralApi.java`:
- Around line 15-23: The class MailtrapGeneralApi currently uses
`@RequiredArgsConstructor` which generates a 5-arg public constructor after adding
the stats field and thereby breaks the existing 4-arg API; restore backward
compatibility by removing `@RequiredArgsConstructor` and adding explicit
constructors: a public four-argument constructor
MailtrapGeneralApi(AccountAccesses, Accounts, Billing, Permissions) that
delegates to a new five-argument constructor, and a public five-argument
constructor MailtrapGeneralApi(AccountAccesses, Accounts, Billing, Permissions,
Stats) that initializes all fields (or keep the five-arg and have the four-arg
call it with a default/null stats), ensuring both constructors exist to avoid
breaking callers of MailtrapGeneralApi(accountAccesses, accounts, billing,
permissions).

---

Nitpick comments:
In `@src/main/java/io/mailtrap/api/stats/StatsFilter.java`:
- Around line 8-16: Change StatsFilter.startDate and endDate from String to
java.time.LocalDate to gain type safety: update the class fields in StatsFilter,
replace the imports (add java.time.LocalDate), keep Lombok annotations (`@Data`,
`@Builder`, etc.), and adjust any call sites or builders that pass String values
so they parse/format using LocalDate.parse(...) or accept LocalDate directly;
also update any serialization or query-parameter construction logic that
previously relied on raw strings to format the LocalDate (e.g., .toString() or a
DateTimeFormatter) before sending to downstream queries.

In
`@src/main/java/io/mailtrap/model/response/stats/SendingStatGroupResponse.java`:
- Around line 9-18: The current SendingStatGroupResponse stores the group key in
name and the grouped value in value, which is confusing for a public model;
rename the fields name -> groupField and value -> groupValue (update their
declarations and usages) and adjust the JsonAnySetter method
setDynamicField(String key, Object value) to set groupField/groupValue (keeping
stats as-is), and update any getters/setters/serializers referencing name or
value to the new identifiers so the public API clearly reflects "group field" vs
"group value".

In `@src/test/java/io/mailtrap/api/stats/StatsImplTest.java`:
- Around line 28-40: The tests only cover the start_date/end_date query params
but miss verifying list-based filters; add a new unit test in StatsImplTest that
calls the StatsImpl method (via the same setup using TestHttpClient) with
non-empty lists for sending_domain_ids, sending_streams, categories, and
email_service_providers so the client serializes keys like sending_domain_ids[],
sending_streams[], categories[], and email_service_providers[]; register a
matching DataMock in the TestHttpClient (use the same baseUrl endpoints as in
init) that includes the exact list query params and assert the request was
matched, ensuring StatsImpl’s serialization logic for those parameters is
exercised (refer to StatsImpl, StatsImplTest, TestHttpClient, and DataMock to
locate relevant code).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8b5fd282-a6b4-4f26-aa55-7d2d6c2444e1

📥 Commits

Reviewing files that changed from the base of the PR and between 1136e25 and ed5e9a0.

📒 Files selected for processing (17)
  • README.md
  • docs/getting-started.md
  • examples/java/io/mailtrap/examples/general/StatsExample.java
  • pom.xml
  • src/main/java/io/mailtrap/api/stats/Stats.java
  • src/main/java/io/mailtrap/api/stats/StatsFilter.java
  • src/main/java/io/mailtrap/api/stats/StatsImpl.java
  • src/main/java/io/mailtrap/client/api/MailtrapGeneralApi.java
  • src/main/java/io/mailtrap/factory/MailtrapClientFactory.java
  • src/main/java/io/mailtrap/model/response/stats/SendingStatGroupResponse.java
  • src/main/java/io/mailtrap/model/response/stats/SendingStatsResponse.java
  • src/test/java/io/mailtrap/api/stats/StatsImplTest.java
  • src/test/resources/api/stats/byCategory.json
  • src/test/resources/api/stats/byDate.json
  • src/test/resources/api/stats/byDomain.json
  • src/test/resources/api/stats/byEmailServiceProvider.json
  • src/test/resources/api/stats/getStats.json

@piobeny piobeny force-pushed the stats-api branch 3 times, most recently from a267e81 to 0c315b1 Compare March 16, 2026 13:44
Base automatically changed from stats-api to main March 17, 2026 11:36
@mklocek mklocek changed the title Release v1.2.0 - Add Stats API Release v1.2.0 Mar 23, 2026
@mklocek mklocek merged commit e8a7ffc into main Mar 23, 2026
2 checks passed
@mklocek mklocek deleted the release-v1.2.0 branch March 23, 2026 12:57
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.

3 participants