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

[Feature request] Support contributions in private organizations #52

Open
wh1t3h47 opened this issue Jul 28, 2021 · 8 comments
Open

[Feature request] Support contributions in private organizations #52

wh1t3h47 opened this issue Jul 28, 2021 · 8 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@wh1t3h47
Copy link

wh1t3h47 commented Jul 28, 2021

Context
I set up PAT and everything according to the wiki, GitHub actions runs successfully, but my contributions in private organizations are not counted. I am not sure if the same applies to private repositories in which I have access and contributed, but are owned by someone else.
In my organization context, I did not create the project, but contributed heavily to it, even on projects that I created, profile summary seems to ignore them. I'd reproduce the behavior with a language that I never created a repo on (like Lua) and heavily code on it, as I'm not 100% sure if they are not being counted

Alternatives

I tried to set up PAT, but my stats did not seem to change

If the feature request is approved, would you be willing to submit a PR?

Yes, although I'm under a tight schedule and may delay it about a month

@vn7n24fzkq
Copy link
Owner

Hi @wh1t3h47, thanks for the issue.
Can you point out which count is wrong, after that, I can figure out is this a bug or a feature we can add.

For example, we only count public repo for the number of repositories contributed to.

repositoriesContributedTo(first: 1,includeUserRepositories:true, privacy:PUBLIC, contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]) {

But there is no any filter for all contributions count

@AkkyOrz
Copy link

AkkyOrz commented Sep 4, 2021

Hi! I'm @AkkyOrz
First of all, thank you for an amazing product, @vn7n24fzkq.

I have a feature request similar to @wh1t3h47.

Can you point out which count is wrong.

"Total PRs" is the one that I recognize as giving different values than what I expect. (The other values can be wrong, but I haven't noticed it yet)
I created a PR for a repository that belongs to my organization and merged it, but it is not counted up.

If you follow the example above, this is probably the case.

pullRequests(first: 1) {
totalCount
}

(I don't know much about the GitHub GraphQL API, so I couldn't figure out how to reflect the repository information in the query.)

@vn7n24fzkq
Copy link
Owner

@AkkyOrz Thanks for your report.
The number of total PRs is from GitHub API v4, I am not sure why it is not counted up.

I guess maybe it is just not update yet, because of raw file cache or the card is not re-generate yet.

Can you try to use the GitHub GraphQL API Explorer to get the number of total PRs?

GraphQL

query UserDetails($login: String!) {
	user(login: $login) {
   	pullRequests(first: 1) {
    	totalCount
    }
  }
}

Query Variables

{"login":"AkkyOrz"}

It is should looks like this.
And you need to change the login value in query variable to your username.
image

@AkkyOrz
Copy link

AkkyOrz commented Sep 6, 2021

Thank you for your quick reply, @vn7n24fzkq !

I guess maybe it is just not update yet, because of raw file cache or the card is not re-generate yet.

Can you try to use the GitHub GraphQL API Explorer to get the number of total PRs?

Your example is very easy for me to understand how to use the GitHub GraphQL API.
I tried it, and the value is different from my generated card.

I guess that my personal access token doesn't have enough privileges to make it work the way I expect it to.
The GraphQL API Explorer asked me to grant the "Organization access" permissions.

Screenshot from 2021-09-06 14-40-49

Therefore, in order to reproduce the same behavior as the GitHub GraphQL API Explorer, we may need to allow Organization Access in some way.
As far as I know, there are no examples that can be achieved with Personal Access Token.
It may be difficult to make it work to include org's statics.

@vn7n24fzkq
Copy link
Owner

vn7n24fzkq commented Sep 6, 2021

Just to make sure, is the total PRs count from GitHub GraphQL API Explorer different to the generated card for you.

And is the number from GitHub GraphQL API Explorer you expect?

If that is true, as you said, it would be difficult to make it work to include org's stats, and I will investigate in depth.

@AkkyOrz
Copy link

AkkyOrz commented Sep 6, 2021

Just for make sure, is that total PRs count from GitHub GraphQL API Explorer different to the generated card for you.

Yes.

And is the number from GitHub GraphQL API Explorer you expect?

This is also correct.
To add to this, when I granted "Organization access", the number of total PRs which was obtained through GitHub GraphQL API Explorer increased by the number of PRs issued by me in the organization.

If that is true, as you said, it would be difficult to make it work to include org's stats, and I will investigate in depth.

@vn7n24fzkq
Copy link
Owner

vn7n24fzkq commented Sep 6, 2021

@AkkyOrz Thanks for your report again, it is really helpful, other counts may have the same problem.

Maybe the problem @wh1t3h47 got was caused by the same reason.

I will investigate this in-depth in my free time, and look if there is any way can fix this problem.

@vn7n24fzkq vn7n24fzkq added bug Something isn't working help wanted Extra attention is needed labels Sep 6, 2021
@vn7n24fzkq vn7n24fzkq added this to Refer to in Code Refactoring Oct 10, 2021
@vn7n24fzkq vn7n24fzkq removed this from Refer to in Code Refactoring Oct 10, 2021
@stale
Copy link

stale bot commented Dec 19, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Dec 19, 2021
@vn7n24fzkq vn7n24fzkq removed the wontfix This will not be worked on label Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants