-
Notifications
You must be signed in to change notification settings - Fork 5
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
Always include end of commit range #107
Conversation
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
|
||
pushd repos/v0.1.0-dev-repo | ||
|
||
git config --local user.email "nope@nope.com" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: nope.com
is a real domain name that resolves. (I don't know what's there; I just checked the NS lookup). Should we instead use fake@example.com
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can make that update, but that affects more than just these new fixtures. Can we follow up with another PR that makes that adjustment universally? (I don't see a direct impact here so will leave these values as is for now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely ok with splitting it up. I don't think this is super urgent, since we're never going to actually email these folks, but I remember hearing that the owners of test.com
or similar are very tired of getting bot spam from everyone's QA accounts, and example.com
is the canonical valid domain name that no one uses.
require.NoError(t, err) | ||
|
||
// ensure that the times are sourced similarly... but the real values don't need to be under test | ||
gitter = mockGitter{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This reassignment and naming confused me a little bit. It looks like you make a real gitter, and a mock gitter, but the mock gitter has a pointer to the real gitter, and you can assign either the mock or real gitter to a variable called gitter
. Maybe the comment here could be rephrased, or one of the gitter
vars could get a different name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the comment, using the same name is intentional: any usage of the unmocked gitter would be invalid from that point forward.
type changePoint struct { | ||
Ref string | ||
Tag *git.Tag | ||
Inclusive bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to make sure I understand here. Inclusive
means "the changelog should include this point"? And then below, when we generate a changelog that includes the first commit in the repo, we need to emit an inclusive change point (because the first commit is part of the first release), but subsequent releases, where we're asking for something like "commits since the tag v0.5.1", we should make an exclusive range. Is that right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's 100% correct 👍
if err != nil { | ||
return nil, err | ||
} | ||
includeEnd = true | ||
} | ||
|
||
var includeCommits []string | ||
if s.config.ConsiderPRMergeCommits { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what this config does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like this option never was added to the documentation, I can update that in a separate PR (here's the PR that put this feature in #40 ) . In short, when enabled the commits that comprise the release can affect which PRs get included into the release notes.
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I'll leave it to @willmurphyscode to approve, since this is being looked at by both of us
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Currently there is erroneous logic for including or excluding the end of a commit range for a release (the end should always be included). The following diff is what this PR logically achieves:
However to properly put this change under test additional functional decomposition was necessary. Since this range selection was refactored to be more accurate it additionally considers the case where no tags were found, in which case the first commit in the repo is used.
Partially addresses #96