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

Chart: total number of organizations and teams (v2) #43

Merged
merged 3 commits into from
Nov 20, 2017

Conversation

larsxschneider
Copy link
Collaborator

This is a continuation of @toddocon work in #39

Lars Schneider added 2 commits November 20, 2017 14:03
"demo-data" was accidentally ignored in 8eab15d. Fix this and ignore
the directory "hubble-data". This is useful for local debugging as you
can clone your production "hubble-data" repository into this directory.
"github-enterprise" is an entry in the organizations table but no real
organization in GitHub Enterprise. Refactor the "excludedEntities"
mechanism to accept a list of entities instead of a single string and
exclude "github-enterprise" in the example config.

Please note that this approach also excludes repositories with the name
"github-enterprise". That shouldn't be a big problem in the real world,
though.
# then define that here to exclude them from all kinds of statistics.
# "github-enterprise" is a default organization in GitHub Enterprise that
# we exclude here, too (Note: this also excludes repositories with the name
" "github-enterprise").
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The leading " looks like a typo, or is this intentional?

# Lists the total number of organizations
class ReportOrgHistory(ReportDaily):
def name(self):
return "orgs-history"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the report file is called orgs-history, shouldn’t we rename the class to ReportOrgsHistory then?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, now I think it might be best to call the output file and the report org-history and ReportOrgHistory (because it really sounds strange in plural here), and only prepend orgs- to the HTML pages, which are in the category orgs. What do you think, @larsxschneider?

# Lists the total number of organizations
class ReportTeamHistory(ReportDaily):
def name(self):
return "teams-history"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above comments for org-history.

Copy link
Contributor

@pluehne pluehne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks @toddocon and @larsxschneider!

@toddocon
Copy link
Contributor

toddocon commented Nov 20, 2017

This chart mimics the output from the stats API call ( api/v3/enterprise/stats/orgs ). It shows the total number of orgs and total number of teams. The API also returns total number of disabled Orgs and total team members. The first is always 0 for us so I skipped it. The second, total team members, I have not been able to reverse engineer via a SQL call.

If we want total teams per Org, then maybe that should be a table below this chart (similar to the Org owners table)? I can research this as a v3 enhancement to this chart and maybe include other useful Org information in the chart.

@toddocon
Copy link
Contributor

Yes, in the current Organization Owners list, the built-in github-enterprise Org/User shows up. To exclude this as Lars has done is correct. I missed seeing this in my Org list since there are so many but now that I've checked, it's there.

ghe

@larsxschneider
Copy link
Collaborator Author

OK. Not sure if total members of teams per org is necessary. That was just a misunderstanding on my end. I divided the two numbers into two graphs because they can vastly differ (e.g. you could have only 5 orgs but 5000 teams) and then they would be hard to see.

@larsxschneider
Copy link
Collaborator Author

@toddocon You need to adjust your local config file to exclude "github-enterprise".

@larsxschneider
Copy link
Collaborator Author

@toddocon Can you give me a quick review for the final PR here?

@toddocon
Copy link
Contributor

I will adjust my file.

My org/team numbers do differ drastically. Good catch on breaking the data up into two charts. Thanks!

@toddocon
Copy link
Contributor

Reviewing now....

Copy link
Contributor

@toddocon toddocon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Two charts now instead on one and everything adjusted accordingly. Like the handling of the special built-in user github-enterprise.

@larsxschneider larsxschneider merged commit 90f10b7 into master Nov 20, 2017
@larsxschneider larsxschneider deleted the lras/org-and-team-total branch November 20, 2017 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants