Skip to content
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

Ignore draft PRs outside of the project board #353

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jablko
Copy link
Contributor

@jablko jablko commented Jan 26, 2021

All the bot does to draft PRs is remove them from the project board, just like closed PRs:

dt-mergebot/src/pr-info.ts

Lines 188 to 189 in 251e2ba

if (prInfo.isDraft) return botEnsureRemovedFromProject("PR is a draft");
if (prInfo.state !== PullRequestState.OPEN) return botEnsureRemovedFromProject("PR is not active");

So the daily script can ignore draft PRs that are already removed from the project board? Handle any exceptions in the --cleanup section, just like closed PRs. Eliminates some unnecessary work by the script and makes the closed/draft cases consistent.

Adding isDraft to the all-open-prs query excludes draft PRs from the main run.ts section. It includes them in the --cleanup section because that checks !cardIDs.includes(), which will now be true:

const ids = column.cards.map(c => c.id).filter(c => !cardIDs.includes(c));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant