Skip to content
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

feat(manager/pip-compile): Change fileMatch behaviour to target pip-compile output files #26858

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
3362e51
Change fileMatch behaviour to target pip-compile output files
not7cd Jan 25, 2024
831a7fd
Comment
not7cd Jan 25, 2024
26f9873
Fix command parsing
not7cd Jan 26, 2024
b90a58c
updateArtifacts now refers to matched lockFiles
not7cd Jan 26, 2024
a9ed099
Add strict arg to constructPipCompileCmd
not7cd Jan 26, 2024
3c46844
Refactor matchManager
not7cd Jan 26, 2024
79d1722
Refactor extractAllPackageFiles to use extractPackageFile
not7cd Jan 26, 2024
44fbf50
Merge remote-tracking branch 'upstream/main' into not7cd/pip-compile-…
not7cd Jan 26, 2024
81a8a70
fix updateArtifacts, loop over lockFiles
not7cd Jan 26, 2024
51d44b7
Throw errors in constructPipCompileCmd
not7cd Jan 26, 2024
3e592e9
Restrict supported command arguments
not7cd Jan 27, 2024
3e2fb11
Refactor extractHeaderCommand
not7cd Jan 27, 2024
c036103
Refactor option check
not7cd Jan 27, 2024
8ed2da3
Warn for failed command parsing in extract
not7cd Jan 28, 2024
ee1bb3b
Minor refactor
not7cd Jan 28, 2024
9ed1bf6
Refactor extractHeaderCommand
not7cd Jan 28, 2024
59f52db
Dont allow for relative outputfile
not7cd Jan 28, 2024
0ef5c2e
Dont return default command
not7cd Jan 28, 2024
b49257b
Update tests with lockFiles in config
not7cd Jan 28, 2024
3120701
Fix tests
not7cd Jan 30, 2024
8bbe10d
Add tests for common module
not7cd Jan 30, 2024
5dd3f37
Add more tests
not7cd Jan 30, 2024
0e3e580
More tests & fixes
not7cd Jan 31, 2024
384154b
Refactor tests that expect option skipping
not7cd Jan 31, 2024
44f7518
Change custom command handling
not7cd Jan 31, 2024
ae89f9b
Add test for no lockfiles in config
not7cd Jan 31, 2024
e2c356a
Test extract
not7cd Jan 31, 2024
71ffc8b
Merge branch 'main' into not7cd/pip-compile-fileMatch
not7cd Jan 31, 2024
d35fc1c
Fix package files with multiple lock files
not7cd Feb 1, 2024
3a51bec
Ignore lock files in source files
not7cd Feb 1, 2024
7ddd485
Merge branch 'main' into not7cd/pip-compile-fileMatch
not7cd Feb 1, 2024
14def15
Add test for lock files in source files
not7cd Feb 2, 2024
8e1b8fc
Refactor extract
not7cd Feb 2, 2024
91491e5
eslint
not7cd Feb 2, 2024
77a054f
refactor try catch
not7cd Feb 2, 2024
11b11ca
test for malformed files
not7cd Feb 2, 2024
45b5490
test: Add empty lockfile
not7cd Feb 2, 2024
09f0878
refactoring
rarkins Feb 2, 2024
8fffe74
Update readme
not7cd Feb 2, 2024
7b8f404
fix
not7cd Feb 2, 2024
968754e
Remove empty file
not7cd Feb 2, 2024
a1d1c35
Quote args
not7cd Feb 5, 2024
36685d0
Remove unused beforeEach
not7cd Feb 5, 2024
02b7113
Import quote
not7cd Feb 5, 2024
9319d7d
Revert code move
not7cd Feb 5, 2024
55d48a2
Move PipCompileArgs
not7cd Feb 5, 2024
c547ace
Move again :)
not7cd Feb 5, 2024
f63cf8e
Remove unused
not7cd Feb 5, 2024
e44eb4f
Import quote
not7cd Feb 5, 2024
8c65832
Update lib/modules/manager/pip-compile/extract.spec.ts
not7cd Feb 6, 2024
4d96cd6
Review suggestions
not7cd Feb 6, 2024
c5e2482
Remove resolver support
not7cd Feb 6, 2024
75763e5
test to it
not7cd Feb 6, 2024
9e48249
Remove type
not7cd Feb 7, 2024
828b7fd
Don't parse with commander.js
not7cd Feb 7, 2024
04307c8
Explicit test
not7cd Feb 7, 2024
2cd997a
Prefix all logger.debug
not7cd Feb 7, 2024
9cf030a
Prefix logger.warn
not7cd Feb 7, 2024
cc9b13e
Merge branch 'main' into not7cd/pip-compile-fileMatch
not7cd Feb 7, 2024
fed1c24
Add dependency flowchart for debugging
not7cd Feb 7, 2024
e380d70
Fix test
not7cd Feb 7, 2024
2eaf892
Refactor dependency flowchart
not7cd Feb 7, 2024
1fd5ce0
Disable unused and untested part flowchart
not7cd Feb 7, 2024
394b685
Extract constraints from header
not7cd Feb 7, 2024
23833f4
Disable coverage for constraints
not7cd Feb 7, 2024
7585f4c
Rename to contraintsFiles
not7cd Feb 7, 2024
ff456d0
Sort
not7cd Feb 7, 2024
6aa80ea
Rename flowchart to graph
not7cd Feb 7, 2024
b4770e2
Log header with trace
not7cd Feb 7, 2024
8290a8c
types
not7cd Feb 7, 2024
3e47306
nit
not7cd Feb 7, 2024
ada4937
Update tests
not7cd Feb 8, 2024
b8a5bb8
Fix option checks
not7cd Feb 8, 2024
8b2f4fe
Safeguard for emit index url
not7cd Feb 8, 2024
124ba28
Extract getExecOptions method to common
not7cd Feb 8, 2024
82773a8
code move
not7cd Feb 8, 2024
5a81c5d
Merge branch 'not7cd/pip-compile-refactor1' into not7cd/pip-compile-f…
not7cd Feb 8, 2024
a35b7d5
Merge branch 'main' into not7cd/pip-compile-fileMatch
not7cd Feb 8, 2024
19c5255
Merge remote-tracking branch 'upstream/main' into not7cd/pip-compile-…
not7cd Feb 8, 2024
fefef52
Merge remote-tracking branch 'upstream/main' into not7cd/pip-compile-…
not7cd Feb 8, 2024
657ddfd
Merge remote-tracking branch 'upstream/main' into not7cd/pip-compile-…
not7cd Feb 9, 2024
1516c61
unused
not7cd Feb 9, 2024
bee09da
unused strict
not7cd Feb 9, 2024
9945e7b
Add test
not7cd Feb 9, 2024
7350c8c
Fix test
not7cd Feb 9, 2024
3ddd94a
rename packageFileContent
not7cd Feb 12, 2024
4b6d8f0
move
not7cd Feb 12, 2024
20a57b3
remove unused test
not7cd Feb 12, 2024
e3eaa75
Add fileMatch migration
not7cd Feb 12, 2024
26169eb
cast to string
not7cd Feb 12, 2024
b03ce91
match all cases
not7cd Feb 12, 2024
52d2378
Test migration
not7cd Feb 12, 2024
d20ec3e
Merge remote-tracking branch 'upstream/main' into not7cd/pip-compile-…
not7cd Feb 12, 2024
4c3f2ff
Remove test for no header
not7cd Feb 12, 2024
04fe123
remove use of toMatchSnapshot
not7cd Feb 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 32 additions & 0 deletions lib/config/migration.spec.ts
Expand Up @@ -668,6 +668,38 @@ describe('config/migration', () => {
expect(migratedConfig).toMatchSnapshot();
});

it('it migrates pip-compile', () => {
const config: RenovateConfig = {
'pip-compile': {
enabled: true,
fileMatch: [
'(^|/)requirements\\.in$',
'(^|/)requirements-fmt\\.in$',
'(^|/)requirements-lint\\.in$',
'.github/workflows/requirements.in',
'(^|/)debian_packages/private/third_party/requirements\\.in$',
'(^|/).*?requirements.*?\\.in$',
],
},
};
const { isMigrated, migratedConfig } =
configMigration.migrateConfig(config);
expect(isMigrated).toBeTrue();
expect(migratedConfig).toEqual({
'pip-compile': {
enabled: true,
fileMatch: [
'(^|/)requirements\\.txt$',
'(^|/)requirements-fmt\\.txt$',
'(^|/)requirements-lint\\.txt$',
'.github/workflows/requirements.txt',
'(^|/)debian_packages/private/third_party/requirements\\.txt$',
'(^|/).*?requirements.*?\\.txt$',
],
},
});
});

it('it migrates gradle-lite', () => {
const config: RenovateConfig = {
'gradle-lite': {
Expand Down
14 changes: 14 additions & 0 deletions lib/config/migration.ts
Expand Up @@ -150,6 +150,20 @@ export function migrateConfig(config: RenovateConfig): MigratedConfig {
}
}
}
if (
is.nonEmptyObject(migratedConfig['pip-compile']) &&
is.nonEmptyArray(migratedConfig['pip-compile'].fileMatch)
) {
migratedConfig['pip-compile'].fileMatch = migratedConfig[
'pip-compile'
].fileMatch.map((fileMatch) => {
const match = fileMatch as string;
if (match.endsWith('.in')) {
return match.replace(/\.in$/, '.txt');
}
return match.replace(/\.in\$$/, '.txt$');
});
}
if (is.nonEmptyArray(migratedConfig.matchManagers)) {
if (migratedConfig.matchManagers.includes('gradle-lite')) {
if (!migratedConfig.matchManagers.includes('gradle')) {
Expand Down
@@ -0,0 +1,18 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# ./pip-compile-wrapper requirements.in
#
certifi==2023.11.17
# via requests
charset-normalizer==3.3.2
# via requests
idna==3.6
# via requests
markupsafe==2.1.4
# via jinja2
requests==2.31.0
# via -r requirements.in
urllib3==2.1.0
# via requests