Skip to content

refactor: remove Pekko HTTP APIs deprecated before 2.0 - #1910

Closed
He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:refactor/remove-pre-2-deprecations
Closed

He-Pin wants to merge 1 commit into
apache:mainfrom
He-Pin:refactor/remove-pre-2-deprecations

Conversation

@He-Pin

@He-Pin He-Pin commented Nov 29, 2026

Copy link
Copy Markdown
Member

Motivation

Consolidate the remaining Pekko HTTP API deprecations from before version 2.0 instead of reviewing separate removal PRs.

Modification

  • Remove the four Scala/Java aliases for 413 and 422, the two four-argument custom-method APIs, and six legacy Scala-duration overloads in the Java routing DSL.
  • Make the seven pre-2.0 deprecated Scala coding declarations package-internal while retaining their JVM types, implementations and supported Scala Coders and Java Coder entry points.
  • Add 12 signature-specific MiMa exceptions for the removed members. Keep MiMa checking the JVM types that remain linkable after the Scala visibility change. Document migration in the 2.1 release notes.
  • Retain the explicitly supported legacy HTTP/2 configuration key and the JUnit APIs first deprecated in 2.0.

Result

Draft: this proposal deliberately breaks source and binary compatibility with 2.0 for the 12 removed public members. The MiMa exceptions acknowledge those removals; they do not restore linkage for consumers compiled against 2.0. Since the published compatibility guidelines promise backward compatibility within 2.x, the 2.1 release decision needs maintainer agreement before this leaves Draft.

Locally validated: independent source review; MiMa for both modules on Scala 2.13.18 and 3.3.9; scoped Scala/Java formatting; 38 focused tests passed with one existing pending case; documentation examples compiled. No hosted CI or release approval is claimed.

References

Supersedes #1122, #1123 and #1124. See Pekko HTTP compatibility guidelines.

Motivation: Consolidate the deprecated 413/422 aliases, custom method factories, Java duration wrappers and Scala coding implementation entry points.

Modification: Remove obsolete public members, internalize Scala coding implementations without changing their JVM names, and document migration. Add exact 2.1 compatibility exceptions for removed members and retain MiMa checks on scoped implementation classes.

Result: Existing replacements and wire status codes remain; intentionally removed public members require consumer migration.

References: apache#1122, apache#1123, and apache#1124.
@pjfanning

Copy link
Copy Markdown
Member

I'd really like for us to stop removing deprecated code for a while and worry more about not inconveniencing users - making it as easy to upgrade to pekko 2 as possible. We gain very little from removing the deprecated methods except leaving behind users who won't upgrade because of the effort.

@pjfanning

Copy link
Copy Markdown
Member

It's my strong opinion that we shouldn't remove any more methods until Pekko 3 and I am strongly against starting work on Pekko 3 yet.

@He-Pin

He-Pin commented Nov 29, 2026

Copy link
Copy Markdown
Member Author

@pjfanning I will try to send PR to the community to upgrade to Pekko 2.0.x first


# The legacy Scala coding implementations are package-internal but their JVM types still link.
# Keep checking those types and members instead of ignoring the visibility change.
BinaryApi.keep[ClassNoLongerCheckedProblem]("org.apache.pekko.http.scaladsl.coding.Compressor")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Could validatePullRequest pass mimaBinaryApi to runMima too? The standalone MiMa task reads this file, but MimaWithPrValidation calls the overload without the keep rules. At this head the Scala 2.13 PR job still reports 12 ClassNoLongerCheckedProblem entries. Passing the same rules to both tasks would keep these JVM types under compatibility checking rather than filtering the problems out.

@pjfanning pjfanning added this to the 3.0.0 milestone Nov 30, 2026
@He-Pin He-Pin closed this Nov 30, 2026
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