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

Release Drafter is *sometimes* including unmerged PRs #917

Closed
katelovescode opened this issue Aug 4, 2021 · 7 comments · Fixed by #1015
Closed

Release Drafter is *sometimes* including unmerged PRs #917

katelovescode opened this issue Aug 4, 2021 · 7 comments · Fixed by #1015

Comments

@katelovescode
Copy link

katelovescode commented Aug 4, 2021

I'm including a screenshot - release drafter has already added a PR that's open and unmerged; my config is as follows:

name-template: 'v$RESOLVED_VERSION 🌈'
tag-template: 'v$RESOLVED_VERSION'
categories:
  - title: '👒 Dependencies'
    labels:
      - 'dependencies'
  - title: '🏕 Backend'
    labels:
      - 'backend'
  - title: '🪔 Frontend'
    label: 'frontend'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver:
  major:
    labels:
      - 'major'
  minor:
    labels:
      - 'minor'
  patch:
    labels:
      - 'patch'
  default: patch
template: |
  ## Changes
  $CHANGES

From what I can tell there's no reason that that PR should be included; I had to remove another one the other day on 0.17 manually, which I will need to add back in manually, I assume, in this release. Is there any way to determine why this is happening?

Screen Shot 2021-08-04 at 9 27 42 AM

Link to the repo: https://github.com/pieforproviders/pieforproviders

@jetersen
Copy link
Member

jetersen commented Aug 4, 2021

We are simply using the GraphQL api. I cannot see where in the code we should be at fault.

Maybe there is a bug somewhre here:

module.exports.findCommitsWithAssociatedPullRequests = async ({

But 🤷

@rnorth
Copy link
Contributor

rnorth commented Aug 5, 2021

I think @kiview spotted this with one of his PRs in https://github.com/testcontainers/testcontainers-java, although I'm afraid I can't find any current instance of this...

I'll keep an eye out and try and provide more info if we see it again.

@jerr0328
Copy link

I thought this was similar to #766 but it might not be. I see the same thing, and I noticed it happens when the action ran last on the pull-request. For instance, the original repo here has this config: https://github.com/pieforproviders/pieforproviders/blob/025bfe99539df5b8660b4c64e972e2331ee1cb78/.github/workflows/release-drafter.yml

I have a similar config on a private repo and noticed that the draft release has an entry for the unmerged PR that last ran. To workaround, I just re-run the last release-drafter workflow on the main branch, and the unmerged PR goes away. I'm using the autolabeler, so I want to keep running on the open PRs.

@tchupp
Copy link

tchupp commented Aug 29, 2021

I am experiencing the same behavior on a newly configured repository.
This run seems to have created the draft release and added the open PR to the list of changes: https://github.com/tchupp/actions-terraform-pr/runs/3456491995?check_suite_focus=true
Screen Shot 2021-08-29 at 5 41 27 PM
Screen Shot 2021-08-29 at 5 41 38 PM

@tchupp
Copy link

tchupp commented Aug 29, 2021

I think this PR may be causing this issue: #632
The suggested configuration from the README includes these triggers:

on:
  push:
    # branches to consider in the event; optional, defaults to all
    branches:
      - master
  # pull_request event is required only for autolabeler
  pull_request:
    # Only following types are handled by the action, but one can default to all as well
    types: [opened, reopened, synchronize]

The PR trigger is nice because it allows the auto-labeler to work, but I think this is causing the release draft to have unmerged PRs added.

@tchupp
Copy link

tchupp commented Aug 30, 2021

I've been able to work around it using the undocumented input disable-releaser:

      - uses: release-drafter/release-drafter@v5
        with:
          disable-releaser: github.ref != 'refs/heads/main'
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

@jetersen
Copy link
Member

Should be solved by #1015 than that would be odd 🗡️

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 a pull request may close this issue.

5 participants