chore: modernize to minimum_otp_vsn 27 - #59
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Modernizes restclient for OTP 27+, replacing JSX with stdlib JSON and simplifying build tooling.
Changes:
- Migrates JSON encoding/decoding to OTP’s
jsonmodule. - Updates dependencies, Elvis, tests, and CI for OTP 27–29.
- Removes legacy erlang.mk/rebar2 support and unused dependencies.
Reviewed changes
Copilot reviewed 12 out of 16 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
.gitattributes |
Removes erlang.mk diff handling. |
.github/workflows/erlang.yml |
Tests OTP 27–29. |
.gitignore |
Removes obsolete build ignores. |
Makefile |
Retains Elvis tooling only. |
README.md |
Documents OTP requirement and installation. |
elvis.config |
Migrates to Elvis 6 rules. |
erlang.mk |
Removes legacy build system. |
rebar.config |
Sets OTP minimum and updates dependencies. |
rebar.config.script |
Removes rebar2 compatibility. |
rebar.lock |
Refreshes dependency locks. |
restc.d |
Removes obsolete make metadata. |
src/restc.app.src |
Removes JSX application dependency. |
src/restc.erl |
Introduces the public JSON term type. |
src/restc_body.erl |
Implements stdlib JSON handling. |
test/mochiweb_util.erl |
Removes unused MIME functionality. |
test/restc_SUITE.erl |
Updates JSON integration tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
baronbosse
approved these changes
Aug 27, 2026
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.
Modernize build, deps and CI
Requires OTP 27+ — JSON now goes through the stdlib
jsonmodule.jsxin favour of stdlibjson. Encode/decode output was diffed against jsx across map and proplist mode before the swap; behaviour is unchanged for all valid input, including proplist objects, jsx's[{}]empty object, and duplicate-key ordering.mochiwebtest dep — dead weight. The vendoredtest/mochiweb_util.erloracle shadowed the dep's module of the same name, and the dep was only reachable via aguess_mime/1no test calls.erlang.mk,rebar.config.script,restc.d) — it carried a duplicate dep list that had already drifted (hackney pinned at 1.20.1 there vs 4.5.2 inrebar.config).lager/goldrushchain uses deprecatedcatchwithwarnings_as_errors).elvis.configmigrated to the 5.x/6.x format, including five renamed rules that the new elvis otherwise skips silently.Two behaviour changes to check before upgrading
error:unexpected_end/error:{invalid_byte, N}instead oferror:badarg. Same error class, socatch error:_handlers are unaffected — only code matchingbadargspecifically.{return_maps, true}(tuple form) now returns maps from JSON bodies; it previously returned a proplist. This was a genuine inconsistency — the JSON branch usedlists:member/2while the empty-body and urlencoded branches usedproplists:get_bool/2, so the same option gave two different answers. Bare[return_maps]is unaffected.Commits are split so each one builds and tests green independently.
Worth a grep for badarg and {return_maps, true} across the consuming services before tagging.