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

Default check branch should be "origin/main" #400

Merged
merged 9 commits into from
Aug 31, 2022

Conversation

saroad2
Copy link
Contributor

@saroad2 saroad2 commented Aug 16, 2022

Description

In the past few years the use of the terminology "master" as the main branch is no longer acceptable.
GIthub, along with other companies, use the word "main" instead, so the main branch is called "origin/main".

With that spirit, I changed the default check branch for the towncrier check command to be "origin/main".

Checklist

  • Make sure changes are covered by existing or new tests.
  • For at least one Python version, make sure local test run is green.
  • Create a file in src/towncrier/newsfragments/. Describe your
    change and include important information. Your change will be included in the public release notes.
  • Make sure all GitHub Actions checks are green (they are automatically checking all of the above).

@codecov
Copy link

codecov bot commented Aug 16, 2022

Codecov Report

Merging #400 (affa1a2) into trunk (6525465) will increase coverage by 0.05%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##            trunk     #400      +/-   ##
==========================================
+ Coverage   97.85%   97.91%   +0.05%     
==========================================
  Files          22       22              
  Lines        1400     1440      +40     
  Branches      130      135       +5     
==========================================
+ Hits         1370     1410      +40     
  Misses         15       15              
  Partials       15       15              
Impacted Files Coverage Δ
src/towncrier/check.py 95.45% <100.00%> (+1.33%) ⬆️
src/towncrier/test/test_check.py 99.34% <100.00%> (+0.12%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@adiroiban
Copy link
Member

Thanks for the PR.

I am not a fan of "origin/master" but this change will break backward compatibility.

If we are going to push this, we need a big warning as part of the release notes.
I don't think that a .misc is enough.

What I can think of, is creating a different command, other than 'check' that can be used by new users.

Maybe it can be called "verify".
It will do the same thing as check, but using origin/master as the default.

And emit a deprecation warning when the "check" command is used.

I know that this is a lot of trouble ... so I don't know.

This is about pleasing new users vs adding extra work for existing users.

I would say that is easier for a new user to explicitly add the branch, than for an existing user to have a process failing, after years in which all was ok.

So I don't know. I am not +1 for this.

@altendky @hynek sorry for the noise.
Can you help see if this PR should be merged?

A +1 or -1 should be enough. No need for extra arguments.

Thanks!

@saroad2
Copy link
Contributor Author

saroad2 commented Aug 16, 2022

This PR is not about pleasing new users. It is about that "master" is an offensive word against a lot of communities around the world. This word needs to be removed from our terminology as programmers and people.

The change is easy: for now, we can keep using the "origin/master" as the default check branch, but add a deprecation warning that in the next major version it will be changed to "origin/main".
When you publish the next major version, replace "origin/master" with "origin/main".

A new towncrier verify command is a bad idea. No need for 2 commands that do the same thing.

As for the news fragment type, what would be a better option than "misc"? "feature"?

@hynek
Copy link
Member

hynek commented Aug 16, 2022

How about checking if main exists, falling back to master (with deprecation warning)?

@altendky
Copy link
Member

To satisfy the requested boolean response to the PR as is... 👎 but I also feels that's unnecessarily negative about making some change here.

The hazards described about just changing this make sense so I think we should at least think through possibilities to improve it, as we are. The fallback idea seems reasonable. Is there a way we can make it a generally useful thing instead of being exclusively for dealing with the old and new git defaults? Would it being a list be sensible and... also useful for... there has to be another use case. :]

Or maybe it really is simplest and cleanest to not migrate towards more complex but rather to just migrate to no default. You are required to either specify the option or set it in the config. Or, option wins if specified and falls back to the config. If we need to get rid of the word then we can do so by just removing the default someday without picking a new winner. I guess the action in this case would be 1) deprecate calling check without either the option or config entry and then 2) at some point remove the default.

The news fragment can be figured out once we decide the path forward.

@adiroiban
Copy link
Member

Many thanks for your feedback.

I am happy to see "origin/main" as the new default, with "origin/master" as a fallback.
I know it's more work... and maybe it doesn't help, as the original intention was to purge the concept of "master".

