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: Use centralized approach for per-repository file caches #10618

Closed
wants to merge 83 commits into from

Conversation

zharinov
Copy link
Collaborator

@zharinov zharinov commented Jun 26, 2021

Changes:

Context:

Closes #10526

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please tick one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

Example repo: https://github.com/renovate-testing/test-10618-artifact-upgrades/pulls

@zharinov
Copy link
Collaborator Author

This is minimal implementation to elaborate on

@zharinov zharinov requested review from viceice and rarkins June 26, 2021 14:08
lib/util/exec/index.ts Outdated Show resolved Hide resolved
cacheDir: {
execWithEnv: 'GOPATH',
subPath: './others/go',
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With these exec options, we can get rid of manual ensureCacheDir() calling


export async function deleteCacheVolume(): Promise<void> {
const { dockerChildPrefix } = getAdminConfig();
const volumeNamespace = getContainerName('manager_cache', dockerChildPrefix);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should rename getContainerName to something more generic.

@@ -1,4 +1,5 @@
import type { ExecOptions as ChildProcessExecOptions } from 'child_process';
import { join as unixJoin } from 'path';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used only for inner Docker paths

rawExec,
} from './common';
import { generateDockerCommand, removeDockerContainer } from './docker';
import { getChildProcessEnv } from './env';

type ExtraEnv<T = unknown> = Record<string, T>;

interface CacheDirOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
interface CacheDirOption {
export interface CacheDirOption {


export async function deleteCacheVolume(): Promise<void> {
const { dockerChildPrefix } = getAdminConfig();
const volumeNamespace = getContainerName('manager_cache', dockerChildPrefix);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only if docker mode, otherwise it fails on global mode, when no docker is available.

We should also add a new config option, as maybe not all users want those docker volumes, or override by some more persistent.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it's just a blueprint

@rarkins
Copy link
Collaborator

rarkins commented Jun 29, 2021

Would this be easier if you based it off my breaking PR which removes custom cache env?

@zharinov
Copy link
Collaborator Author

zharinov commented Jul 1, 2021

Would this be easier if you based it off my breaking PR which removes custom cache env?

I wanted to achieve non-breaking behaviour for now, then restrict custom env-vars usage with separate breaking PR.

@zharinov zharinov dismissed a stale review via dcff580 July 5, 2021 13:46
@zharinov zharinov marked this pull request as ready for review July 9, 2021 05:18
@rarkins rarkins force-pushed the v26 branch 2 times, most recently from ac438a7 to fea9a6a Compare August 13, 2021 07:41
rarkins and others added 10 commits August 13, 2021 10:15
Removes standalone gradle-lite manager and merges it into the gradle manager as the default behavior, while adding deepExtract as an option to re-enable previous behavior.

Closes renovatebot#10091

BREAKING CHANGE: Gradle extraction now defaults to JS-based parsing (previously "gradle-lite")
Removes support for "yarnrc" configuration option.

Closes renovatebot#10113

BREAKING CHANGE: It is no longer supported to configure a "yarnrc" override in Renovate config
…0514)

Defaults cloneSubmodules to false.

BREAKING CHANGE: Git Submodules cloning now needs to be explicitly enabled.
Ignore environment variables and instead use static cache directory for third party tools.

Closes renovatebot#10094

BREAKING CHANGE: Renovate will now override any package manager cache locations configured in env variables.
# Conflicts:
#	lib/manager/gomod/__snapshots__/artifacts.spec.ts.snap
#	lib/manager/gomod/artifacts.ts
Defaults dependencyDashboard=true for anyone using the config:base preset
stroncium and others added 4 commits August 13, 2021 14:10
Removes double or more hyphens from branch names and replaces with a single hyphen.

Closes renovatebot#8260

BREAKING CHANGE: Branches with double hyphens will be changed to single hyphens, which can result in some existing PRs being autoclosed and replacements opened.
@rarkins
Copy link
Collaborator

rarkins commented Aug 16, 2021

@zharinov I maybe have a change of direction on this one, sorry. I would like to close this for now so you don't have to keep updating it from main

@rarkins rarkins closed this Aug 16, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Option for temporary Docker volumes for package manager caches
6 participants