Closed ahonnecke closed 10 months ago
Hello @ahonnecke,
The CI step is erroring because the PR doesn't have a "news fragment" (aka "changenote"). Add a file named 60.misc.rst
to the changes
directory with content describing your changes; then add that file to the PR and CI will succeed for this step.
Looks like these details are missing from toga-chart's contributing documentation but it would look something like this: https://briefcase.readthedocs.io/en/stable/how-to/contribute-code.html#add-change-information-for-release-notes
@rmartin16 Thank you! would it be helpful for me to either add that to the contibuting docs, or add a pre-commit step that checks for said file? Or both?
You're welcome. A pre-commit step is probably overkill because tox -e towncrier
takes too long....and tbh, for most people from what I've seen, if they don't know a towncrier note is needed, they also probably don't have pre-commit set up for their local repo.
As for toga-chart's documentation, it probably wouldn't hurt to copy what's in Briefcase's docs....although, it looks like the docs here could use a little TLC; for instance, I see a reference to Python 3.5 and it isn't using the furo theme.
I thought that you ran pre-commit in CI. Perhaps I mis-remember but I saw it fail. Perhaps adding linting in CI would be helpful?
Correct; pre-commit does run in CI....although, as the name "pre-commit" implies, it is intended to run before the commit is made :) ideally, in the user's environment when they are creating the commit. Running pre-commit install
in the local repo directory accomplishes this.
I think that the current setup (where when someone tries to open a PR and it fails with a mystery error from town crier) could possible be improved if the PR were to fail with an error that is less obtuse. Something like "you have to add a file to the changes directory with content describing your changes"
Since pre-commit
runs in github actions, I was suggesting to add a custom step to pre-commit
that will fail with a clear error if the PR doesn't have the required changeset file.
I don't understand how "the user can run pre-commit locally" has any bearing.
I agree the error state is confusing; tbh, most people's first PR gets stuck here because they don't understand what is necessary. This is even true for the other repos that have thorough contributing docs and mention this explicitly.
That said, once you understand the error, you don't get stuck on it again later....you simply add the changenote. Given it's a one time error, the incentive for actively detecting this state and reporting it more accurately is decreased.
Although, if it could be easily detected or reported on, then a balance with the decreased incentive may be reached....but this is non-trivial to meaningfully detect and report without introducing a bunch of complicated logic that's likely to introduce a maintenance burden of its own.
Given all that....it may be worthwhile to add something to the tox
config for towncrier to drop a link to the appropriate documentation saying what's necessary when the towncrier check fails. I've considered this in the past but haven't taken the next step to actually implement it.
FYI. Proposed a more informative error for the towncrier failure: https://github.com/beeware/.github/pull/63
Describe the bug
I'm attempting to open a PR from my fork, and it is failing on a no-op in the towncrier step.
https://github.com/beeware/toga-chart/pull/60
Steps to reproduce
Expected behavior
CI completes successfully.
Screenshots
Environment
Logs
Additional context
No response