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

SPEC 10: Add an initial draft for a SPEC about release documentation #321

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from
129 changes: 129 additions & 0 deletions spec-0010/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
title: "SPEC 10 — Changelog"
number: 10
date: 2024-06-03
author:
- "Inessa Pawson <inessapawson@gmail.com>"
discussion: https://discuss.scientific-python.org/t/
endorsed-by:
---

## Description

SPEC 10 provides guidelines for creating and maintaining documentation related to releases
for libraries in the Scientific Python ecosystem.

### Core Project Endorsement

<!--
Briefly discuss what it means for a core project to endorse this SPEC.
-->

### Ecosystem Adoption

The endorsement of this SPEC signifies your project's support for the guidelines
laid out in the document.

## Implementation

Keeping a clear, organized, and human-readable record of notable changes for each
version of a Python library is essential for the project’s maintenance and sustainability.
It promotes transparency and trust between the project’s leadership team, developers, and users.

### What Is a Changelog?

A changelog is a file which contains a curated list of
notable changes for each version of a project.

### Guiding Principles
InessaPawson marked this conversation as resolved.
Show resolved Hide resolved

- Changelogs are meant for humans, not machines.
- Every version should have an entry.
- Group similar types of changes together.
- Make versions and sections linkable.
- List the most recent version first.
- Display the release date for each version.
- Indicate the type of release: minor, patch, pre-, ...
- Give credit to contributors. It’s a good idea to include contributions that are rarely
captured by version control systems, e.g., issue and PR triage, thoughtful feedback via comments,
community support work, etc.
- Automate the release process to the fullest extent while adhering to the guiding principles
mentioned above.

InessaPawson marked this conversation as resolved.
Show resolved Hide resolved
### Types of Changes

- **New features**: Updates that expand/improve the existing features
- **Changed**: Could be further categorized as Removed, Deprecated, and Changed
- **Fixed**: Bug fixes and security patches, could be grouped separately
- **Documentation**: Updates and improvements to the library documentation
- **Infrastructure**: Updates related to the library infrastructure and tooling
- **Maintenance**: Internal updates that do not impact users directly

### Standard Changelog Format

There is not one standard changelog format.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should at least list some that are recommended (and give reasons why they are recommended)?


ADD EXAMPLES

### Naming the Changelog File

CHANGELOG, CHANGES, HISTORY, NEWS, or RELEASES are widely accepted names for changelog files.

### GitHub Releases

GitHub offers a lot of flexibility in terms of creating release documentation.

The most common approaches are:

**1. Auto-Generated Release Notes:**

GitHub's "Auto-Generate Release Notes" feature allows automatically generate release notes that
include a list of merged pull requests, a list of contributors to the release, and a link to a
full changelog (if created).

You can also customize your automated release notes, using labels to create custom categories to
organize pull requests you want to include and exclude certain labels and users (e.g., bots) from
appearing in the output.

This approach is adopted by ADD PROJECTS

**2. Changelog-First Strategy:**

Maintaining a detailed changelog file that is referenced in the GitHub release notes.

This approach is adopted by ADD PROJECTS

**3. Combined Approach:**

Use auto-generated GitHub release notes alongside a manually maintained changelog. This provides
both details (from the automated notes) and curated insights (from the changelog). To direct users
to the curated changelog for additional information, include a note (e.g.,
"Also see changelog for more details") on top of the generated text.

This approach is adopted by ADD PROJECTS

The selected approach often depends on a project's size, the community's needs, and the maintainers'
resources and personal preferences.

For more info about releasing projects on GitHub,
refer to: https://docs.github.com/en/repositories/releasing-projects-on-github

### Automation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tools --- we have several to mention; sp/changelist, towncrier, scipy wiki, astropy (two mechanisms? @pllim @bsipocz?)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions to be used by either towncrier systems or by direct edits of a single changelog file (both approaches have legitime use cases):

https://github.com/scientific-python/action-towncrier-changelog
https://github.com/scientific-python/action-check-changelogfile

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quasi-automation: I do run cosistency checking scripts before cutting a release to ensure all PRs in a release either have a changelog, or e.g. a no-changelog-required label. So in my mind the actions are required for the PR, but in practice there is always some inconsistencies, especially when there are many people doing merges with significantly different level of tolerance towards failing CI checks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be useful to gather info from projects which use more niche workflows (like SciPy) on what stops them from moving to an automated tool, to help guide readers. There is generic dev workflow churn, but any other reasons are probably more informative.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lucascolley Yes, there are always exemptions. Could you point me to the SciPy documentation that covers this part?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a bit of documentation at https://scipy.github.io/devdocs/dev/core-dev/index.html#release-notes. We recently also introduced a "needs-release-note" tag to try to reduce the chance that PRs are missed.


TO DO
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but this document is not about releasing, but just the changelog, and thus automation for me means e.g. the github actions checking the existence of a changelog, or the changelog framework itself, e.g. creating one single changelog file from the fragments for towncrier

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my mind, generating the changelog and the release are tightly coupled and usually happens at the same time, so for any automation to happen it would be in the same file. here is an example of an automated release pipeline generated with the above docs that also generates release notes automatically: https://github.com/duckdb/dbt-duckdb/blob/master/.github/workflows/release.yml

There is also a --notes tag that lets you add custom (generated or manually entered) notes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like to have the changelog available, and complete/correct during the dev process already, it's quite useful for big projects, but I also find it somewhat useful to enforce the presence the changelog at the time a contribution is made


### Editing a Changelog

It is generally acceptable to edit a changelog for the following reasons:

- maintaining accuracy of the records about the changes in each release (e.g.,
adding essential information that was left out when the initial changelog was published)
- improving clarity and readability of the change log. Try to avoid nitpicking when
making edits to the changelog.

## Notes

<!--
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another thing @InessaPawson and I chatted about is to provide a template for a GitHub profile readme that shows OSS/Scientific Python contributions:
https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-github-profile/customizing-your-profile/managing-your-profile-readme

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guenp After giving it more thought, I wonder if this info belongs to the SPEC about release documentation. I will keep the conversation open to gather feedack from others.

Include a bulleted list of annotated links, comments,
and other ancillary information as needed.
-->