Skip to content

Commit

Permalink
Merge branch 'main' into feat/gitlab-detailed-merge-status
Browse files Browse the repository at this point in the history
  • Loading branch information
javaxiss authored Dec 28, 2023
2 parents 85ed1fe + 53e1ca6 commit 78827ec
Show file tree
Hide file tree
Showing 24 changed files with 540 additions and 101 deletions.
18 changes: 18 additions & 0 deletions docs/development/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@ Second sentence on a new line.
And so on.
```

## Avoid manually ordering numbered lists

Avoid:

```markdown
1. First item
2. Second item
3. Third item
```

Do:

```markdown
1. First item
1. Second item
1. Third item
```

## Avoid punctuation at the end of list items

In Markdown files, avoid punctuation at the end of a list item.
Expand Down
1 change: 1 addition & 0 deletions docs/usage/merge-confidence.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Renovate will show Merge Confidence badges for these languages:

| Language | Datasource |
| ---------- | ----------- |
| Golang | `go` |
| JavaScript | `npm` |
| Java | `maven` |
| Python | `pypi` |
Expand Down
5 changes: 5 additions & 0 deletions docs/usage/self-hosted-experimental.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ Skip initializing `RE2` for regular expressions and instead use Node-native `Reg
If set, Renovate will query this API for Merge Confidence data.
This feature is in private beta.

## `RENOVATE_X_MERGE_CONFIDENCE_SUPPORTED_DATASOURCES`

If set, Renovate will query the merge-confidence JSON API only for datasources that are part of this list.
The expected value for this environment variable is a JSON array of strings.

## `RENOVATE_X_PLATFORM_VERSION`

If set, Renovate will use this string as GitLab server version instead of checking via the GitLab API.
Expand Down
2 changes: 1 addition & 1 deletion lib/config/options/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,7 @@ const options: RenovateOptions[] = [
type: 'string',
allowedValues: ['auto', 'fast-forward', 'merge-commit', 'rebase', 'squash'],
default: 'auto',
supportedPlatforms: ['bitbucket', 'gitea'],
supportedPlatforms: ['azure', 'bitbucket', 'gitea'],
},
{
name: 'automergeComment',
Expand Down
30 changes: 12 additions & 18 deletions lib/config/presets/internal/merge-confidence.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
import type { Preset } from '../types';

export const supportedDatasources = [
'go',
'maven',
'npm',
'nuget',
'packagist',
'pypi',
'rubygems',
];

export const presets: Record<string, Preset> = {
'all-badges': {
description: 'Show all Merge Confidence badges for pull requests.',
packageRules: [
{
matchDatasources: [
'maven',
'npm',
'nuget',
'packagist',
'pypi',
'rubygems',
'go',
],
matchDatasources: supportedDatasources,
matchUpdateTypes: ['patch', 'minor', 'major'],
prBodyColumns: [
'Package',
Expand All @@ -31,15 +33,7 @@ export const presets: Record<string, Preset> = {
'Show only the Age and Confidence Merge Confidence badges for pull requests.',
packageRules: [
{
matchDatasources: [
'maven',
'npm',
'nuget',
'packagist',
'pypi',
'rubygems',
'go',
],
matchDatasources: supportedDatasources,
matchUpdateTypes: ['patch', 'minor', 'major'],
prBodyColumns: ['Package', 'Change', 'Age', 'Confidence'],
},
Expand Down
1 change: 1 addition & 0 deletions lib/config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export interface RenovateConfig
Record<string, unknown> {
depName?: string;
baseBranches?: string[];
commitBody?: string;
useBaseBranchConfig?: UseBaseBranchConfigType;
baseBranch?: string;
defaultBranch?: string;
Expand Down
45 changes: 45 additions & 0 deletions lib/modules/manager/pep621/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,13 @@ describe('modules/manager/pep621/extract', () => {
depType: 'project.dependencies',
packageName: 'requests',
},
{
datasource: 'pypi',
depName: 'hatchling',
depType: 'build-system.requires',
packageName: 'hatchling',
skipReason: 'unspecified-version',
},
{
currentValue: '==6.5',
datasource: 'pypi',
Expand Down Expand Up @@ -323,5 +330,43 @@ describe('modules/manager/pep621/extract', () => {
const res = extractPackageFile(content, 'pyproject.toml');
expect(res?.packageFileVersion).toBe('0.0.2');
});

it('should extract dependencies from build-system.requires', function () {
const content = codeBlock`
[build-system]
requires = ["hatchling==1.18.0", "setuptools==69.0.3"]
build-backend = "hatchling.build"
[project]
name = "test"
version = "0.0.2"
dependencies = [ "requests==2.30.0" ]
`;
const result = extractPackageFile(content, 'pyproject.toml');

expect(result?.deps).toEqual([
{
currentValue: '==2.30.0',
datasource: 'pypi',
depName: 'requests',
depType: 'project.dependencies',
packageName: 'requests',
},
{
currentValue: '==1.18.0',
datasource: 'pypi',
depName: 'hatchling',
depType: 'build-system.requires',
packageName: 'hatchling',
},
{
currentValue: '==69.0.3',
datasource: 'pypi',
depName: 'setuptools',
depType: 'build-system.requires',
packageName: 'setuptools',
},
]);
});
});
});
6 changes: 6 additions & 0 deletions lib/modules/manager/pep621/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export function extractPackageFile(
def.project?.['optional-dependencies'],
),
);
deps.push(
...parseDependencyList(
depTypes.buildSystemRequires,
def['build-system']?.requires,
),
);

// process specific tool sets
let processedDeps = deps;
Expand Down
1 change: 1 addition & 0 deletions lib/modules/manager/pep621/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ Available `depType`s:

- `project.dependencies`
- `project.optional-dependencies`
- `build-system.requires`
- `tool.pdm.dev-dependencies`
- `tool.hatch.envs.<env-name>`
5 changes: 5 additions & 0 deletions lib/modules/manager/pep621/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ export const PyProjectSchema = z.object({
'optional-dependencies': DependencyRecordSchema,
})
.optional(),
'build-system': z
.object({
requires: DependencyListSchema,
})
.optional(),
tool: z
.object({
pdm: z
Expand Down
1 change: 1 addition & 0 deletions lib/modules/manager/pep621/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const depTypes = {
dependencies: 'project.dependencies',
optionalDependencies: 'project.optional-dependencies',
pdmDevDependencies: 'tool.pdm.dev-dependencies',
buildSystemRequires: 'build-system.requires',
};

export function parsePEP508(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ exports[`modules/platform/azure/index createPr() when usePlatformAutomerge is se
"completionOptions": {
"deleteSourceBranch": true,
"mergeCommitMessage": "The Title",
"squashMerge": true,
"mergeStrategy": 2,
},
"createdAt": undefined,
"createdBy": {
Expand Down
Loading

0 comments on commit 78827ec

Please sign in to comment.