Skip to content

Commit

Permalink
Merge branch 'main' into fix/refacto-rregex-to-use-RE2
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh authored Oct 13, 2021
2 parents 84cb7bf + 4461796 commit c104570
Show file tree
Hide file tree
Showing 42 changed files with 1,163 additions and 971 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM containerbase/node:v14.18.0@sha256:50de253d90cbb55711d47927e56850c32ea5fcb7a3c787269a3f15e69a6ee564
FROM containerbase/node:v14.18.1@sha256:b720748f7a35570e402a8741f37a5bd54ad485dd6b4aeaff04027ad761b1306d


# renovate: datasource=npm
RUN install-tool yarn 1.22.14
RUN install-tool yarn 1.22.15
110 changes: 0 additions & 110 deletions .github/workflows/build-pr.yml

This file was deleted.

31 changes: 25 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,19 @@ on:
- main
- v25

pull_request:

workflow_dispatch:
inputs:
dryRun:
description: 'Dry-Run'
default: 'true'
required: false

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

env:
# Currently no way to detect automatically (#8153)
DEFAULT_BRANCH: main
Expand All @@ -21,23 +27,39 @@ env:

jobs:
test:
name: ${{ format('test ({0})', matrix.os) }}
runs-on: ${{ matrix.os }}

# tests shouldn't need more time
timeout-minutes: 30

