-
-
Notifications
You must be signed in to change notification settings - Fork 298
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 --release-draft-only
flag
#578
Conversation
The $ np release Or its own secondary bin command (as part of the same package) $ np-release |
While @fregante does make some valid points, I think that adding a command such as |
So does the |
I think this should run right after the first prompt before any of the task stuff. Right now it's just too many conditionals. Would be simpler to just call |
And I don't know why the checks fail after a timeout... I can't do them locally too. |
Don't worry about the failing tests for now, there's a pending PR to fix the integration test. Tests should start passing when its merged. |
I tried it on https://github.com/sindresorhus/sindre-playground, by adding a commit, but it seems to also include the previous version:
It should also not show the |
The commit range on the opened release draft is also incorrect. |
I think you didn't use the option as I intended to. The use-case scenario I had in mind was that the process of creating a new version had already been done. This means that the last commit should always be a "tag commit" created by I think you shouldn't be able to see the latest commits in the release draft in the case of this flag, because it does not belong to any release. What do you think about that? If you agree with me on the last point, would you prefer:
|
Makes sense. I was just not thinking about the original use-case for this.
Just a warning, but still let the user do it if they really want. |
This should be the result now:
With those changes, the printed commit log doesn't include unreleased commits, but the warning says "Unreleased commits found". Do you find it's weird? (in fact, they were found but got removed) I like the fact that it's WYSIWYG, maybe the warning should be phrased differently... how would you say it? |
By the way, because of this request, the tags aren't pushed to GitHub anymore when we use the So the user might have to do it manually so that the release draft can be bound to the corresponding tag. |
I don't think we should proceed with that, pushing the tag and publishing the release is what np does with release drafts in our normal flow. I think having the same behavior for -release-draft-only makes sense. |
The thing is I don't know how I can use the task system again without adding too much conditionals and without copy-pasting the push tags task... if I do it, it might just revert 516c89e Maybe it's simpler to let the user handle the push tags if it failed, because the two use-cases I think of are the following:
|
That makes sense, sounds good to me. |
Also, the flag is named |
I released v1.6.0 of https://github.com/sindresorhus/sindre-playground/releases, but I'm still getting the unreleased commit message:
|
Okay, now you should get this:
Note that the commit range will contain the latest tag (instead of master) only if there are unreleased commits. |
Closes #478
This is my proposal for the issue above.
--release-draft-only
to the CLIpreviousTagOrFirstCommit()
to get the tag which is before the one which we would have usually usedExample of use case:
I do
np --release-draft-only
.Behind the scenes, the np command is called with version 1.0.1 "in mind".
The function
previousTagOrFirstCommit()
returns 1.0.0 so that we can get the commit log from this revision.The commit which bumps the version to the latest (named "1.0.1") is removed from the history as well as the unreleased commit(s).
No other task is executed. The release draft helper runs right after the first prompt.