-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
140 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#!/bin/env python3 | ||
|
||
# This script is running with elevated privileges from the main branch against pull requests. | ||
|
||
import re | ||
import sys | ||
import tomllib | ||
from pathlib import Path | ||
|
||
from git import Repo | ||
|
||
|
||
def main(): | ||
assert len(sys.argv) == 3 | ||
|
||
with open("pyproject.toml", "rb") as fp: | ||
PYPROJECT_TOML = tomllib.load(fp) | ||
BLOCKING_REGEX = re.compile(r"DRAFT|WIP|NO\s*MERGE|DO\s*NOT\s*MERGE|EXPERIMENT") | ||
ISSUE_REGEX = re.compile(r"(?:fixes|closes)[\s:]+#(\d+)") | ||
CHERRY_PICK_REGEX = re.compile(r"^\s*\(cherry picked from commit [0-9a-f]*\)\s*$") | ||
try: | ||
CHANGELOG_EXTS = { | ||
f".{item['directory']}" for item in PYPROJECT_TOML["tool"]["towncrier"]["type"] | ||
} | ||
except KeyError: | ||
CHANGELOG_EXTS = {".feature", ".bugfix", ".doc", ".removal", ".misc"} | ||
|
||
repo = Repo(".") | ||
|
||
base_commit = repo.commit(sys.argv[1]) | ||
head_commit = repo.commit(sys.argv[2]) | ||
|
||
pr_commits = list(repo.iter_commits(f"{base_commit}..{head_commit}")) | ||
|
||
labels = { | ||
"multi-commit": len(pr_commits) > 1, | ||
"cherry-pick": False, | ||
"no-issue": False, | ||
"no-changelog": False, | ||
"wip": False, | ||
} | ||
for commit in pr_commits: | ||
labels["wip"] |= BLOCKING_REGEX.search(commit.summary) is not None | ||
no_issue = ISSUE_REGEX.search(commit.message, re.IGNORECASE) is None | ||
labels["no-issue"] |= no_issue | ||
cherry_pick = CHERRY_PICK_REGEX.search(commit.message) is not None | ||
labels["cherry-pick"] |= cherry_pick | ||
changelog_snippets = [ | ||
k | ||
for k in commit.stats.files | ||
if k.startswith("CHANGES/") and Path(k).suffix in CHANGELOG_EXTS | ||
] | ||
labels["no-changelog"] |= not changelog_snippets | ||
|
||
print("ADD_LABELS=" + ",".join((k for k, v in labels.items() if v))) | ||
print("REMOVE_LABELS=" + ",".join((k for k, v in labels.items() if not v))) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2021.08.26-379-gece49c9 | ||
2021.08.26-388-g624de1a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,13 +62,8 @@ jobs: | |
committer: "pulpbot <[email protected]>" | ||
author: "pulpbot <[email protected]>" | ||
title: "Update CI files for branch main" | ||
body: "" | ||
branch: "update-ci/main" | ||
base: "main" | ||
commit-message: | | ||
Update CI files | ||
[noissue] | ||
delete-branch: true | ||
- uses: "actions/checkout@v4" | ||
with: | ||
|
@@ -89,13 +84,8 @@ jobs: | |
committer: "pulpbot <[email protected]>" | ||
author: "pulpbot <[email protected]>" | ||
title: "Update CI files for branch 1.10" | ||
body: "" | ||
branch: "update-ci/1.10" | ||
base: "1.10" | ||
commit-message: | | ||
Update CI files | ||
[noissue] | ||
delete-branch: true | ||
- uses: "actions/checkout@v4" | ||
with: | ||
|
@@ -116,13 +106,8 @@ jobs: | |
committer: "pulpbot <[email protected]>" | ||
author: "pulpbot <[email protected]>" | ||
title: "Update CI files for branch 1.11" | ||
body: "" | ||
branch: "update-ci/1.11" | ||
base: "1.11" | ||
commit-message: | | ||
Update CI files | ||
[noissue] | ||
delete-branch: true | ||
- uses: "actions/checkout@v4" | ||
with: | ||
|
@@ -143,13 +128,8 @@ jobs: | |
committer: "pulpbot <[email protected]>" | ||
author: "pulpbot <[email protected]>" | ||
title: "Update CI files for branch 1.12" | ||
body: "" | ||
branch: "update-ci/1.12" | ||
base: "1.12" | ||
commit-message: | | ||
Update CI files | ||
[noissue] | ||
delete-branch: true | ||
- uses: "actions/checkout@v4" | ||
with: | ||
|
@@ -170,13 +150,8 @@ jobs: | |
committer: "pulpbot <[email protected]>" | ||
author: "pulpbot <[email protected]>" | ||
title: "Update CI files for branch 1.13" | ||
body: "" | ||
branch: "update-ci/1.13" | ||
base: "1.13" | ||
commit-message: | | ||
Update CI files | ||
[noissue] | ||
delete-branch: true | ||
- uses: "actions/checkout@v4" | ||
with: | ||
|
@@ -197,11 +172,7 @@ jobs: | |
committer: "pulpbot <[email protected]>" | ||
author: "pulpbot <[email protected]>" | ||
title: "Update CI files for branch 1.14" | ||
body: "" | ||
branch: "update-ci/1.14" | ||
base: "1.14" | ||
commit-message: | | ||
Update CI files | ||
[noissue] | ||
delete-branch: true | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[//]: # "WARNING: DO NOT EDIT!" | ||
[//]: # "" | ||
[//]: # "This file was generated by plugin_template, and is managed by it. Please use" | ||
[//]: # "'./plugin-template --github pulp_file' to update this file." | ||
[//]: # "" | ||
[//]: # "For more info visit https://github.com/pulp/plugin_template" | ||
# Releasing (For Internal Use) | ||
|
||
This document outlines the steps to perform a release. | ||
|
||
### Determine if a Release is Required | ||
- Run the release checker script: | ||
``` | ||
python3 .ci/scripts/check_release.py | ||
``` | ||
|
||
### Create a New Y-branch (e.g., 3.23) | ||
- If a new minor version (Y) is needed, trigger a [Create New Release Branch](https://github.com/pulp/pulp_file/actions/workflows/create-branch.yml) job via the GitHub Actions. | ||
- Look for the "Bump minor version" pull request and merge it. | ||
|
||
### Release a New Z-version (Patch Release) (e.g., 3.23.1, 3.22.12) | ||
- Trigger a [Release Pipeline](https://github.com/pulp/pulp_file/actions/workflows/release.yml) job by specifying the release branch (X.Y) via the GitHub Actions. | ||
|
||
### Final Steps (Optional but Recommended) | ||
- Ensure the new version appears on PyPI. | ||
- Verify that the changelog has been updated by looking for the "Update Changelog" pull request. | ||
- Post a brief announcement about the new release on the [Pulp Discourse](https://discourse.pulpproject.org/). |
Oops, something went wrong.