Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

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));

@elibarzilay elibarzilay force-pushed the master branch 3 times, most recently from 1d39a68 to 9e931d1 Compare July 7, 2021 15:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant