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.

[reg-notify-github-plugin] Support PR created by forked repository

See original GitHub issue

Is your feature request related to a problem? Please describe.

It would be happy when reg-notify-github-plugin supports to comment PR which created by a forked repository

Describe the solution you’d like

I haven’t any idea to solve it but https://github.com/reg-viz/gh-app/tree/master/packages/backend seems related to

Describe alternatives you’ve considered

Additional context

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Quramycommented, Oct 16, 2019

Hi @kogai and sorry for my late reply.

Please tell me your usecase. Which is the followings or other?

  • (A): You want gh-plugin’s comment to the original repository by your PR
  • (B): You want gh-plugin’s comment to your forked repository by your PR

If you want (A), it may be our plugin issue, the real implementation is in reg-gh-app as you said. If you want (B), you should install https://github.com/apps/reg-suit to not orijinal repo but your forked repo because of GitHub Apps permission spec.

0reactions
Quramycommented, Sep 18, 2020

For now, reg suit GitHub app uses the following query to detect PR to comment ( This GitHub app accepts owner, repo name, branch name of HEAD ):

query UpdatePrCommentContext($branchName: String!, $owner: String!, $repository: String!) {
  repository(owner: $owner, name: $repository) {
    nameWithOwner
    ref(qualifiedName: $branchName) {
      associatedPullRequests(last: 5, states: OPEN) {
        totalCount,
        nodes {
          id, number
          comments(first: 50) {
            totalCount
            nodes {
              databaseId, createdAt, viewerDidAuthor
            }
          }
        }
      }
    }
  }
}

https://github.com/reg-viz/gh-app/blob/master/packages/backend/src/gql/update-pr-comment-context.graphql

But this query can’t look for forked repository because ref(qualifiedName: $branchName) does not make sense .

And I think we’ll fix this issue by query such as:

query {
  repository(owner: "reg-viz", name: "reg-suit") {
    id
    pullRequests(first: 2, states: OPEN, orderBy: { field: UPDATED_AT, direction: DESC }, headRefName: "patch-1") {
      nodes {
        title
        headRefName
        headRepositoryOwner {
          login
        }
        id
        number
        comments(first: 50) {
          totalCount
          nodes {
            databaseId, createdAt, viewerDidAuthor
          }
        }
      }
    }
  }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Forking a GitHub Repository and Using Pull Requests
Forking creates a copy of a repository which you can work on. You can then submit a pull request to have your changes...
Read more >
How do I update or sync a forked repository on GitHub?
If you click Rebase and merge , all commits will be made "with" you, the original PRs will link to your PR, and...
Read more >
Fork a GitHub Repository & Submit a Pull Request - Jake Jarvis
Walkthrough of forking a GitHub repository, cloning it, committing your changes to a new branch, and pushing it back upstream.
Read more >
Fork GitHub projects | IntelliJ IDEA Documentation - JetBrains
Clone this fork to create a local repository. ... created your fork. Create a pull request to suggest your changes to the original...
Read more >
GitHub Forks and Pull Requests | Step by Step - YouTube
We'll cover making a GitHub fork, we'll make changes to the forked repository, and finally create and complete a pull request to merge...
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