Np: No GitHub release draft flag

Created on 18 Mar 2019  路  12Comments  路  Source: sindresorhus/np

Use a flag, like --no-release-draft to avoid opening the GitHub "New Release" page in the browser.

Description

I'm creating the GitHub release using the GitHub API in a script, after running np, but the user is still showing the release draft, although the release is already there.

Alternatives

Another alternative is to implement the release by GitHub API fully in np.

enhancement help wanted

Most helpful comment

I think adding ability to skip arbitrary tasks is a much larger task and should be discussed separately. Not even sure I want that. It will considerably complicate the codebase and I'm trying to reduce the complexity.

Adding a --no-release-draft flag is the best immediate solution.

All 12 comments

PR welcome to add the flag. I just didn't want to add it initially unless someone actually needed it.

I'll work on the PR, feel free to assign the issue to me.

Adding a --no-release-draft flag seems sensible to me, but I feel like we need a more general flag to better support current and future situations.
Since we already have --no-publish, we could add a --skip-tasks flag which allows you to specify tasks you'd like np to skip (e.g. publish, release-draft, push, etc.). Such a tag would be a generalization of --no-publish and --no-release-draft, and it would be useful in the future as well.

Thoughts?

Adding a --no-release-draft flag seems sensible to me, but I feel like we need a more general flag to better support current and future situations.

I agree it is the most convenient way of implementing it but we would be exposing the user to the concept of a "np task" and all the tasks, in which conditions they are run and what they do.
Many (as I did) will go to the source code and figure it out themselves anyways, so I think it is a good thing to add it and document it as an "advanced usage" topic.

I figure we would need to:

  • Add the --skip-tasks flag with a list parameter e.g. task1,task2,task3
  • Document the flag and all the tasks that can be skipped and how they would be skipped anyways (e.g. , the release-draft task will always be skipped if the repo is not hosted on GitHub)
  • Decide how to handle the backwards compatibility with --no-publish, I see three possible ways:

    • Remove it

    • Keep it

    • Add a deprecation warn and remove it in the future

@sindresorhus what do you think?

Was coming here to add this issue myself (hit an issue of the browser crashing because the release draft was too big), glad to see it already exists! I'm in favor of the --no-release-draft flag, but feel like the --skip-tasks proposal is bigger than this and potentially a better separate issue/suggestion. 馃

Although I do think there's value in having the explicit --no-* options. I don't know if the current spread of features is too overwhelming to not just expect folks to use multiple flags (but I'm also not doing anything super complicated with this yet). Thanks!

@rdmurphy made a good point, maybe implementing --no-* as a way to cancel the * task would preserve the current spirit of the options and allow for any task to be skipped.

Instead of --skip-tasks task1,task2,task3 I'd prefer --skip task --skip task2. They can also replace the explicit --no-* flags.

- --no-cleanup
+ --skip cleanup

- --no-publish
+ --skip publish

+ --skip release

They'd work the same way, but they don't have to be listed in the help one by one.

I've made a PR addressing the --no-draft flag, we can continue the generic implementation in a new issue.

I'd go with @rdmurphy --no-* approach as it is compatible with meows flags.

I think adding ability to skip arbitrary tasks is a much larger task and should be discussed separately. Not even sure I want that. It will considerably complicate the codebase and I'm trying to reduce the complexity.

Adding a --no-release-draft flag is the best immediate solution.

I think adding ability to skip arbitrary tasks is a much larger task and should be discussed separately.

I'll create a separate issue for it then 馃憣馃徎

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bennycode picture bennycode  路  4Comments

koppor picture koppor  路  5Comments

natesilva picture natesilva  路  5Comments

voxpelli picture voxpelli  路  5Comments

bennycode picture bennycode  路  4Comments