Skip to content

Commit a09a130

Browse files
authored
Add missing instruction to update dependencies (#223)
When updating the version of `frequenz-api-common` dependency we also need to update the link to the inventory for cross-references in `mkdocs.yml` to point to the new version.
2 parents c293cdd + b9cc626 commit a09a130

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

RELEASE_NOTES.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To upgrade without regenerating the project, you can follow these steps:
1515
- Run the following command to add the new `pylint` ignore rules:
1616

1717
```sh
18-
sed '/ # Checked by flake8/a\ "redefined-outer-name",\n "unused-import",' pyproject.toml
18+
sed '/ # Checked by flake8/a\ "redefined-outer-name",\n "unused-import",' -i pyproject.toml
1919
```
2020

2121
- It is recommended to update this rule in your repository to use the new bypass rule for the `Protect version branches` ruleset that allows maintainers to force-merge.
@@ -54,6 +54,12 @@ To upgrade without regenerating the project, you can follow these steps:
5454
5555
This will update the file in place, you can inspect the changes with `git diff`.
5656
57+
- For API projects, you can manually add instructions to update the `mkdocs.yml` when the `frequenz-api-common` dependency is updated.
58+
59+
```sh
60+
awk -i inplace '/^sed s..frequenz-api-common/ { print; print "sed '"'"'s|https://frequenz-floss.github.io/frequenz-api-common/v[0-9].[0-9]/objects.inv|https://frequenz-floss.github.io/frequenz-api-common/v'"'"'${ver_minor}'"'"'/objects.inv|'"'"' -i mkdocs.yml"; next }1' CONTRIBUTING.md
61+
```
62+
5763
## New Features
5864
5965
<!-- Here goes the main new features and examples or instructions on how to use them -->
@@ -63,6 +69,7 @@ To upgrade without regenerating the project, you can follow these steps:
6369
- Some checks that are already performed by `flake8` are now disabled in `pylint` to avoid double reporting.
6470
- The repository ruleset `Protect version branches` has been updated to allow repository maintainers to skip protection rules in PRs.
6571
- The `labeler` action was upgraded to 5.0.0, which allows for more complex matching rules.
72+
- Instruction were added to update the `mkdocs.yml` when the `frequenz-api-common` dependency is updated.
6673
6774
## Bug Fixes
6875

cookiecutter/{{cookiecutter.github_repo_name}}/CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@ Here is an example of upgrading the `frequenz-api-common` dependency to version
7575
`v0.2.0`:
7676
```sh
7777
ver="0.2.0"
78+
ver_minor=$(echo $ver | cut -d. -f1,2)
7879

7980
cd submodules/frequenz-api-common
8081
git remote update
8182
git checkout v${ver}
8283
cd -
8384

84-
sed s/"frequenz-api-common == [0-9]\.[0-9]\.[0-9]"/"frequenz-api-common == ${ver}"/g -i pyproject.toml
85+
sed 's/frequenz-api-common == [0-9]\.[0-9]\.[0-9]/frequenz-api-common == '"${ver}/" -i pyproject.toml
86+
sed 's|https://frequenz-floss.github.io/frequenz-api-common/v[0-9]\.[0-9]/objects.inv|https://frequenz-floss.github.io/frequenz-api-common/v'${ver_minor}'/objects.inv|' -i mkdocs.yml
8587
```
8688
{%- endif %}
8789

tests_golden/integration/test_cookiecutter_generation/api/frequenz-api-test/CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,15 @@ Here is an example of upgrading the `frequenz-api-common` dependency to version
7070
`v0.2.0`:
7171
```sh
7272
ver="0.2.0"
73+
ver_minor=$(echo $ver | cut -d. -f1,2)
7374

7475
cd submodules/frequenz-api-common
7576
git remote update
7677
git checkout v${ver}
7778
cd -
7879

79-
sed s/"frequenz-api-common == [0-9]\.[0-9]\.[0-9]"/"frequenz-api-common == ${ver}"/g -i pyproject.toml
80+
sed 's/frequenz-api-common == [0-9]\.[0-9]\.[0-9]/frequenz-api-common == '"${ver}/" -i pyproject.toml
81+
sed 's|https://frequenz-floss.github.io/frequenz-api-common/v[0-9]\.[0-9]/objects.inv|https://frequenz-floss.github.io/frequenz-api-common/v'${ver_minor}'/objects.inv|' -i mkdocs.yml
8082
```
8183

8284
### Running tests / checks individually

0 commit comments

Comments
 (0)