Giter VIP home page Giter VIP logo

Comments (11)

kentaro-m avatar kentaro-m commented on June 11, 2024 8

Hi, @brianeclow! Thanks for waiting.

I thought a good idea which checking exist assignees or reviewers before adding its to PR.

  1. Checking existed reviewers
    1. Skip the process to add reviewers if PR has reviewers
  2. Adding reviewers if no reviewers
  3. Checking existed assignees
    1. Skip the process to add assignees if PR has assignees
  4. Adding assignees if no assignees

I think it's better to control the skipping process as the logic of the application rather than the if syntax of the workflow.

If you have any concerns, please let me know.

from auto-assign-action.

vistaar-dgada avatar vistaar-dgada commented on June 11, 2024 4

@brianeclow //cc @kentaro-m You're searching for action to run only once. Usually it runs on every push on PR. So i think this will take care of it.

name: 'Auto Assign'
on:
  pull_request:
    types: [opened, reopened]
jobs:
  add-reviews:
    runs-on: ubuntu-latest
    steps:
      - uses: kentaro-m/[email protected]
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"

from auto-assign-action.

dsazup avatar dsazup commented on June 11, 2024 2

We are running into the same issue too. For example if I create a non-draft, normal PR it assigns 2 reviewers. Let's say I instantly mark that PR as draft. Now when I mark it ready for review again, it adds 2 more reviewers which is not really expected.

from auto-assign-action.

brianeclow avatar brianeclow commented on June 11, 2024 1

Nope!
@vistaar-dgada That is not what I'm asking for at all. I already have the action run only once upon opening of the PR. I am looking for the action to be skipped if reviewers have already been set by someone when the PR was created. This means, the author has specific reviewers in mind, and adding new people confuses all involved.

If I am understanding correctly, the code can check the reviewer array, and act accordingly. And at that point, we could get options: no action taken, add reviewers from the pool to bring up to the desired total, add reviews from the pool, etc.
My ask is for at least no action and add users from pool.

from auto-assign-action.

PrinsFrank avatar PrinsFrank commented on June 11, 2024

Because of reviewer amount limitations in private repos in orgs this also results in unassigning the current reviewer on every push action (or in case of only updating on open and reopen on every open/reopen action).

We're also running into the issue that when assigning a reviewer during creation of a PR it gets overwritten immediately by the action.

from auto-assign-action.

PrinsFrank avatar PrinsFrank commented on June 11, 2024

I just managed to work around it for now by adding a condition to the job like this:

name: 'Auto Assign'
on:
  pull_request:
    types: [opened, reopened]
jobs:
  add-reviews:
    if: github.event.pull_request.requested_reviewers.*.name == ''
    runs-on: ubuntu-latest
    steps:
      - uses: kentaro-m/[email protected]
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"

from auto-assign-action.

dsazup avatar dsazup commented on June 11, 2024

@PrinsFrank interesting, though doesn't seem to work for me. When I submit a PR, it just skips the action all together initially 🤔

from auto-assign-action.

brianeclow avatar brianeclow commented on June 11, 2024

@PrinsFrank That does not work. I did several iterations around it, and github actions will not let you test an empty array in that fashion or in any way I could think of. This is final configuration I ended up with before stopping:

name: 'Auto Assign'
on:
  pull_request:
    types: [opened, reopened]

jobs:
  triage-assign-and-review:
    if: contains(github.event.pull_request.requested_reviewers.*.login, '') && contains(github.event.pull_request.requested_teams.*.slug, '')
    runs-on: ubuntu-latest
    steps:
      - uses: kentaro-m/[email protected]
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"

from auto-assign-action.

carlisia avatar carlisia commented on June 11, 2024

I thought a good idea which checking exist assignees or reviewers before adding its to PR.

This sounds good to me. To be clear, it should precisely be checking that the "number" of reviewers/assignees match what's specified in the config file.

I'm having the same general problem, but specifically one no one has mentioned: I open a PR, the right number of (random) reviewers get added (good). Any subsequent commit pushed to that PR will trigger more reviewers being assigned (bad).

from auto-assign-action.

idonov8 avatar idonov8 commented on June 11, 2024

My team encountered this problem. Is there any up-to-date solution?
@carlisia is the problem fixed on the GitHub App version? Should we switch to using it?

from auto-assign-action.

carlisia avatar carlisia commented on June 11, 2024

Hey @idonov8 I haven't tested or used this action in a long while, sorry I cannot be of help.

from auto-assign-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.