mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-10 14:06:30 +00:00
fix: resolve the lockFileMaintenance
not working
This commit is contained in:
parent
7b5d84dfa2
commit
bbd3ef5b4c
11 changed files with 36 additions and 13 deletions
|
@ -93,7 +93,10 @@ export async function updateArtifacts(
|
|||
|
||||
const commands: string[] = [];
|
||||
|
||||
if (config.isLockFileMaintenance) {
|
||||
if (
|
||||
config.updateType === 'lockFileMaintenance' ||
|
||||
config.isLockFileMaintenance
|
||||
) {
|
||||
commands.push('bundler lock --update');
|
||||
} else {
|
||||
const bundlerUpgraded = updatedDeps
|
||||
|
@ -289,6 +292,7 @@ export async function updateArtifacts(
|
|||
if (
|
||||
recursionLimit > 0 &&
|
||||
resolveMatches.length &&
|
||||
config.updateType !== 'lockFileMaintenance' &&
|
||||
!config.isLockFileMaintenance
|
||||
) {
|
||||
logger.debug(
|
||||
|
|
|
@ -725,8 +725,8 @@ describe('modules/manager/composer/artifacts', () => {
|
|||
updatedDeps: [],
|
||||
newPackageFileContent: '{}',
|
||||
config: {
|
||||
updateType: 'lockFileMaintenance',
|
||||
...config,
|
||||
isLockFileMaintenance: true,
|
||||
},
|
||||
}),
|
||||
).toEqual([
|
||||
|
|
|
@ -113,6 +113,8 @@ export async function updateArtifacts({
|
|||
|
||||
const file = Json.pipe(PackageFile).parse(newPackageFileContent);
|
||||
|
||||
const isLockFileMaintenance =
|
||||
config.updateType === 'lockFileMaintenance' || config.isLockFileMaintenance;
|
||||
const lockFileName = packageFileName.replace(regEx(/\.json$/), '.lock');
|
||||
const lockfile = await z
|
||||
.string()
|
||||
|
@ -174,7 +176,7 @@ export async function updateArtifacts({
|
|||
|
||||
const cmd = 'composer';
|
||||
let args: string;
|
||||
if (config.isLockFileMaintenance) {
|
||||
if (isLockFileMaintenance) {
|
||||
args = 'update';
|
||||
} else {
|
||||
args =
|
||||
|
|
|
@ -161,7 +161,8 @@ export async function updateArtifacts({
|
|||
}
|
||||
|
||||
if (
|
||||
config.isLockFileMaintenance &&
|
||||
(config.updateType === 'lockFileMaintenance' ||
|
||||
config.isLockFileMaintenance) &&
|
||||
(!isGradleBuildFile(packageFileName) ||
|
||||
dirname(packageFileName) !== dirname(gradlewFile))
|
||||
) {
|
||||
|
@ -205,7 +206,8 @@ export async function updateArtifacts({
|
|||
.join(' ')}`;
|
||||
|
||||
if (
|
||||
config.isLockFileMaintenance === true ||
|
||||
config.updateType === 'lockFileMaintenance' ||
|
||||
config.isLockFileMaintenance ||
|
||||
!updatedDeps.length ||
|
||||
isGcvPropsFile(packageFileName)
|
||||
) {
|
||||
|
|
|
@ -48,7 +48,10 @@ export async function updateArtifacts(
|
|||
};
|
||||
|
||||
try {
|
||||
if (config.isLockFileMaintenance) {
|
||||
if (
|
||||
config.updateType === 'lockFileMaintenance' ||
|
||||
config.isLockFileMaintenance
|
||||
) {
|
||||
await exec('jb update', execOptions);
|
||||
} else {
|
||||
const dependencyUrls = updatedDeps.map(dependencyUrl);
|
||||
|
|
|
@ -34,7 +34,6 @@ const dockerAdminConfig = {
|
|||
process.env.CONTAINERBASE = 'true';
|
||||
|
||||
const config: UpdateArtifactsConfig = {};
|
||||
const lockMaintenanceConfig = { ...config, isLockFileMaintenance: true };
|
||||
const updateInputCmd = `nix \
|
||||
--extra-experimental-features 'nix-command flakes' \
|
||||
flake lock --update-input nixpkgs`;
|
||||
|
@ -294,7 +293,7 @@ describe('modules/manager/nix/artifacts', () => {
|
|||
packageFileName: 'flake.nix',
|
||||
updatedDeps: [{ depName: 'nixpkgs' }],
|
||||
newPackageFileContent: '{}',
|
||||
config: lockMaintenanceConfig,
|
||||
config: { updateType: 'lockFileMaintenance', ...config },
|
||||
});
|
||||
|
||||
expect(res).toEqual([
|
||||
|
|
|
@ -17,6 +17,9 @@ export async function updateArtifacts({
|
|||
}: UpdateArtifact): Promise<UpdateArtifactsResult[] | null> {
|
||||
const lockFileName = packageFileName.replace(regEx(/\.nix$/), '.lock');
|
||||
const existingLockFileContent = await readLocalFile(lockFileName, 'utf8');
|
||||
const isLockFileMaintenance =
|
||||
config.updateType === 'lockFileMaintenance' || config.isLockFileMaintenance;
|
||||
|
||||
if (!existingLockFileContent) {
|
||||
logger.debug('No flake.lock found');
|
||||
return null;
|
||||
|
@ -35,7 +38,7 @@ export async function updateArtifacts({
|
|||
cmd += `--extra-access-tokens github.com=${token} `;
|
||||
}
|
||||
|
||||
if (config.isLockFileMaintenance) {
|
||||
if (isLockFileMaintenance) {
|
||||
cmd += 'flake update';
|
||||
} else {
|
||||
const inputs = updatedDeps
|
||||
|
|
|
@ -189,7 +189,7 @@ describe('modules/manager/nuget/artifacts', () => {
|
|||
newPackageFileContent: '{}',
|
||||
config: {
|
||||
...config,
|
||||
isLockFileMaintenance: true,
|
||||
updateType: 'lockFileMaintenance',
|
||||
},
|
||||
}),
|
||||
).toEqual([
|
||||
|
|
|
@ -138,7 +138,11 @@ export async function updateArtifacts({
|
|||
}
|
||||
|
||||
try {
|
||||
if (updatedDeps.length === 0 && config.isLockFileMaintenance !== true) {
|
||||
if (
|
||||
updatedDeps.length === 0 &&
|
||||
config.updateType !== 'lockFileMaintenance' &&
|
||||
config.isLockFileMaintenance !== true
|
||||
) {
|
||||
logger.debug(
|
||||
`Not updating lock file because no deps changed and no lock file maintenance.`,
|
||||
);
|
||||
|
|
|
@ -110,7 +110,10 @@ export async function updateArtifacts({
|
|||
try {
|
||||
await writeLocalFile(inputFileName, newInputContent);
|
||||
// TODO(not7cd): use --upgrade option instead deleting
|
||||
if (config.isLockFileMaintenance) {
|
||||
if (
|
||||
config.updateType === 'lockFileMaintenance' ||
|
||||
config.isLockFileMaintenance
|
||||
) {
|
||||
await deleteLocalFile(outputFileName);
|
||||
}
|
||||
const compileArgs = extractHeaderCommand(existingOutput, outputFileName);
|
||||
|
|
|
@ -135,7 +135,10 @@ export async function updateArtifacts({
|
|||
}
|
||||
try {
|
||||
await writeLocalFile(pipfileName, newPipfileContent);
|
||||
if (config.isLockFileMaintenance) {
|
||||
if (
|
||||
config.updateType === 'lockFileMaintenance' ||
|
||||
config.isLockFileMaintenance
|
||||
) {
|
||||
await deleteLocalFile(lockFileName);
|
||||
}
|
||||
const cmd = 'pipenv lock';
|
||||
|
|
Loading…
Reference in a new issue