I like zero configuration / it just works (tm) so... but towncrier is something that you set up once in your CI or Makefile or buildtool and forget about it...so always requiring to pass the compare branch, is not a big deal... but maybe "origin/main" as default with fallback to "origin/master" is less work.

This can go with a ".removal" (Removal and deprecation) release note.

If you have both "origin/main" and "origin/master" you might not get what you want with the default behaviour.


for any new repo I go with "origin/main" and switch existing when feasible.

I was the one switching towncrier from "origin/master" to "origin/trunk" as the main branch.

But for this PR, I think that we need at least a ".removal" note and fallback to "origin/master" to not generate unnecessarily extra work for end users.

@hynek
Copy link
Member

hynek commented Aug 17, 2022

My second take would've been also to remove the default altogether. Everybody who has main already has to pass it anyway.

It would be nice if it could become a config option.

@adiroiban
Copy link
Member

Thanks @saroad2 for the updates. Let us know when this is ready for review.

As long as the non-code coverage tests are green, I think that this should be ready for merge.

Having some automated tests would be great, but at this point, since towncrier has very few contributors, I would leave the automated tests as options.

It is sad that we can't block a PR on missing automated tests, but I think that for open source project this is the right thing to do.

If people care about preventing regressions, then this is open source and anyone can submit automated tests to help reduce the regressions.

If someone cares enough for a feature and doesn't want that functionality to fail in the future, a set of automated test should be provided.
If someone sends a PR without tests, it should expect and plan that functionality might stop working in future releases.

@adiroiban
Copy link
Member

there is a conflict, since I have merged another PR in which the help text for the CLI is extended

# Conflicts:
#	src/towncrier/check.py
@saroad2
Copy link
Contributor Author

saroad2 commented Aug 22, 2022

Hey @adiroiban .

So I merged trunk into this branch and fixed the conflicts.

As for testing, it is impossible to test the new behavior with the current way the tests are written. As for now, we test the towncrier check command by creating an actual git repository and validating what's happening when comparing with a branch. This repository has no origin remote, so I cannot test the fallback to origin/main or origin/master.

There are 2 things we can do:

  1. Leave the new feature untested, since we cannot test it with the current way the tests are written
  2. Rewrite the towncrier check tests to use stubs (aka. mocks) to replace the usage of a real git repository.

If we choose option 2, I'll open a new PR just for that.

@hynek
Copy link
Member

hynek commented Aug 22, 2022

Wouldn’t it be possible/simpler to add an origin?

@saroad2
Copy link
Contributor Author

saroad2 commented Aug 22, 2022

Hey @hynek ,

It will be possible to do that, but it won't be simpler because now I have to create 2 repositories for each test and define one of them as origin.
This makes the code messier and longer. I think using stubs is the right way to go.

Your choice. If you want to keep the usage of real git, I'll write the new tests

@adiroiban
Copy link
Member

I guess that the existing tests can be left as they are now.

A new tests can be added with its own setup and repo.
I guess that having a remote that is a local path is ok and all operation should work

git remote add origin /temp/path/to/test/git/origin/repo/.git

@adiroiban
Copy link
Member

@saroad2 let me know if you want to have the PR merged without tests or I should wait for the tests.

@saroad2
Copy link
Contributor Author

saroad2 commented Aug 29, 2022

Hey @adiroiban ,

I'm a little bit preoccupied right now, so I won't have time soon to add the unit tests.
If you want, you can edit this PR and add the relevant tests.

@hynek hynek requested a review from a team as a code owner August 31, 2022 13:31
@hynek
Copy link
Member

hynek commented Aug 31, 2022

So it seems indeed to be problematic to just add non-existent origin branches, so I've implemented it using monkeypatching. I'll look at the other missing coverage next time I have time.

@hynek
Copy link
Member

hynek commented Aug 31, 2022

Looks like I already caught them all!

Copy link
Member

@adiroiban adiroiban left a comment

Choose a reason for hiding this comment

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

Ok. Thanks.

let's merge it.
I don't have time to run manual tests for this.
I hope all is ok.

if there are any issues, we can come back and fix it and write better tests if required.

@adiroiban adiroiban merged commit 672eca3 into twisted:trunk Aug 31, 2022
@saroad2 saroad2 deleted the change_default_check_branch branch September 4, 2022 08:09
acabarbaye pushed a commit to ARMmbed/continuous-delivery-scripts that referenced this pull request Dec 22, 2022
Bumps [towncrier](https://github.com/twisted/towncrier) from 22.8.0 to
22.12.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/twisted/towncrier/releases">towncrier's
releases</a>.</em></p>
<blockquote>
<h2>Towncrier 22.12.0</h2>
<h1>towncrier 22.12.0 (2022-12-21)</h1>
<h2>Features</h2>
<ul>
<li>
<p>Added <code>--keep</code> option to the <code>build</code> command
that allows generating a newsfile, but keeps the newsfragments in place.
This option can not be used together with <code>--yes</code>.
(<code>[#129](twisted/towncrier#129)
&lt;https://github.com/hawkowl/towncrier/issues/129&gt;</code>_)</p>
</li>
<li>
<p>Python 3.11 is now officially supported.
(<code>[#427](twisted/towncrier#427)
&lt;https://github.com/hawkowl/towncrier/issues/427&gt;</code>_)</p>
</li>
<li>
<p>You can now create fragments that are not associated with issues.
Start the name of the fragment with <code>+</code> (e.g.
<code>+anything.feature</code>).
The content of these orphan news fragments will be included in the
release notes, at the end of the category corresponding to the file
extension.</p>
<p>To help quickly create a unique orphan news fragment, <code>towncrier
create +.feature</code> will append a random string to the base name of
the file, to avoid name collisions.
(<code>[#428](twisted/towncrier#428)
&lt;https://github.com/hawkowl/towncrier/issues/428&gt;</code>_)</p>
</li>
</ul>
<h2>Improved Documentation</h2>
<ul>
<li>Improved contribution documentation.
(<code>[#415](twisted/towncrier#415)
&lt;https://github.com/hawkowl/towncrier/issues/415&gt;</code>_)</li>
<li>Correct a typo in the readme that incorrectly documented custom
fragments in a format that does not work.
(<code>[#424](twisted/towncrier#424)
&lt;https://github.com/hawkowl/towncrier/issues/424&gt;</code>_)</li>
<li>The documentation has been restructured and (hopefully) improved.
(<code>[#435](twisted/towncrier#435)
&lt;https://github.com/hawkowl/towncrier/issues/435&gt;</code>_)</li>
<li>Added a Markdown-based how-to guide.
(<code>[#436](twisted/towncrier#436)
&lt;https://github.com/hawkowl/towncrier/issues/436&gt;</code>_)</li>
<li>Defining custom fragments using a TOML array is not deprecated
anymore. (<code>[#438](twisted/towncrier#438)
&lt;https://github.com/hawkowl/towncrier/issues/438&gt;</code>_)</li>
</ul>
<h2>Deprecations and Removals</h2>
<ul>
<li>Default branch for <code>towncrier check</code> is now
&quot;origin/main&quot; instead of &quot;origin/master&quot;.
If &quot;origin/main&quot; does not exist, fallback to
&quot;origin/master&quot; with a deprecation warning.
(<code>[#400](twisted/towncrier#400)
&lt;https://github.com/hawkowl/towncrier/issues/400&gt;</code>_)</li>
</ul>
<h2>22.12.0rc1</h2>
<h1>towncrier 22.12.0rc1 (2022-12-20)</h1>
<h2>Features</h2>
<ul>
<li>
<p>Added <code>--keep</code> option to the <code>build</code> command
that allows generating a newsfile, but keeps the newsfragments in place.
This option can not be used together with <code>--yes</code>.
(<code>[#129](twisted/towncrier#129)
&lt;https://github.com/hawkowl/towncrier/issues/129&gt;</code>_)</p>
</li>
<li>
<p>Python 3.11 is now officially supported.
(<code>[#427](twisted/towncrier#427)
&lt;https://github.com/hawkowl/towncrier/issues/427&gt;</code>_)</p>
</li>
<li>
<p>You can now create fragments that are not associated with issues.
Start the name of the fragment with <code>+</code> (e.g.
<code>+anything.feature</code>).
The content of these orphan news fragments will be included in the
release notes, at the end of the category corresponding to the file
extension.</p>
<p>To help quickly create a unique orphan news fragment, <code>towncrier
create +.feature</code> will append a random string to the base name of
the file, to avoid name collisions.
(<code>[#428](twisted/towncrier#428)
&lt;https://github.com/hawkowl/towncrier/issues/428&gt;</code>_)</p>
</li>
</ul>
<h2>Improved Documentation</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/twisted/towncrier/blob/trunk/NEWS.rst">towncrier's
changelog</a>.</em></p>
<blockquote>
<h1>towncrier 22.12.0 (2022-12-21)</h1>
<p>No changes since the previous release candidate.</p>
<h1>towncrier 22.12.0rc1 (2022-12-20)</h1>
<h2>Features</h2>
<ul>
<li>
<p>Added <code>--keep</code> option to the <code>build</code> command
that allows generating a newsfile, but keeps the newsfragments in place.
This option can not be used together with <code>--yes</code>.
(<code>[#129](twisted/towncrier#129)
&lt;https://github.com/hawkowl/towncrier/issues/129&gt;</code>_)</p>
</li>
<li>
<p>Python 3.11 is now officially supported.
(<code>[#427](twisted/towncrier#427)
&lt;https://github.com/hawkowl/towncrier/issues/427&gt;</code>_)</p>
</li>
<li>
<p>You can now create fragments that are not associated with issues.
Start the name of the fragment with <code>+</code> (e.g.
<code>+anything.feature</code>).
The content of these orphan news fragments will be included in the
release notes, at the end of the category corresponding to the file
extension.</p>
<p>To help quickly create a unique orphan news fragment, <code>towncrier
create +.feature</code> will append a random string to the base name of
the file, to avoid name collisions.
(<code>[#428](twisted/towncrier#428)
&lt;https://github.com/hawkowl/towncrier/issues/428&gt;</code>_)</p>
</li>
</ul>
<h2>Improved Documentation</h2>
<ul>
<li>Improved contribution documentation.
(<code>[#415](twisted/towncrier#415)
&lt;https://github.com/hawkowl/towncrier/issues/415&gt;</code>_)</li>
<li>Correct a typo in the readme that incorrectly documented custom
fragments in a format that does not work.
(<code>[#424](twisted/towncrier#424)
&lt;https://github.com/hawkowl/towncrier/issues/424&gt;</code>_)</li>
<li>The documentation has been restructured and (hopefully) improved.
(<code>[#435](twisted/towncrier#435)
&lt;https://github.com/hawkowl/towncrier/issues/435&gt;</code>_)</li>
<li>Added a Markdown-based how-to guide.
(<code>[#436](twisted/towncrier#436)
&lt;https://github.com/hawkowl/towncrier/issues/436&gt;</code>_)</li>
<li>Defining custom fragments using a TOML array is not deprecated
anymore. (<code>[#438](twisted/towncrier#438)
&lt;https://github.com/hawkowl/towncrier/issues/438&gt;</code>_)</li>
</ul>
<h2>Deprecations and Removals</h2>
<ul>
<li>Default branch for <code>towncrier check</code> is now
&quot;origin/main&quot; instead of &quot;origin/master&quot;.
If &quot;origin/main&quot; does not exist, fallback to
&quot;origin/master&quot; with a deprecation warning.
(<code>[#400](twisted/towncrier#400)
&lt;https://github.com/hawkowl/towncrier/issues/400&gt;</code>_)</li>
</ul>
<h2>Misc</h2>
<ul>
<li><code>[#406](twisted/towncrier#406)
&lt;https://github.com/hawkowl/towncrier/issues/406&gt;</code><em>,
<code>[#408](twisted/towncrier#408)
&lt;https://github.com/hawkowl/towncrier/issues/408&gt;</code></em>,
<code>[#411](twisted/towncrier#411)
&lt;https://github.com/hawkowl/towncrier/issues/411&gt;</code><em>,
<code>[#412](twisted/towncrier#412)
&lt;https://github.com/hawkowl/towncrier/issues/412&gt;</code></em>,
<code>[#413](twisted/towncrier#413)
&lt;https://github.com/hawkowl/towncrier/issues/413&gt;</code><em>,
<code>[#414](twisted/towncrier#414)
&lt;https://github.com/hawkowl/towncrier/issues/414&gt;</code></em>,
<code>[#416](twisted/towncrier#416)
&lt;https://github.com/hawkowl/towncrier/issues/416&gt;</code><em>,
<code>[#418](twisted/towncrier#418)
&lt;https://github.com/hawkowl/towncrier/issues/418&gt;</code></em>,
<code>[#419](twisted/towncrier#419)
&lt;https://github.com/hawkowl/towncrier/issues/419&gt;</code><em>,
<code>[#421](twisted/towncrier#421)
&lt;https://github.com/hawkowl/towncrier/issues/421&gt;</code></em>,
<code>[#429](twisted/towncrier#429)
&lt;https://github.com/hawkowl/towncrier/issues/429&gt;</code><em>,
<code>[#430](twisted/towncrier#430)
&lt;https://github.com/hawkowl/towncrier/issues/430&gt;</code></em>,
<code>[#431](twisted/towncrier#431)
&lt;https://github.com/hawkowl/towncrier/issues/431&gt;</code><em>,
<code>[#434](twisted/towncrier#434)
&lt;https://github.com/hawkowl/towncrier/issues/434&gt;</code></em>,
<code>[#446](twisted/towncrier#446)
&lt;https://github.com/hawkowl/towncrier/issues/446&gt;</code><em>,
<code>[#447](twisted/towncrier#447)
&lt;https://github.com/hawkowl/towncrier/issues/447&gt;</code></em></li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/twisted/towncrier/commit/b0e201f8d84819f0e5604e0cb029fb3b8b4cf2df"><code>b0e201f</code></a>
RST is hard.</li>
<li><a
href="https://github.com/twisted/towncrier/commit/2c611bebcd3c7661bd406d227aadf3b72d2927de"><code>2c611be</code></a>
Fix rst format.</li>
<li><a
href="https://github.com/twisted/towncrier/commit/76a20070cc57f00eedca2cac5551a5b2cbf9d0f4"><code>76a2007</code></a>
Fix typo.</li>
<li><a
href="https://github.com/twisted/towncrier/commit/62feaf664badc09f0082185c4950876a521f019e"><code>62feaf6</code></a>
Update version for final release.</li>
<li><a
href="https://github.com/twisted/towncrier/commit/fbc4f1f25570a8406c88a4da4a75ce745631b4d2"><code>fbc4f1f</code></a>
Quick fix for incremental rc version normalization.</li>
<li><a
href="https://github.com/twisted/towncrier/commit/26a5eba8116df4516c646c748a51bbbfdb3fe50c"><code>26a5eba</code></a>
Try latest incremental since a test is failing.</li>
<li><a
href="https://github.com/twisted/towncrier/commit/7cbec75915dafc43471b27e2179767b3cf49d982"><code>7cbec75</code></a>
Create rc1.</li>
<li><a
href="https://github.com/twisted/towncrier/commit/3859e58402986c181faa7f09c846b0873c62fb86"><code>3859e58</code></a>
[pre-commit.ci] pre-commit autoupdate (<a
href="https://github-redirect.dependabot.com/twisted/towncrier/issues/452">#452</a>)</li>
<li><a
href="https://github.com/twisted/towncrier/commit/341897512d8ffcbafbeac9dabc6e524523a22c34"><code>3418975</code></a>
Revert Generate coverage reports using only GitHub Actions (<a
href="https://github-redirect.dependabot.com/twisted/towncrier/issues/455">#455</a>)</li>
<li><a
href="https://github.com/twisted/towncrier/commit/24f65a0ed18c5d9b875e8f3e4334fd18945add06"><code>24f65a0</code></a>
Add --keep option to allow to generate newsfile, but keep newsfragmen…
(<a
href="https://github-redirect.dependabot.com/twisted/towncrier/issues/453">#453</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/twisted/towncrier/compare/22.8.0...22.12.0">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=towncrier&package-manager=pip&previous-version=22.8.0&new-version=22.12.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Monty Bot <monty-bot@arm.com>
wip-sync referenced this pull request in NetBSD/pkgsrc-wip May 5, 2023
towncrier 22.12.0 (2022-12-21)
==============================

No changes since the previous release candidate.

towncrier 22.12.0rc1 (2022-12-20)
=================================

Features
--------

- Added ``--keep`` option to the ``build`` command that allows generating a newsfile, but keeps the newsfragments in place.
  This option can not be used together with ``--yes``. (`#129 <https://github.com/hawkowl/towncrier/issues/129>`_)
- Python 3.11 is now officially supported. (`#427 <https://github.com/hawkowl/towncrier/issues/427>`_)
- You can now create fragments that are not associated with issues. Start the name of the fragment with ``+`` (e.g. ``+anything.feature``).
  The content of these orphan news fragments will be included in the release notes, at the end of the category corresponding to the file extension.

  To help quickly create a unique orphan news fragment, ``towncrier create +.feature`` will append a random string to the base name of the file, to avoid name collisions. (`#428 <https://github.com/hawkowl/towncrier/issues/428>`_)

Improved Documentation
----------------------

- Improved contribution documentation. (`#415 <https://github.com/hawkowl/towncrier/issues/415>`_)
- Correct a typo in the readme that incorrectly documented custom fragments in a format that does not work. (`#424 <https://github.com/hawkowl/towncrier/issues/424>`_)
- The documentation has been restructured and (hopefully) improved. (`#435 <https://github.com/hawkowl/towncrier/issues/435>`_)
- Added a Markdown-based how-to guide. (`#436 <https://github.com/hawkowl/towncrier/issues/436>`_)
- Defining custom fragments using a TOML array is not deprecated anymore. (`#438 <https://github.com/hawkowl/towncrier/issues/438>`_)

Deprecations and Removals
-------------------------

- Default branch for `towncrier check` is now "origin/main" instead of "origin/master".
  If "origin/main" does not exist, fallback to "origin/master" with a deprecation warning. (`#400 <https://github.com/hawkowl/towncrier/issues/400>`_)

Misc
----

- `#406 <https://github.com/hawkowl/towncrier/issues/406>`_, `#408 <https://github.com/hawkowl/towncrier/issues/408>`_, `#411 <https://github.com/hawkowl/towncrier/issues/411>`_, `#412 <https://github.com/hawkowl/towncrier/issues/412>`_, `#413 <https://github.com/hawkowl/towncrier/issues/413>`_, `#414 <https://github.com/hawkowl/towncrier/issues/414>`_, `#416 <https://github.com/hawkowl/towncrier/issues/416>`_, `#418 <https://github.com/hawkowl/towncrier/issues/418>`_, `#419 <https://github.com/hawkowl/towncrier/issues/419>`_, `#421 <https://github.com/hawkowl/towncrier/issues/421>`_, `#429 <https://github.com/hawkowl/towncrier/issues/429>`_, `#430 <https://github.com/hawkowl/towncrier/issues/430>`_, `#431 <https://github.com/hawkowl/towncrier/issues/431>`_, `#434 <https://github.com/hawkowl/towncrier/issues/434>`_, `#446 <https://github.com/hawkowl/towncrier/issues/446>`_, `#447 <https://github.com/hawkowl/towncrier/issues/447>`_

towncrier 22.8.0 (2022-08-29)
=============================

No significant changes since the previous release candidate.

towncrier 22.8.0.rc1 (2022-08-28)
=================================

Features
--------

- Make the check subcommand succeed for branches that change the news file

  This should enable the ``check`` subcommand to be used as a CI lint step and
  not fail when a pull request only modifies the configured news file (i.e. when
  the news file is being assembled for the next release). (`#337 <https://github.com/hawkowl/towncrier/issues/337>`_)
- Added support to tables in toml settings, which provides a more intuitive
  way to configure custom types. (`#369 <https://github.com/hawkowl/towncrier/issues/369>`_)
- The `towncrier create` command line now has a new `-m TEXT` argument that is used to define the content of the newly created fragment. (`#374 <https://github.com/hawkowl/towncrier/issues/374>`_)

Bugfixes
--------

- The extra newline between the title and rendered content when using ``--draft`` is no longer inserted. (`#105 <https://github.com/hawkowl/towncrier/issues/105>`_)
- The detection of duplicate release notes was fixed and recording changes of same version is no longer triggered.

  Support for having the release notes for each version in a separate file is working again. This is a regression introduced in VERSION 19.9.0rc1. (`#391 <https://github.com/hawkowl/towncrier/issues/391>`_)

Improved Documentation
----------------------

- Improve ``CONTRIBUTING.rst`` and add PR template. (`#342 <https://github.com/hawkowl/towncrier/issues/342>`_)
- Move docs too the main branch and document custom fragment types. (`#367 <https://github.com/hawkowl/towncrier/issues/367>`_)
- The CLI help messages were updated to contain more information. (`#384 <https://github.com/hawkowl/towncrier/issues/384>`_)

Deprecations and Removals
-------------------------

- Support for all Python versions older than 3.7 has been dropped. (`#378 <https://github.com/hawkowl/towncrier/issues/378>`_)

Misc
----

- `#292 <https://github.com/hawkowl/towncrier/issues/292>`_, `#330 <https://github.com/hawkowl/towncrier/issues/330>`_, `#366 <https://github.com/hawkowl/towncrier/issues/366>`_, `#376 <https://github.com/hawkowl/towncrier/issues/376>`_, `#377 <https://github.com/hawkowl/towncrier/issues/377>`_, `#380 <https://github.com/hawkowl/towncrier/issues/380>`_, `#381 <https://github.com/hawkowl/towncrier/issues/381>`_, `#382 <https://github.com/hawkowl/towncrier/issues/382>`_, `#383 <https://github.com/hawkowl/towncrier/issues/383>`_, `#393 <https://github.com/hawkowl/towncrier/issues/393>`_, `#399 <https://github.com/hawkowl/towncrier/issues/399>`_, `#402 <https://github.com/hawkowl/towncrier/issues/402>`_

towncrier 21.9.0 (2022-02-04)
=============================

Features
--------

- towncrier --version` was added to the command line interface to show the product version. (`#339 <https://github.com/hawkowl/towncrier/issues/339>`_)
- Support Toml v1 syntax with tomli on Python 3.6+ (`#354 <https://github.com/hawkowl/towncrier/issues/354>`_)

Bugfixes
--------

- Stop writing title twice when ``title_format`` is specified. (`#346 <https://github.com/hawkowl/towncrier/issues/346>`_)
- Disable universal newlines when reading TOML (`#359 <https://github.com/hawkowl/towncrier/issues/359>`_)

Misc
----

- `#332 <https://github.com/hawkowl/towncrier/issues/332>`_, `#333 <https://github.com/hawkowl/towncrier/issues/333>`_, `#334 <https://github.com/hawkowl/towncrier/issues/334>`_, `#338 <https://github.com/hawkowl/towncrier/issues/338>`_

towncrier 21.3.0 (2021-04-02)
=============================

No significant changes since the previous release candidate.

towncrier 21.3.0.rc1 (2021-03-21)
=================================

Features
--------

- Ticket number from file names will be stripped down to avoid ticket links such as ``#7``. (`#126 <https://github.com/hawkowl/towncrier/issues/126>`_)
- Allow definition of the project ``version`` and ``name`` in the configuration file.
  This allows use of towncrier seamlessly with non-Python projects. (`#165 <https://github.com/hawkowl/towncrier/issues/165>`_)
- Improve news fragment file name parsing to allow using file names like
  ``123.feature.1.ext`` which are convenient when one wants to use an appropriate
  extension (e.g. ``rst``, ``md``) to enable syntax highlighting. (`#173 <https://github.com/hawkowl/towncrier/issues/173>`_)
- The new ``--edit`` option of the ``create`` subcommand launches an editor for entering the contents of the newsfragment. (`#275 <https://github.com/hawkowl/towncrier/issues/275>`_)
- CPython 3.8 and 3.9 are now part of our automated test matrix and are officially supported. (`#291 <https://github.com/hawkowl/towncrier/issues/291>`_)
- When searching for the project, first check for an existing importable instance.
  This helps if the version is only available in the installed version and not the source. (`#297 <https://github.com/hawkowl/towncrier/issues/297>`_)
- Support building with PEP 517. (`#314 <https://github.com/hawkowl/towncrier/issues/314>`_)

Bugfixes
--------

- Configuration errors found during command line execution now trigger a message to stderr and no longer show a traceback. (`#84 <https://github.com/hawkowl/towncrier/issues/84>`_)
- A configuration error is triggered when the newsfragment files couldn't be discovered. (`#85 <https://github.com/hawkowl/towncrier/issues/85>`_)
- Invoking towncrier as `python -m towncrier` works. (`#163 <https://github.com/hawkowl/towncrier/issues/163>`_)
- ``check`` subcommand defaults to UTF-8 encoding when ``sys.stdout.encoding`` is ``None``.
  This happens, for example, with Python 2 on GitHub Actions or when the output is piped. (`#175 <https://github.com/hawkowl/towncrier/issues/175>`_)
- Specifying ``title_format`` disables default top line creation to avoid duplication. (`#180 <https://github.com/hawkowl/towncrier/issues/180>`_)

Improved Documentation
----------------------

- The README now mentions the possibility to name the configuration file
  ``towncrier.toml`` (in addition to ``pyproject.toml``). (`#172 <https://github.com/hawkowl/towncrier/issues/172>`_)
- ``start_line`` corrected to ``start_string`` in the readme to match the long standing implementation. (`#277 <https://github.com/hawkowl/towncrier/issues/277>`_)

towncrier 19.9.0 (2021-03-20)
=============================

No significant changes.

towncrier 19.9.0rc1 (2019-09-16)
================================

Features
--------

- Add ``create`` subcommand, which can be used to quickly create a news
  fragment command in the location defined by config. (`#4 <https://github.com/hawkowl/towncrier/issues/4>`_)
- Add support for subcommands, meaning the functionality of the ``towncrier``
  executable is now replaced by the ``build`` subcommand::

      $ towncrier build --draft

  A new ``check`` subcommand is exposed. This is an alternative to calling the
  ``towncrier.check`` module manually::

      $ towncrier check

  Calling ``towncrier`` without a subcommand will result in a call to the
  ``build`` subcommand to ensure backwards compatibility. This may be removed in a
  future release. (`#144 <https://github.com/hawkowl/towncrier/issues/144>`_)
- Towncrier's templating now allows configuration of the version header. *CUSTOM TEMPLATE USERS PLEASE NOTE: You will need to add the version header information to your template!* (`#147 <https://github.com/hawkowl/towncrier/issues/147>`_)
- towncrier now accepts the --config argument to specify a custom configuration file (`#157 <https://github.com/hawkowl/towncrier/issues/157>`_)
- There is now the option for ``all_bullets = false`` in the configuration.
  Setting ``all_bullets`` to false means that news fragments have to include
  the bullet point if they should be rendered as enumerations, otherwise
  they are rendered directly (this means fragments can include a header.).
  It is necessary to set this option to avoid (incorrect) automatic indentation
  of multiline fragments that do not include bullet points.
  The ``single-file-no-bullets.rst`` template gives an example of
  using these options. (`#158 <https://github.com/hawkowl/towncrier/issues/158>`_)
- The ``single_file`` option can now be added to the configuration file. When set to ``true``, the filename key can now be formattable with the ``name``, ``version``, and ``project_date`` format variables. This allows subsequent versions to be written out to new files instead of appended to an existing one. (`#161 <https://github.com/hawkowl/towncrier/issues/161>`_)
- You can now specify Towncrier-bundled templates in your configuration file. Available templates are `default`, `hr-between-versions` (as used in attrs), and `single-file-no-bullets`. (`#162 <https://github.com/hawkowl/towncrier/issues/162>`_)

Bugfixes
--------

- Accept newsfragment filenames with multiple dots, like `fix-1.2.3.bugfix`. (`#142 <https://github.com/hawkowl/towncrier/issues/142>`_)

Deprecations and Removals
-------------------------

- The `--pyproject` option for `towncrier check` is now replaced with `--config`, for consistency with other commands. (`#162 <https://github.com/hawkowl/towncrier/issues/162>`_)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants