Skip to content

Commit 67e7705

Browse files
authored
Bump frequenz-repo-config from 0.17.0 to 0.18.0 in the repo-config group across 1 directory (#535)
Bumps the repo-config group with 1 update in the / directory: [frequenz-repo-config](https://github.com/frequenz-floss/frequenz-repo-config-python). Updates `frequenz-repo-config` from 0.17.0 to 0.18.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/frequenz-floss/frequenz-repo-config-python/releases">frequenz-repo-config's releases</a>.</em></p> <blockquote> <h2>v0.18.0</h2> <h1>Frequenz Repository Configuration Release Notes</h1> <h2>Summary</h2> <p>This release focuses on finishing the automation of dependabot updates, adding more automated upgrade workflows and fixing some problems with the previous release.</p> <h2>Upgrading</h2> <h3>Cookiecutter template</h3> <p>All upgrading should be done via the migration script or regenerating the templates.</p> <pre lang="bash"><code>curl -sSLf https://raw.githubusercontent.com/frequenz-floss/frequenz-repo-config-python/&lt;tag&gt;/cookiecutter/migrate.py | python3 -I </code></pre> <h2>New Features</h2> <h3>Cookiecutter template</h3> <ul> <li>The cookiecutter now asks whether a repository is private, defaults that answer from the selected license, and uses it to toggle private-repository workflow behavior, public publishing jobs, and the link to GitHub Discussions in the issue template chooser.</li> <li>All dependencies have been updated in the templates.</li> <li>API projects now ship a dedicated <code>grpc-migration.yaml</code> workflow that runs after Dependabot bumps <code>grpcio</code>/<code>grpcio-tools</code>/<code>protobuf</code> and rewrites the matching runtime <code>&gt;=</code> floors in <code>pyproject.toml</code>.</li> <li>API projects now have a better grpcio/protobuf updates grouping in Dependabot, which should make upgrading easier, and plays nicer with the new <code>grpc-migration.yaml</code> workflow.</li> <li>API projects should now use the new API-specific <em>Protect version branches</em> ruleset variant, which includes the required <code>Fix gRPC/protobuf runtime floors</code> check without affecting non-API Python projects.</li> <li>Workflows using the <code>gh-action-dependabot-migrate</code> are upgraded to the latest version, which avoids unnecessary version iterations.</li> <li>Add an <code>isort-migration.yaml</code> workflow that automatically reorders imports when Dependabot upgrades <code>isort</code>.</li> </ul> <h2>Bug Fixes</h2> <h3>Cookiecutter template</h3> <ul> <li>The unused cross-arch QEMU-based testing infrastructure has been removed. The <code>.github/containers/nox-cross-arch/</code> and <code>.github/containers/test-installation/</code> directories, as well as the &quot;Cross-Arch Testing&quot; section in <code>CONTRIBUTING.md</code>.</li> <li>Private repositories now are generated with credentials uncommented and the publishing workflows disabled.</li> <li>The issue template chooser (<code>config.yml</code>) no longer includes the <code>contact_links</code> section for private repositories, since GitHub Discussions are typically disabled for them.</li> <li>Normalized the GitHub Action hashes for <code>gh-action-setup-git</code> and <code>gh-action-setup-python-with-deps</code> to point to the actual commit object, which is what Dependabot expects.</li> <li>API projects now configure black with <code>extend-exclude = '^/submodules/'</code> so the formatting check doesn't descend into external git submodules that don't follow our formatting rules.</li> <li>API projects now configure isort with <code>skip_glob = [&quot;submodules/*&quot;]</code> so the import-sorting check doesn't descend into external git submodules that don't follow our rules.</li> <li><code>CONTRIBUTING.md</code> <ul> <li>Fixed the nox example commands in to use the correct <code>tests/</code> directory instead of the non-existent <code>test/</code> directory.</li> <li>Fixed the wrong mention to PyPI publishing when releasing for private repositories.</li> </ul> </li> </ul> <h2>What's Changed</h2> <ul> <li>Add how to re-trigger a migration to the docs by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/559">frequenz-floss/frequenz-repo-config-python#559</a></li> <li>Remove unused cross-arch files and docs by <a href="https://github.com/llucax"><code>@​llucax</code></a> in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/547">frequenz-floss/frequenz-repo-config-python#547</a></li> <li>build(deps): bump frequenz-floss/gh-action-setup-python-with-deps from 0d0d77eac3b54799f31f25a1060ef2c6ebdf9299 to e4d0b2ef8f5a1612d7827f3abaef17c931d2b946 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot] in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/561">frequenz-floss/frequenz-repo-config-python#561</a></li> <li>build(deps): bump frequenz-floss/gh-action-nox from 1.1.0 to 1.1.1 in the compatible group by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot] in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/560">frequenz-floss/frequenz-repo-config-python#560</a></li> <li>build(deps): bump frequenz-floss/gh-action-setup-git from 16952aac3ccc01d27412fe0dea3ea946530dcace to f9d86a01228ee1cadaac5224d4d7626f1eb23f90 by <a href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot] in <a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/pull/562">frequenz-floss/frequenz-repo-config-python#562</a></li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/953600229a68741824999432b9b49d9a0bc56bec"><code>9536002</code></a> Update template versions and prepare the v0.18.0 release (<a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/issues/590">#590</a>)</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/085121516fb788293325e56808edecbd31f564f4"><code>0851215</code></a> Prepare release notes for v0.18.0</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/bee542d201b4b66ce71df2f17044dcf76869356a"><code>bee542d</code></a> template: Bump dependencies</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/80402d2a3969e3d19d2671eb98b6ac47ca422e2b"><code>80402d2</code></a> build(deps): bump the compatible group with 2 updates (<a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/issues/589">#589</a>)</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/df8ba243393801fd97e2b46cddfb68bef00848c7"><code>df8ba24</code></a> build(deps): bump the compatible group with 2 updates</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/e5f4e3968e5bc86758c46c41bdca5999dd80746c"><code>e5f4e39</code></a> Add <code>isort</code> dependabot auto-migration workflow (<a href="https://redirect.github.com/frequenz-floss/frequenz-repo-config-python/issues/585">#585</a>)</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/3afcb70310b690cc8eef4e631423af8d221b9f21"><code>3afcb70</code></a> Update release notes</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/e86009be83504bd3751139775388b0cb078f0c2e"><code>e86009b</code></a> Add isort submodules migration step</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/22be0eed5d3b5866dd348b0161de314eca66d5a5"><code>22be0ee</code></a> template: Make isort exclude submodules from API projects</li> <li><a href="https://github.com/frequenz-floss/frequenz-repo-config-python/commit/a45950072bfd4e287dffafb8096c0d42ddff7e47"><code>a459500</code></a> isort: Exclude golden tests</li> <li>Additional commits viewable in <a href="https://github.com/frequenz-floss/frequenz-repo-config-python/compare/v0.17.0...v0.18.0">compare view</a></li> </ul> </details> <br />
2 parents fec874e + 7752dc1 commit 67e7705

11 files changed

Lines changed: 109 additions & 96 deletions

.cookiecutter-replay.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"keywords": "channel",
99
"github_org": "frequenz-floss",
1010
"license": "MIT",
11+
"private_repo": "no",
1112
"author_name": "Frequenz Energy-as-a-Service GmbH",
1213
"author_email": "floss@frequenz.com",
1314
"python_package": "frequenz.channels",

.github/containers/nox-cross-arch/arm64-ubuntu-20.04-python-3.11.Dockerfile

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/containers/nox-cross-arch/entrypoint.bash

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/containers/test-installation/Dockerfile

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ updates:
2929
exclude-patterns:
3030
# pydoclint has shipped breaking changes in patch updates often
3131
- "pydoclint"
32+
- "isort"
3233
minor:
3334
update-types:
3435
- "minor"
@@ -45,6 +46,7 @@ updates:
4546
- "pydoclint"
4647
- "pymdownx-superfence-filter-lines"
4748
- "pytest-asyncio"
49+
- "isort"
4850
# We group repo-config updates as it uses optional dependencies that are
4951
# considered different dependencies otherwise, and will create one PR for
5052
# each if we don't group them.

.github/workflows/auto-dependabot.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ jobs:
2323
if: >
2424
github.actor == 'dependabot[bot]' &&
2525
!contains(github.event.pull_request.title, 'the repo-config group') &&
26-
!contains(github.event.pull_request.title, 'Bump black from ')
26+
!contains(github.event.pull_request.title, 'Bump black from ') &&
27+
!contains(github.event.pull_request.title, 'Bump isort from ')
2728
runs-on: ubuntu-slim
2829
steps:
2930
- name: Generate GitHub App token

.github/workflows/black-migration.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
# Read/update pull request metadata and labels.
6767
permission-pull-requests: write
6868
- name: Migrate
69-
uses: frequenz-floss/gh-action-dependabot-migrate@eb100d3cf732b4808a7776eee8f303521efd494b # v1.2.1
69+
uses: frequenz-floss/gh-action-dependabot-migrate@27763fb5eb56476d91abe00132e8a0614171f92f # v1.2.0
7070
with:
7171
migration-script: |
7272
import os
@@ -81,6 +81,7 @@ jobs:
8181
subprocess.run([sys.executable, "-Im", "black", "."], check=True)
8282
token: ${{ steps.create-app-token.outputs.token }}
8383
auto-merge-on-changes: "false"
84+
version-iteration: "false"
8485
sign-commits: "true"
8586
auto-merged-label: "tool:auto-merged"
8687
migrated-label: "tool:black:migration:executed"
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Automatic isort migration for Dependabot PRs
2+
#
3+
# When Dependabot upgrades isort, this workflow installs the new version and
4+
# runs `isort .` so the PR already contains any import-ordering changes
5+
# introduced by the upgrade, while leaving the PR open for review.
6+
#
7+
# isort follows SemVer but its release policy
8+
# (https://github.com/PyCQA/isort/blob/main/docs/major_releases/release_policy.md)
9+
# explicitly allows intentional formatting changes in minor releases, and
10+
# patch releases may also adjust output in smaller bug-fix ways. Because of
11+
# that, isort is excluded from the regular `patch` and `minor` Dependabot
12+
# groups: every isort bump produces an individual `Bump isort from …` PR and
13+
# is routed through this migration workflow.
14+
#
15+
# The companion auto-dependabot workflow skips those PRs so they're handled
16+
# exclusively by this migration workflow.
17+
#
18+
# XXX: !!! SECURITY WARNING !!!
19+
# pull_request_target has write access to the repo, and can read secrets.
20+
# This is required because Dependabot PRs are treated as fork PRs: the
21+
# GITHUB_TOKEN is read-only and secrets are unavailable with a plain
22+
# pull_request trigger. The action mitigates the risk by:
23+
# - Never executing code from the PR (the migration script is embedded
24+
# in this workflow file on the base branch, not taken from the PR).
25+
# - Gating migration steps on github.actor == 'dependabot[bot]'.
26+
# - Running checkout with persist-credentials: false and isolating
27+
# push credentials from the migration script environment.
28+
# For more details read:
29+
# https://securitylab.github.com/research/github-actions-preventing-pwn-requests/
30+
31+
name: isort Migration
32+
33+
on:
34+
merge_group: # To allow using this as a required check for merging
35+
pull_request_target:
36+
types: [opened, synchronize, reopened, labeled, unlabeled]
37+
38+
permissions:
39+
# Commit reformatted files back to the PR branch.
40+
contents: write
41+
# Create and normalize migration state labels.
42+
issues: write
43+
# Read/update pull request metadata and comments.
44+
pull-requests: write
45+
46+
jobs:
47+
isort-migration:
48+
name: Migrate isort
49+
# Skip if it was triggered by the merge queue. We only need the workflow to
50+
# be executed to meet the "Required check" condition for merging, but we
51+
# don't need to actually run the job, having the job present as Skipped is
52+
# enough.
53+
if: |
54+
github.event_name == 'pull_request_target' &&
55+
github.actor == 'dependabot[bot]' &&
56+
contains(github.event.pull_request.title, 'Bump isort from ')
57+
runs-on: ubuntu-24.04
58+
steps:
59+
- name: Generate token
60+
id: create-app-token
61+
uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
62+
with:
63+
app-id: ${{ secrets.FREQUENZ_AUTO_DEPENDABOT_APP_ID }}
64+
private-key: ${{ secrets.FREQUENZ_AUTO_DEPENDABOT_APP_PRIVATE_KEY }}
65+
# Push reformatted files to the PR branch.
66+
permission-contents: write
67+
# Create and normalize migration state labels.
68+
permission-issues: write
69+
# Read/update pull request metadata and labels.
70+
permission-pull-requests: write
71+
- name: Migrate
72+
uses: frequenz-floss/gh-action-dependabot-migrate@27763fb5eb56476d91abe00132e8a0614171f92f # v1.2.0
73+
with:
74+
migration-script: |
75+
import os
76+
import subprocess
77+
import sys
78+
79+
version = os.environ["MIGRATION_VERSION"].lstrip("v")
80+
subprocess.run(
81+
[sys.executable, "-Im", "pip", "install", f"isort=={version}"],
82+
check=True,
83+
)
84+
subprocess.run([sys.executable, "-Im", "isort", "."], check=True)
85+
token: ${{ steps.create-app-token.outputs.token }}
86+
auto-merge-on-changes: "false"
87+
version-iteration: "false"
88+
sign-commits: "true"
89+
auto-merged-label: "tool:auto-merged"
90+
migrated-label: "tool:isort:migration:executed"
91+
intervention-pending-label: "tool:isort:migration:intervention-pending"
92+
intervention-done-label: "tool:isort:migration:intervention-done"

.github/workflows/repo-config-migration.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,14 @@ jobs:
5858
# Allow pushes when migration changes workflow files.
5959
permission-workflows: write
6060
- name: Migrate
61-
uses: frequenz-floss/gh-action-dependabot-migrate@eb100d3cf732b4808a7776eee8f303521efd494b # v1.2.1
61+
uses: frequenz-floss/gh-action-dependabot-migrate@27763fb5eb56476d91abe00132e8a0614171f92f # v1.2.0
6262
with:
6363
script-url-template: >-
6464
https://raw.githubusercontent.com/frequenz-floss/frequenz-repo-config-python/{version}/cookiecutter/migrate.py
6565
token: ${{ steps.create-app-token.outputs.token }}
6666
migration-token: ${{ secrets.REPO_CONFIG_MIGRATION_TOKEN }}
67+
version-iteration: "minor"
68+
if-no-iterations: "pass"
6769
sign-commits: "true"
6870
auto-merged-label: "tool:auto-merged"
6971
migrated-label: "tool:repo-config:migration:executed"

CONTRIBUTING.md

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ pytest tests/test_*.py
5050
Or you can use `nox`:
5151

5252
```sh
53-
nox -R -s pytest -- test/test_*.py
53+
nox -R -s pytest -- tests/test_*.py
5454
```
5555

5656
The same appliest to `pylint` or `mypy` for example:
5757

5858
```sh
59-
nox -R -s pylint -- test/test_*.py
60-
nox -R -s mypy -- test/test_*.py
59+
nox -R -s pylint -- tests/test_*.py
60+
nox -R -s mypy -- tests/test_*.py
6161
```
6262

6363
### Building the documentation
@@ -154,30 +154,3 @@ These are the steps to create a new release:
154154
eventually too).
155155

156156
7. Celebrate!
157-
158-
## Cross-Arch Testing
159-
160-
This project has built-in support for testing across multiple architectures.
161-
Currently, our CI conducts tests on `arm64` machines using QEMU emulation. We
162-
also have the flexibility to expand this support to include additional
163-
architectures in the future.
164-
165-
This project contains Dockerfiles that can be used in the CI to test the
166-
python package in non-native machine architectures, e.g., `arm64`. The
167-
Dockerfiles exist in the directory `.github/containers/nox-cross-arch`, and
168-
follow a naming scheme so that they can be easily used in build matrices in the
169-
CI, in `nox-cross-arch` job. The naming scheme is:
170-
171-
```
172-
<arch>-<os>-python-<python-version>.Dockerfile
173-
```
174-
175-
E.g.,
176-
177-
```
178-
arm64-ubuntu-20.04-python-3.11.Dockerfile
179-
```
180-
181-
If a Dockerfile for your desired target architecture, OS, and python version
182-
does not exist here, please add one before proceeding to add your options to
183-
the test matrix.

0 commit comments

Comments
 (0)