-
-
Notifications
You must be signed in to change notification settings - Fork 23.1k
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] Add organization stats #1
Comments
@franky47 great idea! okay i will look into it. and try to add org support. meanwhile you can also contribute if you want. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I really hope to have this function, which can count my stars in the organization! |
my stars value is 0, can help check? |
Hi @deancn, it is because we currently only support stars from repositories you are the owner of. Since many people want this as an enhancement I'm sure we'll be able to implement this soon. |
@terror got it, thanks. |
Assuming you might be a member of some huge organization (npm, babel, rust). It might make sense to add a filter on top of it to prevent certain organizations from being included. Better than that would be an allowlist that only includes organizations that you explicitly declare: |
How long this feature could be used? |
any news on this? |
Any update on this? |
@anuraghazra I tried it in go and it worked like a charm to count those stars: package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
type Org struct {
Name string `json:"login"`
}
type Repo struct {
Name string `json:"full_name"`
Stars int `json:"stargazers_count"`
}
func main() {
url := "https://api.github.com/users/mattetti/orgs"
resp, err := http.Get(url)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
var stars int
var orgs []Org
json.Unmarshal(body, &orgs)
for _, v := range orgs {
url = fmt.Sprintf("https://api.github.com/orgs/%s/repos", v.Name)
resp, err = http.Get(url)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, err = ioutil.ReadAll(resp.Body)
if err != nil {
panic(err)
}
var repos []Repo
json.Unmarshal(body, &repos)
for _, v := range repos {
fmt.Println(v.Name, v.Stars)
stars += v.Stars
}
}
fmt.Println("-----------------------")
fmt.Println("### Total stars:", stars)
} It's quite simple: you just get all org names from the api endpoint |
@Mr-jiangzhiguo, strangely when I go to your Github profile, I also can't see your organizations. |
Yeah logic isn't an issue here. we can of course get the data and manipulate it as per our needs. BUT! The issue is that vercel serverless execution time is only 10sec and it's not enough to fetch all those data & then manipulate it, serverless function would time out long before we even get to fetching all org data.
And this is also very expensive because the organization can have many repos and we have to fetch all of them and accumulate the star count. |
@anuraghazra some kind of lightweight cache could be a solution 🤔 |
@anuraghazra or concurrency. Another problem would be the rate limiting with too much orgs/repos |
We already have caching, it's not the issue since the initial data wont even load because vercel would timeout. |
I tried this @mpl1018, but can´t get any values to my devcard. :( |
@mpl1018 I clicked the button "Create my DevCard" and others. It tries to log me in on Slack. It makes no sense to me. |
I understand 😅 @joaovian06 @brunolnetto Pullpo started as a product to have code review conversations on ephemeral Slack channels per PR (https://pullpo.io/products/channels). However, we made the bad decision to use Slack for login instead of GitHub. This week, we are allowing users to log in with GitHub as well. I'll keep you updated! |
UPDATE: Don't worry if your stats appear as zeros; it can take some time to fetch historical data from the organization. If you want to read about the permissions we ask for, you can check it out at https://docs.pullpo.io/github-permissions. @brunolnetto @erickskrauch @ketrab2004 @joaovian06 @kavanase |
@mpl1018, thanks for pointing me to your tool. More platforms to choose from for users is great 👍🏻. Another provider is https://quine.sh/. Having that said, people can already include organization stats in GRS by deploying their own instance and merging #2459. Furthermore, we will release a GitHub version of GRS after this summer that will give users the ability to get more accurate language and stats results, including organization stats (see #2179) 🚀. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I do not want to be a grinch here, but can we keep the pullpo bug reporting through the site intercom before it becomes a big thread 😅. |
This is all I hear: grinch, grinch, grinch. |
@mpl1018 feel free to answer @francois-rozet's last question here. Just trying to prevent this from becoming a pullpo debug issue since a lot of people are subscribed 😅 . |
Hi @francois-rozet! My apologies the inconvenience. The issue should be resolved now. 👍 |
Hey, no problem, but I don't even know why I'm mentioned here 😅 I guess it is a typo between my handle and the OP's handle. |
Oh, sorry for the noise 😅. I should not try to answer GitHub issues quickly before shutting down at the end of the day. Should have been @brunolnetto indeed 👍🏻. |
I make this inconvenience sometimes, guys. Broad context makes me think in general answer anywwhere. Good job anyway. |
Pull from fork
If a repository is created by me in a organization, and I'm a only a member instead of owner of this organization, it seems not to work. Anyone has an idea about it? |
Hey, @AsakusaRinne! Do I understand correctly that you have deployed that branch #1122 on own instance, since if not this feature should not work because master branch does not contains that changes. In case if correct branch is deployed, the following values should be available to be passed into |
Hi, sorry for the disturbing. I mistook the answers in this issue as the feature ( |
Any progress? |
Please! It's more than 4 years this ticket is "Open"! |
I have merged this pull request and resolved the conflicts in my forked repository. You can deploy it Vercel like this video and add the following parameters to the links in your README: &role=OWNER,COLLABORATOR,ORGANIZATION_MEMBER. |
I have some private repositories inside an organisation which I also own, and it seems like this is not included in the tonp languages overview - do you know if the api can access private repos inside an organisation? |
Hi @wail-asad , I have forked the main repo today and deployed my own Vercel instance with my PAT_1 and it still does not show me my top languages from contributions in organizations to which I am either owner either member. Any idea? I am using the following -> URL + /api/top-langs/?username=patriciacostadacruz&layout=compact&role=OWNER,COLLABORATOR,ORGANIZATION_MEMBER,MEMBER&hide=html,css&theme=codeSTACKr&langs_count=8 |
Most of my open-source work is moved to dedicated organizations (47ng, FortySevenEffects, Chiffre), for scoping and to avoid cluttering my personal repos.
I'd be happy to contribute a feature to include aggregated organization stats.
API ideas:
The text was updated successfully, but these errors were encountered: