Skip to content

Commit 9decd7f

Browse files
committed
Update the vendor-schemas script to list names
The changelog modification step now - pulls the names of updated schemas from the changelog - adds any new updated schemas - sorts - textwraps - replaces any existing changelog item for schema updates And run the script, getting the latest updates and updating wtih schema names since the last release.
1 parent 534c90d commit 9decd7f

File tree

11 files changed

+39
-98
lines changed

11 files changed

+39
-98
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ Unreleased
1010

1111
.. vendor-insert-here
1212
13-
- Update vendored schemas (2025-02-16)
13+
- Update vendored schemas: dependabot, github-workflows, gitlab-ci, mergify, renovate,
14+
woodpecker-ci (2025-02-19)
1415

1516
0.31.1
1617
------

RELEASING.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Releasing
22

33
- Bump the version with `./scripts/bump-version.py NEW_VERSION`
4-
- In the changelog, if there were vendored schema updates, note their
5-
names (see past changelog entries for examples)
64
- Add, commit with `git commit -m 'Bump version for release'`, and push
75
- Create a release tag, which will auto-publish to testpypi (`make release`)
86
- Create a GitHub release, which will auto-publish to pypi (web UI)

scripts/vendor-schemas.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os
77
import re
88
import subprocess
9+
import textwrap
910

1011
import requests
1112

@@ -17,8 +18,9 @@
1718

1819
EXISTING_CHANGELINE_PATTERN = re.compile(
1920
re.escape(VENDOR_SLUG)
20-
+ "\n?- Update vendored schemas"
21-
+ r" \(\d{4}-\d{2}-\d{2}\)"
21+
+ "\n?- Update vendored schemas: "
22+
+ r"([\w-]+(,\s+[\w-]+)*) "
23+
+ r"\(\d{4}-\d{2}-\d{2}\)"
2224
+ "\n",
2325
flags=re.MULTILINE,
2426
)
@@ -121,12 +123,30 @@ def update_changelog() -> None:
121123
print("changes were made, updating changelog")
122124
with open("CHANGELOG.rst", encoding="utf-8") as fp:
123125
content = fp.read()
124-
new_slug = VENDOR_SLUG + f"\n- Update vendored schemas ({TODAY})\n"
125126

126-
if EXISTING_CHANGELINE_PATTERN.search(content):
127-
content = EXISTING_CHANGELINE_PATTERN.sub(new_slug, content)
127+
new_item_prefix = "- Update vendored schemas:"
128+
129+
if match := EXISTING_CHANGELINE_PATTERN.search(content):
130+
updated_schemas = {s.rstrip(",") for s in match.group(1).split()}
131+
updated_schemas.update(SCHEMAS_WITH_NEW_HASHES)
132+
else:
133+
updated_schemas = SCHEMAS_WITH_NEW_HASHES
134+
135+
schema_list = sorted(updated_schemas)
136+
new_item = new_item_prefix + f" {', '.join(schema_list)} ({TODAY})\n"
137+
138+
new_item = "\n".join(
139+
textwrap.wrap(
140+
new_item, break_on_hyphens=False, subsequent_indent=" ", width=88
141+
)
142+
)
143+
new_item = f"{VENDOR_SLUG}\n{new_item}\n"
144+
145+
if match:
146+
content = EXISTING_CHANGELINE_PATTERN.sub(new_item, content)
128147
else:
129-
content = content.replace(VENDOR_SLUG, new_slug)
148+
content = content.replace(VENDOR_SLUG, new_item)
149+
130150
with open("CHANGELOG.rst", "w", encoding="utf-8") as fp:
131151
fp.write(content)
132152

