Skip to content

Commit

Permalink
docs(newsfragment): add template for significant newsfragments (#44378)
Browse files Browse the repository at this point in the history
* docs(newsfragment): add template for significant newsfragments

Closes: #44374

* docs(contributing-docs): add sigificant file template description

* ci(github-actions): add script to check the news fragment content
  • Loading branch information
Lee-W authored Nov 27, 2024
1 parent faa319c commit 93bcfc2
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
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

0 comments on commit 93bcfc2

Please sign in to comment.