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

Remove welcome workflow and replace with something custom #73

Closed
derberg opened this issue Sep 22, 2021 · 6 comments · Fixed by #88
Closed

Remove welcome workflow and replace with something custom #73

derberg opened this issue Sep 22, 2021 · 6 comments · Fixed by #88
Labels
bug Something isn't working

Comments

@derberg
Copy link
Member

derberg commented Sep 22, 2021

This workflow https://github.com/asyncapi/.github/blob/master/.github/workflows/welcome-first-time-contrib.yml and the first-interaction action that we use it causes headache for the 2nd time

It is failing again on all the workflows, blocking merges and it is closing some serious overload on the GitHub API and therefore rate limit alerts. Not cool at all!

We should remove it (I do not want us to wait for actions/first-interaction#56 and then again in few months face 3rd failure, 2 is enough) and replace with our custom solution:

  • we just need to learn from current action how they figure out checking first contributor (now they do a look over all PRs or issues which seems unbelievably harmful for the API -> https://github.com/actions/first-interaction/blob/main/src/main.ts) and do it better, maybe API already allows it, if not rest client, maybe graphql. This workflow is great but not worth it if it is going to cause so many problems in auto merging. We should just push GH for something better, if API is not the answer ATM
  • we can have just a custom script like we already do here, and here is some example on how to talk graphql-ish
@KhudaDad414
Copy link
Member

KhudaDad414 commented Sep 22, 2021

Did some digging In Github Graphql API and it seems that issues search can be greatly optimized using filterBy of IssueConnection.
But sadly PullRequestConnection does not have a filterBy argument so I don't know if using the Graphql API will help or not since we have to filter all pull requests using "graphql-ish approach" as well.
In the worst-case scenario, we can optimize the official script by more than 50% if we use "graphql-ish approach" which is good. 😄

@derberg
Copy link
Member Author

derberg commented Sep 22, 2021

Can you dig a bit more, I noticed that on issue and pr you have access to author, and then you have field authorAssociation: CommentAuthorAssociation and one of values for CommentAuthorAssociation is FIRST_TIME_CONTRIBUTOR. Maybe this could be used?

@KhudaDad414
Copy link
Member

We can't use that. By default, that field is NONE. It doesn't change by opening a pull request or reporting an issue. (strange 🤔)
Tested Here

@derberg
Copy link
Member Author

derberg commented Sep 30, 2021

@KhudaDad414

I just tried this:

query { 
  repository(owner: "asyncapi", name: "spec"){
    name
    pullRequests (last: 100){
      edges {
        node {
          url
          authorAssociation
        }
      }
    }
  }
}

and got this on the list

{
            "node": {
              "url": "https://github.com/asyncapi/spec/pull/613",
              "authorAssociation": "FIRST_TIME_CONTRIBUTOR"
            }
}

@KhudaDad414
Copy link
Member

KhudaDad414 commented Oct 1, 2021

@derberg
can you take a look at this repo?
I have figured out how to do that with the first issue but for some reason, for PRs, authorAssociation is always NONE for the account that I am using for testing.

@derberg
Copy link
Member Author

derberg commented Oct 5, 2021

Damn, when you read docs carefully, looks like it is commit related interaction, and because we all work through forks, commit is outside the repo, thus NONE (at least I think so)

Screenshot 2021-10-05 at 10 21 41

I see it worked for an issue, but because you count the amount of issues per user, I guess this is the only way to go 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants