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

Fix truncated checklist issue generation #274

Merged
merged 6 commits into from
Nov 7, 2024
Merged

Fix truncated checklist issue generation #274

merged 6 commits into from
Nov 7, 2024

Conversation

joestringer
Copy link
Member

Fix a bug where release issue templates would be truncated before posting them
to GitHub whenever they included a horizontal separator (---).

While we're at it, add tests for the templating functionality to ensure that
the templates are processed correctly to generate issues with all version
numbers substituted. Use golden tests for this (generate with make generate-golden). This also required updating the templates to match the
version substitutions supported by the checklist open command.

Review commit-by-commit.

Fixes: #256
Fixes: #261

The previous version of the code didn't expect the body of a template to
include the "---" horizontal separator, so it discarded content after
the third such separator. Fix this since we're using this mark in
templates now.

Signed-off-by: Joe Stringer <[email protected]>
This will make it easier to test the template processing.

Signed-off-by: Joe Stringer <[email protected]>
Use `X.Y.Z-pre.N` and `X.Y.Z-rc.W` so the internal substitutions work
to make the substitutions in the templates.

Signed-off-by: Joe Stringer <[email protected]>
Copy link
Contributor

@michi-covalent michi-covalent left a comment

Choose a reason for hiding this comment

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

let's do it

Add tests for the set of substitutions that should be applied to GitHub
issue templates.

Signed-off-by: Joe Stringer <[email protected]>
This test evaluates that the version substitutions in the release
templates will work correctly. The downside is that any change to
templates will require modifying both the template and the golden file.
The good thing is that this can help to detect problems where we write
the template in a way that doesn't properly apply the version string
substitutions that the tool is intended to apply.

Use 'make generate-golden' to regenerate the golden test content from
the templates.

Signed-off-by: Joe Stringer <[email protected]>
There was a bug in the checklist substitution which caused issue content
following a horizontal separator to be discarded rather than posted into
the target issue. Add a test to catch this case.

Signed-off-by: Joe Stringer <[email protected]>
@joestringer
Copy link
Member Author

(Swapped test library to testify since was already vendored)

@aanm aanm merged commit 5f044aa into main Nov 7, 2024
1 check passed
@aanm aanm deleted the pr/joe/fix-templates branch November 7, 2024 08:19
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.

Release checklist doesn't have links in it. checklist open command doesn't use the full template
3 participants