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

docs(newsfragment): add template for significant newsfragments #44378

Merged
merged 3 commits into from
Nov 27, 2024
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
25 changes: 24 additions & 1 deletion .github/workflows/news-fragment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
# needs a non-shallow clone.
fetch-depth: 0

- name: Check news fragment
- name: Check news fragment existence
run: >
python -m pip install --upgrade uv &&
uv tool run towncrier check
Expand All @@ -52,3 +52,26 @@ jobs:
&&
false
; }

- name: Check news fragment contains change types
run: >
change_types=(
'DAG changes'
'Config changes'
'API changes'
'CLI changes'
'Behaviour changes'
'Plugin changes'
'Dependency change'
)
news_fragment_content=`git diff origin/${{ github.base_ref }} newsfragments/*.significant.rst`

for type in "${change_types[@]}"; do
if [[ $news_fragment_content != *"$type"* ]]; then
printf "\033[1;33mMissing change type '$type' in significant newsfragment for PR labeled with
'airflow3.0:breaking'.\nCheck
https://github.com/apache/airflow/blob/main/contributing-docs/16_contribution_workflow.rst
for guidance.\033[m\n"
exit 1
fi
done
7 changes: 6 additions & 1 deletion contributing-docs/16_contribution_workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,12 @@ Step 4: Prepare PR
and place in either `newsfragments <https://github.com/apache/airflow/blob/main/newsfragments>`__ for core newsfragments,
or `chart/newsfragments <https://github.com/apache/airflow/blob/main/chart/newsfragments>`__ for helm chart newsfragments.

In general newsfragments must be one line. For newsfragment type ``significant``, you may include summary and body separated by a blank line, similar to ``git`` commit messages.
In general newsfragments must be one line. For newsfragment type ``significant``,
you should follow the template in ``newsfragments/template.significant.rst`` to include summary, body, change type and migrations rules needed.
This can also be done by the following command.

.. code-block:: bash
uv tool run towncrier create --dir . --config newsfragments/config.toml --content "`cat newsfragments/template.significant.rst`"
2. Rebase your fork, squash commits, and resolve all conflicts. See `How to rebase PR <#how-to-rebase-pr>`_
if you need help with rebasing your change. Remember to rebase often if your PR takes a lot of time to
Expand Down
19 changes: 19 additions & 0 deletions newsfragments/template.significant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.. Write a short and imperative summary of this changes
.. Provide additional contextual information
.. Check the type of change that applies to this change
* Types of change

* [ ] DAG changes
* [ ] Config changes
* [ ] API changes
* [ ] CLI changes
* [ ] Behaviour changes
* [ ] Plugin changes
* [ ] Dependency change

.. List the migration rules needed for this change (see https://github.com/apache/airflow/issues/41641)
* Migrations rules needed