scaladex icon indicating copy to clipboard operation
scaladex copied to clipboard

Displaying commit activity on the Awesome page, the project page and the search page

Open joke1196 opened this issue 2 years ago • 11 comments

joke1196 avatar Apr 14 '22 12:04 joke1196

This is a really good start @joke1196.

The scalafix check fails because of the organize import rule. You can fix it by runnning scalafixAll in sbt.

adpi2 avatar Apr 19 '22 08:04 adpi2

@adpi2 Is there a way I could update the small index? As I added a new field commit_activity all the JSON files used to populate the test DB cannot be decoded, and this will make the integration tests fail as well.

joke1196 avatar Apr 27 '22 10:04 joke1196

@adpi2 Is there a way I could update the small index? As I added a new field commit_activity all the JSON files used to populate the test DB cannot be decoded, and this will make the integration tests fail as well.

I would have expected the decoder to accept the missing commitActivity since it can be an empty Seq. Is there a easy way to make that way?

Otherwise, if your database is already populated, you can update the small index by running the data / run subIndex task. And if it is not then you can populate it using the main branch then run data / run subIndex in your branch.

adpi2 avatar Apr 27 '22 12:04 adpi2

Thank you! I could solve all the blocking issues, so I should be done (finally) with the PR.

The last thing is I cannot reproduce the failling integration test. I ran several times infra / IntegrationTest / test, but the getCommitActivity test always succeeds. Not sure how to solve this issue.

joke1196 avatar May 25 '22 13:05 joke1196

The last thing is I cannot reproduce the failling integration test. I ran several times infra / IntegrationTest / test, but the getCommitActivity test always succeeds. Not sure how to solve this issue.

It could be that the Github token of the CI does not have the right to read the commit activity of the Scalafix project. But when I rerun the CI the test passed so it is a bit mysterious.

adpi2 avatar May 27 '22 13:05 adpi2

I deployed this PR in the dev environment and the result can be seen here: https://index-dev.scala-lang.org/

It will take some time to download all the commit activity.

adpi2 avatar May 27 '22 13:05 adpi2

@joke1196 this is a great contribution! I really like the look of the sparkline in the project page. There are a few things that we may want to add before merging this. Here are my suggestions:

1. Graph legend

The sparkline is a great idea and the look is beautiful but currently there is no legend so it is impossible to know what it represents and the scale of it.

I would recommend to add a title and legend that look like this: github-activity-2

2. Search and Awesome Scala

In the search page and the awesome Scala page, my feeling is that the the Github activity graph takes too much place. I think it should rather be a single stats, like the number of stars or the number of contributors. Getting the inspiration from the good old awesome-scala repository, we could simply use the total number of commits per year. This would appear as a regular stat in the project result box:

search-result

It is good to have the detailed activity week by week in the Project entity, however, in the ProjectDocument entity I would only put the simpler field commitsPerYear: Int. Later we could use this field in the scoring fnuction of the search page and awesome page to give better score to the most active Scala projects.

Thanks again for your contribution. I'll make sure this is going to be released sooner rather than later. Please let me know how you stand about those 2 suggestions.

adpi2 avatar Jun 13 '22 12:06 adpi2

@adpi2 Great, glad that you like the overall look of it. So I was thinking more of it as a lifeline for the project this is why I didn't add any more information on the graph, in the sense that in a glimpse you get a feel if the repo is alive or just flatlining :). I could add some details of course; it would make a lot of sense on the project page. And sure for the search page and the awesome page, it is a good idea, it will declutter the UI a bit.

joke1196 avatar Jun 13 '22 14:06 joke1196

Oh yeah now I understand your idea of a lifeline. There is something similar in Github in the main page of an organization. For instance: https://github.com/com-lihaoyi.

So I still think we should have some details in the project page. For the other pages the scale of the vertical axis should be more or less constant so that a project with very few commits is almost completely flat. For instance in this search page the line of cats-retry should be flatter. It contains only one commit.

adpi2 avatar Jun 14 '22 11:06 adpi2

@adpi2 finally got to work on the chart. Tell me if this is ok for you. I went with the classical line chart approach.

joke1196 avatar Aug 11 '22 12:08 joke1196

Awesome @joke1196! I deployed the branch to the dev environment: https://index-dev.scala-lang.org/.

We should have all the commit_activity populated in about 9 hours.

adpi2 avatar Aug 12 '22 08:08 adpi2

Thank you for the review! I did the corrections as well as a small clean up.

joke1196 avatar Aug 17 '22 13:08 joke1196