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

Improve changelog management #1058

Merged
merged 21 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ _Modifications made in this changeset do not add, remove or alter any behavior,
2. Each listed change must provide an actionable way to adapt the user’s codebase, either directly in the changelog or through instructions or links.
3. Changes are a single sentence with no punctuation (like all examples given in Common Changelog).
4. Since each release is produced automatically from a single pull request, the [notice](https://common-changelog.org/#23-notice) is always used to link to the source pull request rather than [references](https://common-changelog.org/#242-references), which would always reference the same pull request. References can instead link to relevant specific parts of an RFC, decision record or diff. This notice is automatically generated in CI by the release process.
5. The [notice](https://common-changelog.org/#23-notice) is also used to present sponsor information and it is required. Since the development of this project is funded by different actors, and following discussions with sponsors, financial contributions are acknowledged in the changelog itself. The format of the notice thus diverges from the Common Changelog specification in that it is not “a single-sentence paragraph”. Sponsor information is in quote format, starts with “Development of this release was supported by <funding_from>”, and provides the name and link to the sponsor, as well as information on the specific funding instrument, as specified by the sponsor itself or as required by law. A short message from the sponsor might also be added, as long as it abides by the community’s [Code of Conduct](./CODE_OF_CONDUCT.md) and aligns with the project’s goals.
5. The [notice](https://common-changelog.org/#23-notice) is also used to present sponsor information and it is required. Since the development of this project is funded by different actors, and following discussions with sponsors, financial contributions are acknowledged in the changelog itself. The format of the notice thus diverges from the Common Changelog specification in that it is not “a single-sentence paragraph”. Sponsor information is in quote format, starts with “Development of this release was supported by <funding_from>”, and provides the name and link to the sponsor, as well as information on the specific funding instrument, as specified by the sponsor itself or as required by law. A short message from the sponsor might also be added, as long as it abides by the community’s [Code of Conduct](./CODE_OF_CONDUCT.md) and aligns with the project’s goals. For volunteer contributions, the sentence should start with: “Development of this release was made on a volunteer basis by <contributor_name>”

## Development

Expand Down
2 changes: 1 addition & 1 deletion scripts/changelog/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import semver from 'semver';
import ChangelogValidationError from './changelogValidationError.js';

export default class Changelog {
static FUNDER_REGEX = /^> Development of this release was(.+)$/m;
static FUNDER_REGEX = /^> Development of this release (?:was supported by|was made on a volunteer basis by)(.+)\.$/m;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
static FUNDER_REGEX = /^> Development of this release (?:was supported by|was made on a volunteer basis by)(.+)\.$/m;
static FUNDER_REGEX = /^> Development of this release was (?:supported by|made on a volunteer basis by)(.+)\.$/m;

static UNRELEASED_REGEX = /## Unreleased[ ]+\[(major|minor|patch)\]/i;
static CHANGESET_LINK_REGEX = /^_Full changeset and discussions: (.+)._$/m;
static CHANGESET_LINK_TEMPLATE = PRNumber => `_Full changeset and discussions: [#${PRNumber}](https://github.com/OpenTermsArchive/engine/pull/${PRNumber})._`;
Expand Down
2 changes: 1 addition & 1 deletion scripts/changelog/changelog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Changelog', () => {

_Full changeset and discussions: #122._

> Development of this release was funded by ABC.
> Development of this release was made on a volunteer basis by a contributor.

### Added

Expand Down
4 changes: 2 additions & 2 deletions scripts/changelog/fixtures/changelog-released.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All changes that impact users of this module are documented in this file, in the

_Full changeset and discussions: #123._

> Development of this release was funded by XYZ.
> Development of this release was supported by a funder.

### Added

Expand All @@ -16,7 +16,7 @@ _Full changeset and discussions: #123._

_Full changeset and discussions: #122._

> Development of this release was funded by ABC.
> Development of this release was made on a volunteer basis by a contributor.

### Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ All changes that impact users of this module are documented in this file, in the

_Full changeset and discussions: #123._

> Development of this release was funded by XYZ.
> Development of this release was supported by a funder.

- New feature 1

## 0.0.1 - 2024-02-20

_Full changeset and discussions: #122._

> Development of this release was funded by ABC.
> Development of this release was supported by a funder.

### Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All changes that impact users of this module are documented in this file, in the

_Full changeset and discussions: #123._

> Development of this release was funded by XYZ.
> Development of this release was supported by a funder.

### Added

Expand All @@ -16,7 +16,7 @@ _Full changeset and discussions: #123._

_Full changeset and discussions: #122._

> Development of this release was funded by ABC.
> Development of this release was supported by a funder.

### Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _Modifications made in this changeset do not alter its behavior or functionality

_Full changeset and discussions: #122._

> Development of this release was funded by ABC.
> Development of this release was supported by a funder.

### Added

Expand Down
4 changes: 2 additions & 2 deletions scripts/changelog/fixtures/changelog-without-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ All changes that impact users of this module are documented in this file, in the

_Full changeset and discussions: #123._

> Development of this release was funded by XYZ.
> Development of this release was supported by a funder.

## 0.0.1 - 2024-02-20

_Full changeset and discussions: #122._

> Development of this release was funded by ABC.
> Development of this release was supported by a funder.

### Added

Expand Down
2 changes: 1 addition & 1 deletion scripts/changelog/fixtures/changelog-without-funder.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _Full changeset and discussions: #123._

_Full changeset and discussions: #122._

> Development of this release was funded by ABC.
> Development of this release was supported by a funder.

### Added

Expand Down
2 changes: 1 addition & 1 deletion scripts/changelog/fixtures/changelog-without-unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All changes that impact users of this module are documented in this file, in the

_Full changeset and discussions: #122._

> Development of this release was funded by ABC.
> Development of this release was supported by a funder.

### Added

Expand Down
4 changes: 2 additions & 2 deletions scripts/changelog/fixtures/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All changes that impact users of this module are documented in this file, in the

_Full changeset and discussions: #123._

> Development of this release was funded by XYZ.
> Development of this release was supported by a funder.

### Added

Expand All @@ -16,7 +16,7 @@ _Full changeset and discussions: #123._

_Full changeset and discussions: #122._

> Development of this release was funded by ABC.
> Development of this release was made on a volunteer basis by a contributor.

### Added

Expand Down
2 changes: 1 addition & 1 deletion scripts/changelog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ program
.option('--release [PRNumber]', 'Convert the Unreleased section into a new release in the changelog, optionally linking to a pull request with the provided PRNumber')
.option('--clean-unreleased', 'Remove the Unreleased section')
.option('--get-release-type', 'Get the release type of the Unreleased section in the changelog')
.option('--get-version-content [version]', 'Get the content of the given version in the changelog');
.option('--get-version-content <version>', 'Get the content of the given version in the changelog');

const options = program.parse(process.argv).opts();

Expand Down
Loading