Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidy changelog and release process #122

Merged
merged 7 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
cd "${{ needs.check-version.outputs.package_name }}"
git checkout -b "release/version_bump_next_minor/${formatted_date}"
hatch version patch,dev
hatch run docs:changelog
hatch run changelog:add
hatch run schema
hatch run lint || hatch run lint
git config user.email "[email protected]"
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/lint-vizro-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,11 @@ jobs:
run: hatch run all.py${{ matrix.python-version }}:schema --check

- name: Check requirements for Snyk are up to date
run: |
pwd
hatch run all.py${{ matrix.python-version }}:update-snyk-requirements --check
run: hatch run all.py${{ matrix.python-version }}:update-snyk-requirements --check

- name: Find added changelog fragments
id: added-files
run: |
pwd
if ${{ github.event_name == 'pull_request' }}; then
echo "added_files=$(git diff --name-only --diff-filter=A -r HEAD^1 HEAD -- changelog.d/*.md | xargs)" >> $GITHUB_OUTPUT
else
Expand All @@ -68,9 +65,9 @@ jobs:
run: |
if [ -z "${{ steps.added-files.outputs.added_files }}" ];
then
echo "No changelog fragment .md file within changelog.d was detected. Run 'hatch run docs:changelog' to create such a fragment.";
echo "No changelog fragment .md file within changelog.d was detected. Run 'hatch run changelog:add' to create such a fragment.";
echo "If your PR contains changes that should be mentioned in the CHANGELOG in the next release, please uncomment the relevant section in your created fragment and describe the changes to the user."
echo "If your changes are not relevant for the CHANGELOG, please save and commit the file as."
echo "If your changes are not relevant for the CHANGELOG, please save and commit the file as is."
exit 1
else
echo "${{ steps.added-files.outputs.added_files }} was added - ready to go!";
Expand Down
42 changes: 42 additions & 0 deletions vizro-core/changelog.d/20231025_154920_antony.milne_scriv.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<!--
A new scriv changelog fragment.

Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Removed

- A bullet item for the Removed category.

-->
<!--
### Added

- A bullet item for the Added category.

-->
<!--
### Changed

- A bullet item for the Changed category.

-->
<!--
### Deprecated

- A bullet item for the Deprecated category.

-->
<!--
### Fixed

- A bullet item for the Fixed category.

-->
<!--
### Security

- A bullet item for the Security category.

-->
2 changes: 1 addition & 1 deletion vizro-core/docs/pages/development/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ a changelog fragment has been created in the folder `changelog.d`. This fragment
You can easily create such a fragment by running

```bash
hatch run docs:changelog
hatch run changelog:add
```

Please begin by uncommenting the relevant section(s) you wish to describe. If your PR includes changes that are not relevant to `CHANGELOG.md`, please leave everything commented out. If you are uncertain about what to add or whether to add anything, please refer to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). The rule of thumb should be, if in doubt, or if the user is affected in any way, it should be described in the `CHANGELOG.md`.
Expand Down
24 changes: 11 additions & 13 deletions vizro-core/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ matrix.python.features = [
{value = "kedro", if = ["3.8", "3.9", "3.10"]}
]

[envs.changelog]
dependencies = ["scriv"]
detached = true
scripts = {add = "scriv create --add"}

[envs.default]
dependencies = [
"devtools[pygments]",
Expand Down Expand Up @@ -37,20 +42,16 @@ cov-report = [
]
example = "cd examples/{args:default}; python app.py"
lint = "SKIP=gitleaks pre-commit run {args} --all-files"
post-release = [
"hatch version patch,dev",
"echo 'Raise a PR to bump to the new development version'"
]
antonymilne marked this conversation as resolved.
Show resolved Hide resolved
prep-release = [
"hatch version release",
"hatch run docs:scriv collect",
"hatch run changelog:scriv collect --add",
"rm -rf schemas/*json",
"hatch run schema",
"schema",
"hatch run lint || hatch run lint",
"hatch run docs:changelog",
"echo 'Raise a PR to prepare main for release'"
"hatch run changelog:add",
'echo "Now raise a PR to merge into main with title: Release of vizro-core $(hatch version)"'
]
pypath = "hatch run python -c 'import sys; print(sys.executable)'"
pypath = "python -c 'import sys; print(sys.executable)'"
schema = "python schemas/generate.py {args}"
secrets = "pre-commit run gitleaks --all-files"
test = [
Expand All @@ -77,10 +78,7 @@ dependencies = [
"scriv"
]
detached = true

[envs.docs.scripts]
changelog = "scriv create"
serve = "mkdocs serve"
scripts = {serve = "mkdocs serve"}

[publish.index]
disable = true
Expand Down