question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature request] Allow adding PR reviewers via `publish:github:pull-request` action

See original GitHub issue

We’d like to be able to add reviewers to PRs created by Backstage via the publish:github:pull-request action by setting them as parameters of the action.

Feature Suggestion

We’d like to have two extra parameters on the publish:github:pull-request action, reviewers and teamReviewers, which would allow us to add reviewers much more easily to Backstage-created PRs just by adding them to the action definition:

    - id: pullrequest
      name: Create pull request
      action: publish:github:pull-request
      input:
        repoUrl: ${{ parameters.repoUrl }}
        branchName: ${{ parameters.branchName }}
        title: New Pull Request
        description: A newly created PR on GitHub
        reviewers:
          - user1
        teamReviewers:
          - team1

Possible Implementation

Currently, we have put together this code to perform this task:

const octokitIntegration = await new OctokitProvider(scmIntegrations).getOctokit(REPOSITORY_URL);
const prUrlSegments = pullRequestUrl.split("/");
await octokitIntegration.client.rest.pulls.requestReviewers({
    owner: octokitIntegration.owner,
    repo: octokitIntegration.repo,
    pull_number: parseInt(prUrlSegments[prUrlSegments.length-1]),
    reviewers: [...],
    team_reviewers: [...]
});

where pullRequestUrl is the remoteUrl of the PR as returned by the publish:github:pull-request action.

Context

We are using the publish:github:pull-request action in our scaffolding process to propagate the creation of the new project to other repositories (mainly IaC-related) by sending PRs. We need to add a team as a reviewer of these PRs so that those people get notified when Backstage sends a PR.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Fs00commented, May 31, 2022

@benjdlambert Can this be reopened? The feature request is still valid.

0reactions
Fs00commented, Aug 5, 2022

My colleague @fabuloso and I are working on it, we’ll open a PR next week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow adding required reviewers per Pull Request
Our team has a requirement to add mandatory reviewers to PRs after PR creation. We are using status check as a workaround today.....
Read more >
Writing scaffolder templates - Roadie.io
publish:github:pull-request. This action creates a pull request against a pre-existing repository using the files contained in the workspace ...
Read more >
Require multiple reviewers for pull requests - The GitHub Blog
How it works. To require multiple reviewers for pull requests, go to your repository's settings and select “Branches”. Under “Protected ...
Read more >
Add a group to "pull request" reviewers | Bitbucket Server - Jira
Bitbucket Data Center 7.13 introduces Reviewer groups that allow you to add a group of users as reviewers when creating a Pull request....
Read more >
Introducing the New Pull Request Experience for Azure Repos
Try out Azure Repos' mobile-friendly and faster pull request experience with new features like adding required reviewers per pull request, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found