-
Notifications
You must be signed in to change notification settings - Fork 3.3k
feat(manager/ant): add property resolution and .properties file support #42175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
viceice
merged 12 commits into
renovatebot:main
from
RahulGautamSingh:feat/42076-ant-manager-properties
Apr 14, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
fbab19e
new changes
RahulGautamSingh eaddd7d
use updateDependency
RahulGautamSingh 81f2a8c
fix coverage
RahulGautamSingh ba3905e
Merge branch 'main' into feat/42076-ant-manager-properties
RahulGautamSingh 5ed88f6
apply suggestions
RahulGautamSingh c166cd3
apply suggestions
RahulGautamSingh 3bf5355
add comment
RahulGautamSingh 6f7efbe
Update lib/modules/manager/ant/update.ts
RahulGautamSingh 56c84ef
apply suggestions zharinov
RahulGautamSingh d91205c
fix coverage
RahulGautamSingh b20d697
fix coverage
RahulGautamSingh b76b0ad
escape attrName
RahulGautamSingh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| import { parsePropertiesFile } from './properties.ts'; | ||
| import type { AntProp } from './types.ts'; | ||
|
|
||
| describe('modules/manager/ant/properties', () => { | ||
| describe('parsePropertiesFile', () => { | ||
| it('parses key=value pairs', () => { | ||
| const props: Record<string, AntProp> = {}; | ||
| parsePropertiesFile( | ||
| 'key1=value1\nkey2=value2\n', | ||
| 'test.properties', | ||
| props, | ||
| ); | ||
|
|
||
| expect(props.key1).toEqual( | ||
| expect.objectContaining({ | ||
| val: 'value1', | ||
| packageFile: 'test.properties', | ||
| }), | ||
| ); | ||
| expect(props.key2).toEqual( | ||
| expect.objectContaining({ | ||
| val: 'value2', | ||
| packageFile: 'test.properties', | ||
| }), | ||
| ); | ||
| }); | ||
|
|
||
| it('skips comments and blank lines', () => { | ||
| const props: Record<string, AntProp> = {}; | ||
| parsePropertiesFile( | ||
| '# comment\n\nkey=value\n! another comment\n', | ||
| 'test.properties', | ||
| props, | ||
| ); | ||
|
|
||
| expect(Object.keys(props)).toEqual(['key']); | ||
| }); | ||
|
|
||
| it('supports colon separator', () => { | ||
| const props: Record<string, AntProp> = {}; | ||
| parsePropertiesFile('key:value\n', 'test.properties', props); | ||
|
|
||
| expect(props.key).toEqual(expect.objectContaining({ val: 'value' })); | ||
| }); | ||
|
|
||
| it('skips malformed lines without separators', () => { | ||
| const props: Record<string, AntProp> = {}; | ||
| parsePropertiesFile( | ||
| 'key=value\nmalformed_line_no_separator\nother=val\n', | ||
| 'test.properties', | ||
| props, | ||
| ); | ||
|
|
||
| expect(Object.keys(props)).toEqual(['key', 'other']); | ||
| }); | ||
|
|
||
| it('implements first-definition-wins', () => { | ||
| const props: Record<string, AntProp> = {}; | ||
| parsePropertiesFile('key=first\nkey=second\n', 'test.properties', props); | ||
|
|
||
| expect(props.key.val).toBe('first'); | ||
| }); | ||
|
|
||
| it('respects pre-existing props (first-definition-wins across sources)', () => { | ||
| const props: Record<string, AntProp> = { | ||
| key: { | ||
| val: 'existing', | ||
| fileReplacePosition: 0, | ||
| packageFile: 'build.xml', | ||
| }, | ||
| }; | ||
| parsePropertiesFile('key=new\n', 'test.properties', props); | ||
|
|
||
| expect(props.key.val).toBe('existing'); | ||
| expect(props.key.packageFile).toBe('build.xml'); | ||
| }); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.