strategy:
matrix:
os: [ubuntu-latest, macos-11, windows-latest]
os: [ubuntu-latest]
node-version: [14]
python-version: [3.9]
java-version: [11]
# skip macOS and Windows test on pull requests without 'ci:fulltest' label
include: >-
${{ fromJSON((github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci:fulltest')) && '[{
"os": "macos-latest",
"node-version": 14,
"python-version": 3.9,
"java-version": 11
}, {
"os": "windows-latest",
"node-version": 14,
"python-version": 3.9,
"java-version": 11
}]' || '[]') }}
env:
coverage: ${{ matrix.os == 'ubuntu-latest' && matrix.node-version == 14 }}
NODE_VERSION: ${{ matrix.node-version }}
PYTHON_VERSION: ${{ matrix.python-version }}
JAVA_VERSION: ${{ matrix.java-version }}
# skip Java tests on pull requests without 'ci:fulltest' label
SKIP_JAVA_TESTS: ${{ matrix.node-version != 14 || (github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'ci:fulltest')) }}

steps:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # renovate: tag=v2.3.4
Expand All @@ -56,18 +78,14 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set up Java ${{ env.JAVA_VERSION }}
if: env.NODE_VERSION == '14'
if: env.SKIP_JAVA_TESTS == 'false'
uses: actions/setup-java@8db439b6b47e5e12312bf036760bbaa6893481ac # renovate: tag=v2.3.1
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'adopt'
java-package: jre
check-latest: false

- name: Skip Java tests
if: env.NODE_VERSION != '14'
run: echo "SKIP_JAVA_TESTS=true" >> $GITHUB_ENV

- name: Init platform
shell: bash
run: |
Expand Down Expand Up @@ -145,6 +163,7 @@ jobs:

release:
needs: [lint, test]
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
# release shouldn't need more than 5 min
timeout-minutes: 15
Expand Down
22 changes: 10 additions & 12 deletions docs/usage/configuration-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,6 @@ Setting this to `true` will automatically approve the PRs in Azure DevOps.

You can also configure this using `packageRules` if you want to use it selectively (e.g. per-package).

## azureAutoComplete

Setting this to `true` will configure PRs in Azure DevOps to auto-complete after all (if any) branch policies have been met.

You can also configure this using `packageRules` if you want to use it selectively (e.g. per-package).

## azureWorkItemId

When creating a PR in Azure DevOps, some branches can be protected with branch policies to [check for linked work items](https://docs.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops#check-for-linked-work-items).
Expand Down Expand Up @@ -756,12 +750,6 @@ Example:
}
```

## gitLabAutomerge

If you enabled `automerge` in the Renovate config, you can speed up the automerge process by using GitLab's own automerge function.
Caution (fixed in GitLab >= 12.7): when this option is enabled it is possible due to a bug in GitLab that MRs with failing pipelines might still get merged.
This is caused by a race condition in GitLab's Merge Request API - [read the corresponding issue](https://gitlab.com/gitlab-org/gitlab/issues/26293) for details.

## gitLabIgnoreApprovals

Ignore the default project level approval(s), so that Renovate bot can automerge its merge requests, without needing approval(s).
Expand Down Expand Up @@ -1677,6 +1665,16 @@ Add to this object if you wish to define rules that apply only to PRs that pin d

If enabled Renovate will pin Docker images by means of their SHA256 digest and not only by tag so that they are immutable.

## platformAutomerge

If you have enabled `automerge` and set `automergeType=pr` in the Renovate config, then `platformAutomerge` is enabled by default to speed up merging via the platform's native automerge functionality.

`platformAutomerge` will configure PRs to be merged after all (if any) branch policies have been met.
This option is available for Azure and GitLab.
It falls back to Renovate-based automerge if the platform-native automerge is not available.

Though this option is enabled by default, you can fine tune the behavior by setting `packageRules` if you want to use it selectively (e.g. per-package).

## postUpdateOptions

- `gomodTidy`: Run `go mod tidy` after Go module updates. This is implicitly enabled for major module updates.
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ To get access to the token a custom Renovate Docker image is needed that include
The Dockerfile to create such an image can look like this:

```Dockerfile
FROM renovate/renovate:27.26.0
FROM renovate/renovate:28.0.2
# Include the "Docker tip" which you can find here https://cloud.google.com/sdk/docs/install
# under "Installation" for "Debian/Ubuntu"
RUN ...
Expand Down
50 changes: 50 additions & 0 deletions lib/config/migration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -783,4 +783,54 @@ describe('config/migration', () => {
expect(isMigrated).toBe(true);
expect(migratedConfig).toMatchInlineSnapshot(`Object {}`);
});

it('migrates azureAutoComplete', () => {
const migrate = (config: RenovateConfig): MigratedConfig =>
configMigration.migrateConfig(config, defaultConfig);

expect(migrate({ azureAutoComplete: true })).toEqual({
isMigrated: true,
migratedConfig: { platformAutomerge: true },
});

expect(migrate({ azureAutoComplete: false })).toEqual({
isMigrated: true,
migratedConfig: { platformAutomerge: false },
});

expect(migrate({ automerge: false, azureAutoComplete: true })).toEqual({
isMigrated: true,
migratedConfig: { automerge: false, platformAutomerge: true },
});

expect(migrate({ automerge: true, azureAutoComplete: true })).toEqual({
isMigrated: true,
migratedConfig: { automerge: true, platformAutomerge: true },
});
});

it('migrates gitLabAutomerge', () => {
const migrate = (config: RenovateConfig): MigratedConfig =>
configMigration.migrateConfig(config, defaultConfig);

expect(migrate({ gitLabAutomerge: true })).toEqual({
isMigrated: true,
migratedConfig: { platformAutomerge: true },
});

expect(migrate({ gitLabAutomerge: false })).toEqual({
isMigrated: true,
migratedConfig: { platformAutomerge: false },
});

expect(migrate({ automerge: false, gitLabAutomerge: true })).toEqual({
isMigrated: true,
migratedConfig: { automerge: false, platformAutomerge: true },
});

expect(migrate({ automerge: true, gitLabAutomerge: true })).toEqual({
isMigrated: true,
migratedConfig: { automerge: true, platformAutomerge: true },
});
});
});
5 changes: 5 additions & 0 deletions lib/config/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,11 @@ export function migrateConfig(
} else if (val === false) {
migratedConfig.composerIgnorePlatformReqs = null;
}
} else if (key === 'azureAutoComplete' || key === 'gitLabAutomerge') {
if (migratedConfig[key] !== undefined) {
migratedConfig.platformAutomerge = migratedConfig[key];
}
delete migratedConfig[key];
}
const migratedTemplates = {
fromVersion: 'currentVersion',
Expand Down
19 changes: 6 additions & 13 deletions lib/config/options/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,13 +752,6 @@ const options: RenovateOptions[] = [
cli: false,
env: false,
},
{
name: 'azureAutoComplete',
description:
'If set to true, Azure DevOps PRs will be set to auto-complete after all (if any) branch policies have been met.',
type: 'boolean',
default: false,
},
{
name: 'azureWorkItemId',
description:
Expand Down Expand Up @@ -1910,12 +1903,6 @@ const options: RenovateOptions[] = [
type: 'boolean',
default: true,
},
{
name: 'gitLabAutomerge',
description: `Enable or disable usage of GitLab's "merge when pipeline succeeds" feature when automerging MRs.`,
type: 'boolean',
default: false,
},
{
name: 'gitLabIgnoreApprovals',
description: `Ignore approval rules for MRs created by Renovate, which is useful for automerge.`,
Expand Down Expand Up @@ -2083,6 +2070,12 @@ const options: RenovateOptions[] = [
globalOnly: true,
env: false,
},
{
name: 'platformAutomerge',
description: `Enable or disable usage of platform-native auto-merge capabilities when available.`,
type: 'boolean',
default: true,
},
];

export function getOptions(): RenovateOptions[] {
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Object {
"Use <code>renovate/</code> as prefix for all branch names",
"If semantic commits detected, use semantic commit type <code>fix</code> for dependencies and <code>chore</code> for all others",
"Require all status checks to pass before any automerging",
"Pin dependency versions for <code>devDependencies</code> and retain semver ranges for others",
"Pin dependency versions for <code>devDependencies</code> and retain SemVer ranges for others",
],
"ignoreTests": false,
"ignoreUnstable": true,
Expand Down
2 changes: 1 addition & 1 deletion lib/config/presets/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ Object {
const res = await presets.getPreset(':pinVersions(foo, bar)', {});
expect(res).toEqual({
description: [
'Use version pinning (maintain a single version only and not semver ranges)',
'Use version pinning (maintain a single version only and not SemVer ranges)',
],
rangeStrategy: 'pin',
});
Expand Down
Loading

0 comments on commit c104570

Please sign in to comment.