-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add auto-merge manifest option #34
Add auto-merge manifest option #34
Conversation
I forgot to add a check for minor/patch, from what I understood auto-merge should only be for non-breaking changes. |
I believe my primary comments have been resolved, I think this is good to ship! |
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.
Sorry for the churn; let's do the more granular commit message filtering in this PR so we don't generate too many spam releases based on internal/minor changes, per Robert's comment here.
21f5ee7
to
53b0d1b
Compare
autoMerge: { | ||
mergeMethod: 'rebase', | ||
versionBumpFilter: ['minor'], | ||
conventionalCommitFilter: [{type: 'fix', scope: 'api'}], | ||
}, |
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.
Here we define filters.
test/manifest.ts
Outdated
sinon.assert.calledWith( | ||
createPullRequestStub, | ||
sinon.match.has( | ||
'headBranchName', | ||
'release-please/branches/main/components/a' | ||
), | ||
'main', | ||
'main', | ||
sinon.match.string, | ||
sinon.match.array, | ||
sinon.match({ | ||
autoMerge: undefined, | ||
}) | ||
); | ||
sinon.assert.calledWith( | ||
createPullRequestStub, | ||
sinon.match.has( | ||
'headBranchName', | ||
'release-please/branches/main/components/b' | ||
), | ||
'main', | ||
'main', | ||
sinon.match.string, | ||
sinon.match.array, | ||
sinon.match({ | ||
autoMerge: {mergeMethod: 'rebase'}, | ||
}) | ||
); | ||
sinon.assert.calledWith( | ||
createPullRequestStub, | ||
sinon.match.has( | ||
'headBranchName', | ||
'release-please/branches/main/components/c' | ||
), | ||
'main', | ||
'main', | ||
sinon.match.string, | ||
sinon.match.array, | ||
sinon.match({ | ||
autoMerge: undefined, | ||
}) | ||
); |
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.
Asserts for the autoMerge
parameter when github.createPullRequest()
is called.
autoMerge: { | ||
mergeMethod: 'rebase', | ||
conventionalCommitFilter: [ | ||
{type: 'fix'}, | ||
{type: 'feat', scope: 'api'}, | ||
], | ||
}, |
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.
@rattrayalex That's the config I expect Stainless to be using.
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 haven't done careful code review of the contents of the recent commits, but the core stuff sounds good to me and I think the meat of the code was previously reviewed!
@marcel-stainless may want to give it another look over, I'm not sure, but probably okay to fast-follow with fixes that come out of that.
This pull request adds an
autoMerge
manifest option that can be passed to the factoryfromManifest()
. When set, release-please attempts to enable auto-merge for release pull requests.Note that auto-merge can only be enabled on a pull request with branch protections (such as required reviewers, required CI checks, etc).