Closed hanshasselberg closed 4 years ago
Hmm. The multiple :
in the codeblock type feels dangerous to me, and I think I'd like to avoid overloading that.
Considering these changelog entry files need to be named something anyways, and the implication for this name is that it won't be used as a link (which differs from other names), how would you feel about a convention that files with a named prefixed with .
or _
or something don't generate links in the changelog? Then your template code could work as written, or with minor tweaking to detect the prefix.
@paddycarver I haven't considered changes to the filename, but I like that.
Just to be clear, a file named .1234.txt
with this content wouldn't generate a link:
```release-note:enhancement
Added the `bar` interface.
```
Yeah, that's essentially what I'm propoosing. Technically, I think the only change we'd really need to make would be making strings.HasPrefix
available from the template, then the template could look like this:
{{- define "note" -}}
{{.Body}}{{if not stringHasPrefix .Issue "."}} [[GH-{{- .Issue -}}](https://github.com/hashicorp/consul/issues/{{- .Issue -}})]{{end}}
{{- end -}}
That way each repo can set its own convention, if they need issues that begin with .
for whatever reason.
We are starting to use
go-changelog
for Consul and there is an edgecase that I would like to solve. For changes in Consul Enterprise we don't have a PR or issue that we could link to because this repository is private. Now I am trying to find a way to generate changelog entries without a link to a PR or issue.Our current note template:
I would like it to look like this:
Displaying links should be the default, you would want to opt out manually, maybe like this:
What do you think about that?