src/check_jsonschema/builtin_schemas/vendor/dependabot.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,7 @@
647647
},
648648
"package-ecosystem-values": {
649649
"enum": [
650+
"bun",
650651
"bundler",
651652
"cargo",
652653
"composer",

src/check_jsonschema/builtin_schemas/vendor/github-workflows.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1640,6 +1640,7 @@
16401640
"description": "You can schedule a workflow to run at specific UTC times using POSIX cron syntax (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07). Scheduled workflows run on the latest commit on the default or base branch. The shortest interval you can run scheduled workflows is once every 5 minutes.\nNote: GitHub Actions does not support the non-standard syntax @yearly, @monthly, @weekly, @daily, @hourly, and @reboot.\nYou can use crontab guru (https://crontab.guru/). to help generate your cron syntax and confirm what time it will run. To help you get started, there is also a list of crontab guru examples (https://crontab.guru/examples.html).",
16411641
"type": "array",
16421642
"items": {
1643+
"type": "object",
16431644
"properties": {
16441645
"cron": {
16451646
"type": "string"

src/check_jsonschema/builtin_schemas/vendor/gitlab-ci.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,11 @@
521521
"format": "uri-reference",
522522
"pattern": "^https?://.+\\.ya?ml$"
523523
},
524+
"integrity": {
525+
"description": "SHA256 integrity hash of the remote file content.",
526+
"type": "string",
527+
"pattern": "^sha256-[A-Za-z0-9+/]{43}=$"
528+
},
524529
"rules": {
525530
"$ref": "#/definitions/includeRules"
526531
},

src/check_jsonschema/builtin_schemas/vendor/mergify.json

Lines changed: 0 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,13 +1212,6 @@
12121212
"default": null,
12131213
"description": "Template to use as the commit message when using the merge or squash merge method.",
12141214
"title": "Commit Message Template"
1215-
},
1216-
"allow_merging_configuration_change": {
1217-
"default": true,
1218-
"deprecated": true,
1219-
"description": "Allow merging the Mergify configuration file. *This option does not do anything and is only present for backward compatibility.*",
1220-
"title": "Allow Merging Configuration Change",
1221-
"type": "boolean"
12221215
}
12231216
},
12241217
"title": "MergeActionModel",
@@ -1569,11 +1562,6 @@
15691562
"description": "The review decision. This indicates if `CODEOWNERS` have reviewed the pull request when the `Require Review from Code Owners` branch protection rule is enabled.",
15701563
"title": "Branch protection review decision"
15711564
},
1572-
"queue-frozen": {
1573-
"description": "Whether the pull request is in a queue that is frozen.",
1574-
"title": "Queue frozen",
1575-
"type": "boolean"
1576-
},
15771565
"number": {
15781566
"description": "The pull request number.",
15791567
"minimum": 0,
@@ -1724,18 +1712,6 @@
17241712
"description": "The name of the queue containing the pull request.",
17251713
"title": "Queue name"
17261714
},
1727-
"queue-freeze-reason": {
1728-
"anyOf": [
1729-
{
1730-
"type": "string"
1731-
},
1732-
{
1733-
"type": "null"
1734-
}
1735-
],
1736-
"description": "The reason for the queue containing the pull request to be frozen.",
1737-
"title": "Queue freeze reason"
1738-
},
17391715
"queue-partition-name": {
17401716
"anyOf": [
17411717
{
@@ -2107,7 +2083,6 @@
21072083
"linear-history",
21082084
"conflict",
21092085
"branch-protection-review-decision",
2110-
"queue-frozen",
21112086
"number",
21122087
"queue-position",
21132088
"author",
@@ -2124,7 +2099,6 @@
21242099
"repository-full-name",
21252100
"queue-dequeue-reason",
21262101
"queue-name",
2127-
"queue-freeze-reason",
21282102
"queue-partition-name",
21292103
"assignee",
21302104
"label",
@@ -2401,13 +2375,6 @@
24012375
"description": "Allow merging the Mergify configuration file. *This option does not do anything and is only present for backward compatibility.*",
24022376
"title": "Allow Merging Configuration Change",
24032377
"type": "boolean"
2404-
},
2405-
"autosquash": {
2406-
"default": true,
2407-
"deprecated": true,
2408-
"description": "This option is relevant only if you do in place checks and if you use the `rebase` option of the update_method. It will automatically squash your commits beginning by `squash!`, `fixup!` or `amend!`, just like the option with the same name when doing a `git rebase`.",
2409-
"title": "Autosquash",
2410-
"type": "boolean"
24112378
}
24122379
},
24132380
"title": "QueueActionModel",
@@ -2437,15 +2404,6 @@
24372404
"QueueRuleModel": {
24382405
"additionalProperties": false,
24392406
"properties": {
2440-
"priority_rules": {
2441-
"$ref": "#/$defs/PriorityRulesModel",
2442-
"configuration_deprecated_attribute": {
2443-
"deprecated_summary_ghes_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `priority_rules` attribute in the `queue_rules` section. The priority rules must now be set at the top level of the configuration file.**\n> This option will be removed in a future version.\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules",
2444-
"deprecated_summary_saas_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `priority_rules` attribute in the `queue_rules` section. The priority rules must now be set at the top level of the configuration file.**\nThis option will be removed on January 31st, 2025\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules"
2445-
},
2446-
"deprecated": true,
2447-
"description": "*This attribute is deprecated in favor of `priority_rules` at the top level of the Mergify configuration file.* The list of priority rules a pull request can match in order to be prioritized when added to a queue. The rule with the highest priority value wins."
2448-
},
24492407
"queue_conditions": {
24502408
"$ref": "#/$defs/QueueRuleMergeConditionsModel",
24512409
"description": "The list of conditions that needs to match to queue the pull request."
@@ -2664,23 +2622,6 @@
26642622
"title": "Disallow Checks Interruption From Queues",
26652623
"type": "array"
26662624
},
2667-
"allow_checks_interruption": {
2668-
"anyOf": [
2669-
{
2670-
"type": "boolean"
2671-
},
2672-
{
2673-
"type": "null"
2674-
}
2675-
],
2676-
"configuration_deprecated_attribute": {
2677-
"deprecated_summary_ghes_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `allow_checks_interruption` attribute in the `queue_rules` section. This option must now be set at the top level of the configuration file in the `priority_rules` section.**\n> This option will be removed in a future version.\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules",
2678-
"deprecated_summary_saas_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `allow_checks_interruption` attribute in the `queue_rules` section. This option must now be set at the top level of the configuration file in the `priority_rules` section.**\n> This option will be removed on January 31st, 2025.\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules"
2679-
},
2680-
"default": null,
2681-
"deprecated": true,
2682-
"title": "Allow Checks Interruption"
2683-
},
26842625
"name": {
26852626
"title": "Name",
26862627
"type": "string"
@@ -2695,15 +2636,6 @@
26952636
"QueueRuleModelForDefaults": {
26962637
"additionalProperties": false,
26972638
"properties": {
2698-
"priority_rules": {
2699-
"$ref": "#/$defs/PriorityRulesModel",
2700-
"configuration_deprecated_attribute": {
2701-
"deprecated_summary_ghes_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `priority_rules` attribute in the `queue_rules` section. The priority rules must now be set at the top level of the configuration file.**\n> This option will be removed in a future version.\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules",
2702-
"deprecated_summary_saas_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `priority_rules` attribute in the `queue_rules` section. The priority rules must now be set at the top level of the configuration file.**\nThis option will be removed on January 31st, 2025\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules"
2703-
},
2704-
"deprecated": true,
2705-
"description": "*This attribute is deprecated in favor of `priority_rules` at the top level of the Mergify configuration file.* The list of priority rules a pull request can match in order to be prioritized when added to a queue. The rule with the highest priority value wins."
2706-
},
27072639
"queue_conditions": {
27082640
"$ref": "#/$defs/QueueRuleMergeConditionsModel",
27092641
"description": "The list of conditions that needs to match to queue the pull request."
@@ -2921,23 +2853,6 @@
29212853
"maxItems": 50,
29222854
"title": "Disallow Checks Interruption From Queues",
29232855
"type": "array"
2924-
},
2925-
"allow_checks_interruption": {
2926-
"anyOf": [
2927-
{
2928-
"type": "boolean"
2929-
},
2930-
{
2931-
"type": "null"
2932-
}
2933-
],
2934-
"configuration_deprecated_attribute": {
2935-
"deprecated_summary_ghes_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `allow_checks_interruption` attribute in the `queue_rules` section. This option must now be set at the top level of the configuration file in the `priority_rules` section.**\n> This option will be removed in a future version.\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules",
2936-
"deprecated_summary_saas_mode": "\n:bangbang: **Action Required** :bangbang:\n> **The configuration uses the deprecated `allow_checks_interruption` attribute in the `queue_rules` section. This option must now be set at the top level of the configuration file in the `priority_rules` section.**\n> This option will be removed on January 31st, 2025.\n> For more information: https://docs.mergify.com/configuration/file-format/#priority-rules"
2937-
},
2938-
"default": null,
2939-
"deprecated": true,
2940-
"title": "Allow Checks Interruption"
29412856
}
29422857
},
29432858
"title": "QueueRuleModelForDefaults",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bb1d6e2ddccbdc94a4ea84617fa89af57f6938b9ef72095583a31b6914c8ae1c
1+
c3463cad77fbd8f9e520c140b8bd337ff6c52190b9079e4661f4cf548ebf44b4
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
72980780f308c86943ff694531ca6f7cdc56afcddefd85d4cd11632f9c3f87ef
1+
a4e9db7fb53cb6dd91b3c71449b98f42d8e778ebf6cf1bd1b8c3224f3dce8bee
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f48b339b4ea94722060efb40d884ce2089a48b6732ef666538958d08102f45a2
1+
7570c1d2b90e172fdcc05906939e70aeb34c12e5c9ebc24f10600c68641762a5

0 commit comments

Comments
 (0)