Giter Site home page Giter Site logo

Comments (4)

necojackarc avatar necojackarc commented on June 12, 2024 1

Oops, I completely forgot that @seanbecker15 reached out to me on Twitter...
Here's his suggestion - https://github.com/seanbecker15/auto-request-review/tree/per-group-number-of-reviewers

from auto-request-review.

necojackarc avatar necojackarc commented on June 12, 2024

Unfortunately, it doesn't support that use case. The biggest blocker is the option for the maximum number of reviewers applied to the whole reviewer selection.

Let's say five reviewers are chosen based on files changed and teams, and you have options.number_of_reviewers = 3. The random three will be picked out of these five. This is because the randomise logic comes at the very end.

core.info('Randomly picking reviewers if the number of reviewers is set');
reviewers = randomly_pick_reviewers({ reviewers, config });
core.info(`Requesting review to ${reviewers.join(', ')}`);
await github.assign_reviewers(reviewers);

Off the top of my head, I can think of something like options.groups.[group_name].number_of_reviewers.

I'm not sure if this is a good idea, but I think your case could be covered with this option:

reviewers:
  groups:
    team_1_maintainers:
      - member_a
    team_1_contributors:
      - member_b
    team_2_maintainers:
      - member_c
    team_2_contributors:
      - member_d

  per_author:
    team_1_contributors:
      - team_1_maintainers
      - team_1_contributors

    team_2_contributors:
      - team_2_maintainers
      - team_2_contributors

options:
  groups:
    team_1_maintainers:
      number_of_reviewers: 1
    team_2_maintainers:
      number_of_reviewers: 1

from auto-request-review.

seanbecker15 avatar seanbecker15 commented on June 12, 2024

I think adding that option would work well for this use-case. Teams / groups would be coupled with a number of reviewers and could set the number of reviewers they want added to each PR.

One question I would have is how this option would interact with the global number of reviewers option. It seems like this global option might serve best as a default value if there aren't enough reviewers in the groups.

from auto-request-review.

necojackarc avatar necojackarc commented on June 12, 2024

Good question. I think it's important to make it backwards compatible. The global option should limit the total number of reviewers. If there are other ways to use the global options without breaking the current behaviour, that'd be great, but they can be similar but separate options.

from auto-request-review.

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.