feat(manager): add rebar3 manager for Erlang dependencies#41887
Closed
Taure wants to merge 5 commits intorenovatebot:mainfrom
Closed
feat(manager): add rebar3 manager for Erlang dependencies#41887Taure wants to merge 5 commits intorenovatebot:mainfrom
Taure wants to merge 5 commits intorenovatebot:mainfrom
Conversation
Add a new manager for Erlang/OTP rebar3 projects that extracts dependencies from rebar.config and updates rebar.lock files. Supported dependency formats: - Hex packages (bare atom, version constraint, pinned, pkg override) - Git dependencies (tag, branch, ref) - Git subdirectory dependencies - Profile dependencies (test profile) Uses existing hex datasource, hex versioning, git-tags and github-tags datasources.
- Add 'erlang' to CategoryNames in tools/docs/manager.ts (fixes type error) - Add tests covering error paths, edge cases, and keyword filtering - Improve line coverage to 98%+ across all rebar3 manager files
Add tests for nested bracket tracking in deps section parsing to achieve 100% line/statement coverage on extract.ts.
- Add test for undefined currentValue in range strategy - Add test for lock entries not matching extracted deps - Add test for parent lock path existing but file not present - Add v8 ignore for unreachable nullish coalescing branch
Author
|
Closing in favor of a split into 3 smaller, reviewable PRs:
Each PR builds on the previous one. |
viceice
reviewed
Mar 20, 2026
| import * as puppet from './puppet/index.ts'; | ||
| import * as pyenv from './pyenv/index.ts'; | ||
| import * as quadlet from './quadlet/index.ts'; | ||
| import * as rebar3 from './rebar3/index.ts'; |
Member
There was a problem hiding this comment.
why rebar3 instead of rebar? do you expect a new manager if rebar 4 comes out? we usually don't encode the version into the manager name.
Member
There was a problem hiding this comment.
please inline the fixtures into the test with codeBlock template helper.
| return null; | ||
| } | ||
|
|
||
| let lockFileName = getSiblingFileName(packageFileName, 'rebar.lock'); |
Member
There was a problem hiding this comment.
why not simply use find sibling or parent here?
| ]; | ||
| } | ||
|
|
||
| if (!existingLockFileContent) { |
Member
There was a problem hiding this comment.
move this before the try-catch above (perf)
| toolConstraints: [ | ||
| { | ||
| toolName: 'erlang', | ||
| constraint: config.constraints?.erlang ?? '^26', |
Member
There was a problem hiding this comment.
Suggested change
| constraint: config.constraints?.erlang ?? '^26', | |
| constraint: config.constraints?.erlang, |
why v26 here, Renovate should resolve latest if not explicit restricted?
| try { | ||
| await exec(command, execOptions); | ||
| } catch (err) { | ||
| /* v8 ignore next 3 */ |
Member
There was a problem hiding this comment.
add test instead
Suggested change
| /* v8 ignore next 3 */ |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
rebar3manager that extracts dependencies from Erlang/OTPrebar.configfiles and updatesrebar.lockfileshexdatasource,hexversioning,git-tagsandgithub-tagsdatasourceserlangto the list of manager categoriesDependency formats supported
{cowboy, "~> 2.9"}{cowboy, "2.9.0"}cowboy{app, {pkg, alt_name}},{app, "1.0", {pkg, alt_name}}{app, {git, "url", {tag, "1.0"}}}{app, {git, "url", {branch, "main"}}}{app, {git, "url", {ref, "abc123"}}}{app, {git_subdir, "url", {tag, "1.0"}, "path"}}{profiles, [{test, [{deps, [...]}]}]}Files
lib/modules/manager/rebar3/index.tslib/modules/manager/rebar3/extract.tsrebar.config+ readrebar.locklib/modules/manager/rebar3/artifacts.tsrebar3 upgradeto update lock filelib/modules/manager/rebar3/range.tslib/modules/manager/rebar3/readme.mdlib/constants/category.tserlangcategorylib/modules/manager/api.tsrebar3managerTest plan
extract.spec.ts— 6 tests: invalid files, no deps, all dep formats, locked versions, simple config, commented depsartifacts.spec.ts— 8 tests: skip conditions, lock updates, lockFileMaintenance, error handling, injection preventionrange.spec.ts— 4 tests: bump/auto/pin strategies with simple and complex ranges🤖 Generated with Claude Code and this PR was written primarily by Claude Code.