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

list of active repositories below the "Repository Feature Usage" graph #119

Closed
wants to merge 5 commits into from
Closed

Conversation

mlbright
Copy link
Contributor

@mlbright mlbright commented Feb 7, 2018

It is interesting to see what repositories are most active according to Hubble's definition. Moreover, it is very useful to have a complete list of all active repositories. Since this list can be big, display the top 50 on the webpage, and include a link to the complete data set.

@larsxschneider
Copy link
Collaborator

You mention the top 50 truncation in the pull request body ... but this is not implemented yet, right?

@mlbright
Copy link
Contributor Author

mlbright commented Feb 7, 2018

Correct! The top 50 truncation is not implemented yet. Currently the entire list is displayed sorted by most number of pushes.

@mlbright
Copy link
Contributor Author

mlbright commented Feb 8, 2018

@larsxschneider I reworked the PR and I now filter the table to display only the top 50 most active repos.

The number of repos can be impractical to display on a single page:
only display the top 50.
Add link to table of all active repos.
@@ -554,10 +554,14 @@ function createTable(table)
return d;
});

let displayed = data;
if (hasConfig($(table), 'slice'))
displayed = data.slice(readConfig($(table), 'slice')[0], readConfig($(table), 'slice')[1]);
Copy link
Collaborator

@larsxschneider larsxschneider Feb 13, 2018

Choose a reason for hiding this comment

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

minor nits:
Maybe move this into a variable?

let tableSlice = readConfig($(table), 'slice');

Maybe rename displayed to displayData. displayed confused me because of the past tense.

@pluehne what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with @larsxschneider, displayed could be renamed to displayData for clarity what is actually displayed.

I believe that I have similar code with two readConfig calls as parameters on the same line somewhere else in the code (here and here), so I’ll take the blame for that 🙂. However, this might be the occasion to make the change at the other places as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

In this case, we should make the tableSlice constant. Also, I’d rather call it configSlice or something similar to show that it’s part of the configuration and not a slice of the table containing actual data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made the grammar change, but I'll leave the constant tableSlice changes for a separate PR.

data-config='{"slice": [0, 50]}'
></table>
<div class="info-box">
<p>The top 50 most active repositories, by number of pushes.</p>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the , here correct?

Copy link
Contributor

Choose a reason for hiding this comment

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

I’d say it’s a matter of preferences. Strictly, it isn’t necessary, but a comma can be used to separate additional information (in this case, “by number of pushes”) from the rest of the sentence. In this simple case, I’d leave the comma away.

ON active.repository_id = push_tally.repository_id
ORDER BY count DESC
'''
return query
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: In activeReposQuery below you assign query once. Here you append to the query variable. I would only use one stile. I think I prefer "assign once".

Copy link
Contributor

Choose a reason for hiding this comment

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

@larsxschneider: I find both styles okay as they are used here. Simple concatenations with + are fine for single variables etc., while entire lines (such as self.activeReposQuery() are broken down with query +=. I think it’s fine as it is 😄.

(
SELECT repository_id, COUNT(*) AS count
FROM pushes
GROUP BY repository_id
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't you just count the pushes in activeReposQuery? Then we wouldn't need the additional join here. I am not sure if I am missing something here...

@codecov-io
Copy link

Codecov Report

Merging #119 into master will increase coverage by 0.52%.
The diff coverage is 0%.

@larsxschneider
Copy link
Collaborator

superseded by #123

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.

4 participants