@ankhorage/renovate 0.2.18 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/policy-owner.test.d.ts +2 -0
- package/dist/policy-owner.test.d.ts.map +1 -0
- package/dist/policy-owner.test.js +70 -0
- package/dist/policy-owner.test.js.map +1 -0
- package/examples/policy-renovate.json5 +14 -0
- package/package.json +6 -4
- package/policy-owner.json +52 -0
package/CHANGELOG.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-owner.test.d.ts","sourceRoot":"","sources":["../src/policy-owner.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { expect, test } from 'bun:test';
|
|
2
|
+
import { dependency, readPreset, resolveRules } from './renovatePreset.testSupport.js';
|
|
3
|
+
const consumerPreset = readPreset('../default.json');
|
|
4
|
+
const policyOwnerPreset = readPreset('../policy-owner.json');
|
|
5
|
+
const effectiveRules = [...consumerPreset.packageRules, ...policyOwnerPreset.packageRules];
|
|
6
|
+
test('composes with the consumer default-deny boundary', () => {
|
|
7
|
+
expect(policyOwnerPreset.extends).toEqual(['./default']);
|
|
8
|
+
});
|
|
9
|
+
test('tracks the two canonical runtime literals in repository policy', () => {
|
|
10
|
+
expect(policyOwnerPreset.customManagers).toEqual([
|
|
11
|
+
expect.objectContaining({
|
|
12
|
+
customType: 'regex',
|
|
13
|
+
datasourceTemplate: 'npm',
|
|
14
|
+
depNameTemplate: 'bun',
|
|
15
|
+
managerFilePatterns: ['/^src\\/repository\\/policy\\.ts$/'],
|
|
16
|
+
matchStrings: ["const BUN_VERSION = '(?<currentValue>[^']+)';"],
|
|
17
|
+
}),
|
|
18
|
+
expect.objectContaining({
|
|
19
|
+
customType: 'regex',
|
|
20
|
+
datasourceTemplate: 'npm',
|
|
21
|
+
depNameTemplate: '@types/bun',
|
|
22
|
+
managerFilePatterns: ['/^src\\/repository\\/policy\\.ts$/'],
|
|
23
|
+
matchStrings: ["const BUN_TYPES_VERSION = '(?<currentValue>[^']+)';"],
|
|
24
|
+
}),
|
|
25
|
+
]);
|
|
26
|
+
});
|
|
27
|
+
test('groups policy literals with matching root package updates', () => {
|
|
28
|
+
for (const candidate of [
|
|
29
|
+
dependency('bun', {
|
|
30
|
+
fileName: 'src/repository/policy.ts',
|
|
31
|
+
manager: 'custom.regex',
|
|
32
|
+
}),
|
|
33
|
+
dependency('@types/bun', {
|
|
34
|
+
fileName: 'src/repository/policy.ts',
|
|
35
|
+
manager: 'custom.regex',
|
|
36
|
+
}),
|
|
37
|
+
dependency('bun'),
|
|
38
|
+
dependency('@types/bun'),
|
|
39
|
+
]) {
|
|
40
|
+
expect(resolveRules(effectiveRules, candidate)).toMatchObject({
|
|
41
|
+
automerge: true,
|
|
42
|
+
automergeType: 'pr',
|
|
43
|
+
enabled: true,
|
|
44
|
+
groupName: 'Policy-owned runtime',
|
|
45
|
+
groupSlug: 'policy-owned-runtime',
|
|
46
|
+
labels: ['dependencies', 'renovate:automerge'],
|
|
47
|
+
platformAutomerge: false,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
test('requires review for major runtime upgrades', () => {
|
|
52
|
+
expect(resolveRules(effectiveRules, dependency('bun', {
|
|
53
|
+
fileName: 'src/repository/policy.ts',
|
|
54
|
+
manager: 'custom.regex',
|
|
55
|
+
updateType: 'major',
|
|
56
|
+
}))).toMatchObject({
|
|
57
|
+
automerge: false,
|
|
58
|
+
enabled: true,
|
|
59
|
+
groupName: 'Policy-owned runtime',
|
|
60
|
+
labels: ['dependencies', 'renovate:review-required'],
|
|
61
|
+
platformAutomerge: false,
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
test('does not broaden third-party updates beyond Policy-owned runtime fields', () => {
|
|
65
|
+
expect(resolveRules(effectiveRules, dependency('typescript'))).toEqual({ enabled: false });
|
|
66
|
+
expect(resolveRules(effectiveRules, dependency('bun', {
|
|
67
|
+
fileName: 'examples/package.json',
|
|
68
|
+
}))).toEqual({ enabled: false });
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=policy-owner.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy-owner.test.js","sourceRoot":"","sources":["../src/policy-owner.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEvF,MAAM,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;AACrD,MAAM,iBAAiB,GAAG,UAAU,CAAC,sBAAsB,CAAC,CAAC;AAC7D,MAAM,cAAc,GAAG,CAAC,GAAG,cAAc,CAAC,YAAY,EAAE,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAE3F,IAAI,CAAC,kDAAkD,EAAE,GAAG,EAAE;IAC5D,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAC3D,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,gEAAgE,EAAE,GAAG,EAAE;IAC1E,MAAM,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;QAC/C,MAAM,CAAC,gBAAgB,CAAC;YACtB,UAAU,EAAE,OAAO;YACnB,kBAAkB,EAAE,KAAK;YACzB,eAAe,EAAE,KAAK;YACtB,mBAAmB,EAAE,CAAC,oCAAoC,CAAC;YAC3D,YAAY,EAAE,CAAC,+CAA+C,CAAC;SAChE,CAAC;QACF,MAAM,CAAC,gBAAgB,CAAC;YACtB,UAAU,EAAE,OAAO;YACnB,kBAAkB,EAAE,KAAK;YACzB,eAAe,EAAE,YAAY;YAC7B,mBAAmB,EAAE,CAAC,oCAAoC,CAAC;YAC3D,YAAY,EAAE,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Ac,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAC3F,MAAM,CACJ,YAAY,CACV,cAAc,EACd,UAAU,CAAC,KAAK,EAAE;QAChB,QAAQ,EAAE,uBAAuB;KAClC,CAAC,CACH,CACF,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AAChC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Policy owner repository configuration
|
|
3
|
+
*
|
|
4
|
+
* Loads the owner-specific policy that groups the canonical Bun runtime literals with the matching
|
|
5
|
+
* root package metadata. Major runtime upgrades remain reviewable. Do not use this profile in
|
|
6
|
+
* normal consumer repositories.
|
|
7
|
+
*
|
|
8
|
+
* @usage
|
|
9
|
+
* @readme
|
|
10
|
+
*/
|
|
11
|
+
{
|
|
12
|
+
$schema: 'https://docs.renovatebot.com/renovate-schema.json',
|
|
13
|
+
extends: ['github>ankhorage/renovate:policy-owner'],
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/renovate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Ankhorage dependency update policy and automation powered by Renovate.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"dist",
|
|
28
28
|
"default.json",
|
|
29
29
|
"devtools-owner.json",
|
|
30
|
+
"policy-owner.json",
|
|
30
31
|
"examples",
|
|
31
32
|
"paradox",
|
|
32
33
|
"README.md",
|
|
@@ -40,7 +41,8 @@
|
|
|
40
41
|
},
|
|
41
42
|
"./default.json": "./default.json",
|
|
42
43
|
"./devtools-owner.json": "./devtools-owner.json",
|
|
43
|
-
"./package.json": "./package.json"
|
|
44
|
+
"./package.json": "./package.json",
|
|
45
|
+
"./policy-owner.json": "./policy-owner.json"
|
|
44
46
|
},
|
|
45
47
|
"publishConfig": {
|
|
46
48
|
"access": "public"
|
|
@@ -50,7 +52,7 @@
|
|
|
50
52
|
"changeset": "ankhorage-changeset",
|
|
51
53
|
"changeset:status": "ankhorage-changeset status --since=origin/main",
|
|
52
54
|
"docs": "paradox",
|
|
53
|
-
"test": "bun test src && RENOVATE_X_IGNORE_RE2=true renovate-config-validator default.json devtools-owner.json",
|
|
55
|
+
"test": "bun test src && RENOVATE_X_IGNORE_RE2=true renovate-config-validator default.json devtools-owner.json policy-owner.json",
|
|
54
56
|
"typecheck": "bun x tsc --noEmit -p tsconfig.json",
|
|
55
57
|
"version-packages": "ankhorage-changeset version",
|
|
56
58
|
"lint": "ankhorage-eslint . --max-warnings=0",
|
|
@@ -61,7 +63,7 @@
|
|
|
61
63
|
},
|
|
62
64
|
"devDependencies": {
|
|
63
65
|
"@ankhorage/devtools": "^1.11.11",
|
|
64
|
-
"@ankhorage/paradox": "^0.
|
|
66
|
+
"@ankhorage/paradox": "^0.2.5",
|
|
65
67
|
"@types/bun": "^1.4.1",
|
|
66
68
|
"@types/node": "^24.13.3",
|
|
67
69
|
"renovate": "^44.43.1",
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
+
"description": ["Policy-owner dependency update policy for ankhorage/policy."],
|
|
4
|
+
"extends": ["./default"],
|
|
5
|
+
"customManagers": [
|
|
6
|
+
{
|
|
7
|
+
"customType": "regex",
|
|
8
|
+
"description": "Track the canonical Bun runtime literal owned by @ankhorage/policy.",
|
|
9
|
+
"managerFilePatterns": ["/^src\\/repository\\/policy\\.ts$/"],
|
|
10
|
+
"matchStrings": ["const BUN_VERSION = '(?<currentValue>[^']+)';"],
|
|
11
|
+
"depNameTemplate": "bun",
|
|
12
|
+
"datasourceTemplate": "npm"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"customType": "regex",
|
|
16
|
+
"description": "Track the canonical Bun types literal owned by @ankhorage/policy.",
|
|
17
|
+
"managerFilePatterns": ["/^src\\/repository\\/policy\\.ts$/"],
|
|
18
|
+
"matchStrings": ["const BUN_TYPES_VERSION = '(?<currentValue>[^']+)';"],
|
|
19
|
+
"depNameTemplate": "@types/bun",
|
|
20
|
+
"datasourceTemplate": "npm"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"packageRules": [
|
|
24
|
+
{
|
|
25
|
+
"description": "Group the runtime policy literals and matching root package declarations.",
|
|
26
|
+
"matchManagers": ["bun", "custom.regex"],
|
|
27
|
+
"matchFileNames": ["package.json", "src/repository/policy.ts"],
|
|
28
|
+
"matchPackageNames": ["bun", "@types/bun"],
|
|
29
|
+
"enabled": true,
|
|
30
|
+
"labels": ["dependencies", "renovate:automerge"],
|
|
31
|
+
"groupName": "Policy-owned runtime",
|
|
32
|
+
"groupSlug": "policy-owned-runtime",
|
|
33
|
+
"rangeStrategy": "bump",
|
|
34
|
+
"automerge": true,
|
|
35
|
+
"automergeType": "pr",
|
|
36
|
+
"platformAutomerge": false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"description": "Require review for major Policy-owned runtime upgrades.",
|
|
40
|
+
"matchManagers": ["bun", "custom.regex"],
|
|
41
|
+
"matchFileNames": ["package.json", "src/repository/policy.ts"],
|
|
42
|
+
"matchPackageNames": ["bun", "@types/bun"],
|
|
43
|
+
"matchUpdateTypes": ["major"],
|
|
44
|
+
"enabled": true,
|
|
45
|
+
"labels": ["dependencies", "renovate:review-required"],
|
|
46
|
+
"groupName": "Policy-owned runtime",
|
|
47
|
+
"groupSlug": "policy-owned-runtime",
|
|
48
|
+
"automerge": false,
|
|
49
|
+
"platformAutomerge": false
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|