Skip to content

Render changelog sections only if they contain content#40660

Merged
uranusjr merged 1 commit intoapache:mainfrom
amoghrajesh:changeProviderTemplate
Jul 9, 2024
Merged

Render changelog sections only if they contain content#40660
uranusjr merged 1 commit intoapache:mainfrom
amoghrajesh:changeProviderTemplate

Conversation

@amoghrajesh
Copy link
Contributor

While categorising PRs for providers, if a section didn't have any content, empty headers were rendered. This PR makes that content conditional.

Example output:

NEXT VERSION AFTER + 8.1.2
..........................

Latest change: 2024-06-27

=================================================================================================  ===========  ===========================================================
Commit                                                                                             Committed    Subject
=================================================================================================  ===========  ===========================================================
`a62bd83188 <https://github.com/apache/airflow/commit/a62bd831885957c55b073bf309bc59a1d505e8fb>`_  2024-06-27   ``Enable enforcing pydocstyle rule D213 in ruff. (#40448)``
=================================================================================================  ===========  ===========================================================

Does the provider: apache.hive have any changes apart from 'doc-only'?
Press y/N/q: y

Define the type of change for `Enable enforcing pydocstyle rule D213 in ruff. (https://github.com/apache/airflow/pull/40448)` by referring to the above table
Type of change (b)ugfix, (f)eature, (x)breaking change, (m)misc, (s)kip, (q)uit ? x

The version will be bumped because of TypeOfChange.BREAKING_CHANGE kind of change
Provider apache.hive has been classified as:

Breaking changes - bump in MAJOR version needed

Bumped version to 9.0.0

Updated source-date-epoch to 1720505379

New version of the 'apache.hive' package is ready to be released!


Do you want to leave the version for apache.hive with version: 9.0.0 as is for the release?
Press y/N/q: y
 Proceeding with provider: apache.hive version as 9.0.0
Checking for backticks correctly generated in: /Users/adesai/Documents/OSS/airflow/docs/apache-airflow-providers-apache-hive/changelog.rst
Generated /Users/adesai/Documents/OSS/airflow/docs/apache-airflow-providers-apache-hive/changelog.rst for apache.hive is OK

Generated /Users/adesai/Documents/OSS/airflow/docs/apache-airflow-providers-apache-hive/commits.rst file for the apache.hive provider

36a37,47
>
> 9.0.0
> .....
>
> Latest change: 2024-06-27
>
> =================================================================================================  ===========  ===========================================================
> Commit                                                                                             Committed    Subject
> =================================================================================================  ===========  ===========================================================
> `a62bd83188 <https://github.com/apache/airflow/commit/a62bd831885957c55b073bf309bc59a1d505e8fb>`_  2024-06-27   ``Enable enforcing pydocstyle rule D213 in ruff. (#40448)``
> =================================================================================================  ===========  ===========================================================
41c52
< Latest change: 2024-06-17
---
> Latest change: 2024-06-22
45a57
> `6e5ae26382 <https://github.com/apache/airflow/commit/6e5ae26382b328e88907e8301d4b2352ef8524c5>`_  2024-06-22   ``Prepare docs 2nd wave June 2024 (#40273)``
Checking for backticks correctly generated in: /Users/adesai/Documents/OSS/airflow/docs/apache-airflow-providers-apache-hive/commits.rst
Generated /Users/adesai/Documents/OSS/airflow/docs/apache-airflow-providers-apache-hive/commits.rst for apache.hive is OK

Updates changelog for last release of package 'apache.hive'

New version of the 'apache.hive' package is ready to be released!

***

---

***************

*** 24,33 ****

--- 24,45 ----

  ``apache-airflow-providers-apache-hive``


  Changelog
  ---------
+
+ 9.0.0
+ .....
+
+ Breaking changes
+ ~~~~~~~~~~~~~~~~
+
+ * ``Enable enforcing pydocstyle rule D213 in ruff. (#40448)``
+
+
+ .. Below changes are excluded from the changelog. Move them to
+    appropriate section above if needed. Do not delete the lines(!):

  8.1.2
  .....

  Misc
The provider apache.hive changelog for `9.0.0` version is missing. Generating fresh changelog.

Update index.rst for apache.hive


Generated /Users/adesai/Documents/OSS/airflow/docs/apache-airflow-providers-apache-hive/index.rst file for the apache.hive provider

82c82
< Release: 8.1.2
---
> Release: 9.0.0
146,147c146,147
< * `The apache-airflow-providers-apache-hive 8.1.2 sdist package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_apache_hive-8.1.2.tar.gz>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_apache_hive-8.1.2.tar.gz.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_apache_hive-8.1.2.tar.gz.sha512>`__)
< * `The apache-airflow-providers-apache-hive 8.1.2 wheel package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_apache_hive-8.1.2-py3-none-any.whl>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_apache_hive-8.1.2-py3-none-any.whl.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_apache_hive-8.1.2-py3-none-any.whl.sha512>`__)
---
> * `The apache-airflow-providers-apache-hive 9.0.0 sdist package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_apache_hive-9.0.0.tar.gz>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_apache_hive-9.0.0.tar.gz.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_apache_hive-9.0.0.tar.gz.sha512>`__)
> * `The apache-airflow-providers-apache-hive 9.0.0 wheel package <https://downloads.apache.org/airflow/providers/apache_airflow_providers_apache_hive-9.0.0-py3-none-any.whl>`_ (`asc <https://downloads.apache.org/airflow/providers/apache_airflow_providers_apache_hive-9.0.0-py3-none-any.whl.asc>`__, `sha512 <https://downloads.apache.org/airflow/providers/apache_airflow_providers_apache_hive-9.0.0-py3-none-any.whl.sha512>`__)


Summary of prepared documentation:

Success: 1

apache.hive


Successfully prepared documentation for packages!



Please review the updated files, classify the changelog entries and commit the changes.
image

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@amoghrajesh
Copy link
Contributor Author

I had seen this issue for quite some time, its quite annoying to delete these sections manually.
cc @eladkal @potiuk

@amoghrajesh amoghrajesh requested review from eladkal and removed request for ashb and jedcunningham July 9, 2024 06:14
@uranusjr uranusjr merged commit 5326dc9 into apache:main Jul 9, 2024
@potiuk
Copy link
Member

potiuk commented Jul 9, 2024

Oh yeah - it makes sense now when we classification of changes is done before generating the docs. Good call @amoghrajesh :)

romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants