Skip to content

Commit

Permalink
Update CI files
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
pulpbot authored and ipanova committed Feb 5, 2024
1 parent a3f7c4c commit facc142
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 18 deletions.
13 changes: 8 additions & 5 deletions .ci/scripts/check_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def main():
"--branches",
default="supported",
help="A comma separated list of branches to check for releases. Can also use keyword: "
"'supported'. Defaults to 'supported', see `ci_update_branches` in "
"'supported'. Defaults to 'supported', see `supported_release_branches` in "
"`plugin_template.yml`.",
)
opts = parser.parse_args()
Expand All @@ -46,12 +46,15 @@ def main():
if branches == "supported":
with open(f"{d}/template_config.yml", mode="r") as f:
tc = yaml.safe_load(f)
branches = tc["ci_update_branches"]
branches.append(DEFAULT_BRANCH)
branches = set(tc["supported_release_branches"])
latest_release_branch = tc["latest_release_branch"]
if latest_release_branch is not None:
branches.add(latest_release_branch)
branches.add(DEFAULT_BRANCH)
else:
branches = branches.split(",")
branches = set(branches.split(","))

if diff := set(branches) - set(available_branches):
if diff := branches - set(available_branches):
print(f"Supplied branches contains non-existent branches! {diff}")
exit(1)

Expand Down
8 changes: 5 additions & 3 deletions .ci/scripts/collect_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
CHANGELOG_FILE = tc_settings.get("filename", "NEWS.rst")
START_STRING = tc_settings.get(
"start_string",
"<!-- towncrier release notes start -->\n"
if CHANGELOG_FILE.endswith(".md")
else ".. towncrier release notes start\n",
(
"<!-- towncrier release notes start -->\n"
if CHANGELOG_FILE.endswith(".md")
else ".. towncrier release notes start\n"
),
)
TITLE_FORMAT = tc_settings.get("title_format", "{name} {version} ({project_date})")

Expand Down
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-307-gdfd2f01
2021.08.26-313-g0528507
15 changes: 14 additions & 1 deletion .github/workflows/create-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: "Install python dependencies"
run: |
echo ::group::PYDEPS
pip install bump2version jinja2 pyyaml
pip install bump2version jinja2 pyyaml packaging
echo ::endgroup::
- name: "Setting secrets"
Expand Down Expand Up @@ -71,6 +71,19 @@ jobs:
run: |
find CHANGES -type f -regex ".*\.\(bugfix\|doc\|feature\|misc\|deprecation\|removal\)" -exec git rm {} +
- name: Checkout plugin template
uses: actions/checkout@v3
with:
repository: pulp/plugin_template
path: plugin_template
fetch-depth: 0

- name: Update CI branches in template_config
working-directory: plugin_template
run: |
python3 ./plugin-template pulp_container --github --latest-release-branch "${NEW_BRANCH}"
git add -A
- name: Make a PR with version bump and without CHANGES/*
uses: peter-evans/create-pull-request@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
with:
fetch-depth: 0
path: "pulp_container"
token: ${{ secrets.RELEASE_TOKEN }}

- uses: "actions/setup-python@v4"
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/scripts/update_backport_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ def random_color():
assert response.status_code == 200
old_labels = set([x["name"] for x in response.json() if x["name"].startswith("backport-")])

# get ci_update_branches from template_config.yml
# get list of branches from template_config.yml
with open("./template_config.yml", "r") as f:
plugin_template = yaml.safe_load(f)
new_labels = set(["backport-" + x for x in plugin_template["ci_update_branches"]])
branches = set(plugin_template["supported_release_branches"])
latest_release_branch = plugin_template["latest_release_branch"]
if latest_release_branch is not None:
branches.add(latest_release_branch)
new_labels = {"backport-" + x for x in branches}

# delete old labels that are not in new labels
for label in old_labels.difference(new_labels):
Expand Down
12 changes: 6 additions & 6 deletions template_config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This config represents the latest values used when running the plugin-template. Any settings that
# were not present before running plugin-template have been added with their default values.

# generated with [email protected]307-gdfd2f01
# generated with [email protected]313-g0528507

api_root: /pulp/
black: true
Expand All @@ -11,12 +11,7 @@ check_manifest: true
check_stray_pulpcore_imports: true
ci_env: {}
ci_trigger: '{pull_request: {branches: [''*'']}}'
ci_update_branches:
- '2.9'
- '2.10'
- '2.14'
ci_update_docs: false
ci_update_release_behavior: null
cli_package: pulp-cli
cli_repo: https://github.com/pulp/pulp-cli.git
core_import_allowed: []
Expand All @@ -33,6 +28,7 @@ flake8_ignore: []
github_org: pulp
issue_tracker: github
kanban: true
latest_release_branch: null
lint_requirements: true
noissue_marker: '[noissue]'
parallel_test_workers: 8
Expand Down Expand Up @@ -73,6 +69,10 @@ stalebot: true
stalebot_days_until_close: 30
stalebot_days_until_stale: 90
stalebot_limit_to_pulls: true
supported_release_branches:
- '2.9'
- '2.10'
- '2.14'
sync_ci: true
test_azure: true
test_cli: true
Expand Down
1 change: 1 addition & 0 deletions unittest_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
mock
pytest-django
pulp-smash @ git+https://github.com/pulp/pulp-smash.git
pytest<8

0 comments on commit facc142

Please sign in to comment.