diff --git a/.github/workflows/checks-vizro-ai.yml b/.github/workflows/checks-vizro-ai.yml index 33421feed..022af1e84 100644 --- a/.github/workflows/checks-vizro-ai.yml +++ b/.github/workflows/checks-vizro-ai.yml @@ -48,10 +48,10 @@ jobs: # than a renamed version of an already-existing empty changelog file. run: | echo "changelog_fragment_added=$(git diff --name-only --no-renames --diff-filter=A HEAD^1 HEAD -- 'changelog.d/*.md' | xargs)" >> $GITHUB_OUTPUT - echo "files_outside_docs_changed=$(git diff --name-only HEAD^1 HEAD -- ':!docs' | xargs)" >> $GITHUB_OUTPUT + echo "source_code_changed=$(git diff --name-only HEAD^1 HEAD -- src | xargs)" >> $GITHUB_OUTPUT - name: Fail if changelog fragment needed and wasn't added - if: ${{ steps.changed-files.outcome != 'skipped' && steps.changed-files.outputs.files_outside_docs_changed && !steps.changed-files.outputs.changelog_fragment_added}} + if: ${{ steps.changed-files.outcome != 'skipped' && steps.changed-files.outputs.source_code_changed && !steps.changed-files.outputs.changelog_fragment_added}} run: | 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." diff --git a/.github/workflows/checks-vizro-core.yml b/.github/workflows/checks-vizro-core.yml index 334dc05f2..e04b7a31d 100644 --- a/.github/workflows/checks-vizro-core.yml +++ b/.github/workflows/checks-vizro-core.yml @@ -51,10 +51,10 @@ jobs: # than a renamed version of an already-existing empty changelog file. run: | echo "changelog_fragment_added=$(git diff --name-only --no-renames --diff-filter=A HEAD^1 HEAD -- 'changelog.d/*.md' | xargs)" >> $GITHUB_OUTPUT - echo "files_outside_docs_changed=$(git diff --name-only HEAD^1 HEAD -- ':!docs' | xargs)" >> $GITHUB_OUTPUT + echo "source_code_changed=$(git diff --name-only HEAD^1 HEAD -- src | xargs)" >> $GITHUB_OUTPUT - name: Fail if changelog fragment needed and wasn't added - if: ${{ steps.changed-files.outcome != 'skipped' && steps.changed-files.outputs.files_outside_docs_changed && !steps.changed-files.outputs.changelog_fragment_added}} + if: ${{ steps.changed-files.outcome != 'skipped' && steps.changed-files.outputs.source_code_changed && !steps.changed-files.outputs.changelog_fragment_added}} run: | 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." diff --git a/vizro-core/docs/pages/explanation/contributing.md b/vizro-core/docs/pages/explanation/contributing.md index 89efa971c..cf6e82073 100644 --- a/vizro-core/docs/pages/explanation/contributing.md +++ b/vizro-core/docs/pages/explanation/contributing.md @@ -48,7 +48,7 @@ The Hatch commands you need most commonly are as follows. These must be executed * [`hatch run pypath`](#hatch-run-pypath) shows the path to the Python interpreter. * [`hatch run example`](#hatch-run-example) runs an example dashboard on port 8050 that hot-reloads while you edit it. On GitHub Codespaces, this runs automatically on startup. * [`hatch run lint`](#hatch-run-lint) checks and fixes code quality and formatting. This is included in CI checks. -* [`hatch run changelog:add`](#hatch-run-changelogadd) generates a new changelog fragment. This is included in CI checks and required for all changes outside documentation. +* [`hatch run changelog:add`](#hatch-run-changelogadd) generates a new changelog fragment. This is included in CI checks and required for all changes to source code. * [`hatch run test-unit`](#hatch-run-test-unit) runs the test suite. This is included in CI checks. * [`hatch run docs:serve`](#hatch-run-docsserve) builds and displays documentation that hot-reloads while you edit it. Documentation is also built automatically in your PR and can be previewed on Read The Docs. * [`hatch run pip`](#hatch-run-pip) provides a [pip-compatible interface using uv](https://docs.astral.sh/uv/pip/). You should not need to use this much. @@ -97,7 +97,7 @@ Our Hatch environment specifies `pre-commit` as a dependency but otherwise does ### `hatch run changelog:add` -`hatch run changelog:add` generates a new changelog fragment. This is included in CI checks and required for all changes outside documentation. +`hatch run changelog:add` generates a new changelog fragment. This is included in CI checks and required for all changes to source code. The format of our changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). We use [scriv](https://pypi.org/project/scriv/) to build and maintain [our changelog](https://github.com/mckinsey/vizro/blob/main/vizro-core/CHANGELOG.md). When raising a PR, you must ensure that a changelog fragment has been created. This fragment is a small `.md` file describing your changes. @@ -105,7 +105,7 @@ Run `hatch run changelog:add` to create a changelog fragment and then uncomment !!! note - Changes that only affect documentation do not need a changelog fragment. This facilitates simple modifications to documentation [made directly on GitHub](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files) or with the [github.dev](https://docs.github.com/en/codespaces/the-githubdev-web-based-editor), where no terminal is available to run `hatch changelog:add`. Any changes outside documentation require a changelog fragment to be generated. If your changes do not require a changelog entry then you still need to generate the fragment but can leave it all commented out. + Changes that do not affect source code do not need a changelog fragment. This facilitates simple modifications to documentation [made directly on GitHub](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files) or with the [github.dev](https://docs.github.com/en/codespaces/the-githubdev-web-based-editor), where no terminal is available to run `hatch changelog:add`. Any changes to source code require a changelog fragment to be generated. If your changes do not require a changelog entry then you still need to generate the fragment but can leave it all commented out. ### `hatch run test-unit`