GithubHelp home page GithubHelp logo

fastruby / skunk.fyi Goto Github PK

View Code? Open in Web Editor NEW
6.0 7.0 1.0 498 KB

An application to share your SkunkScore results

Home Page: https://skunk.fastruby.io

Ruby 63.94% JavaScript 6.06% SCSS 3.44% HTML 26.57%
skunk-score code-quality ruby-on-rails-6 tech-debt

skunk.fyi's Introduction

skunk.fyi

This project is a place to share skunk data for all your projects

Getting Started

You can locally setup this Rails application by calling this command:

./bin/setup

Environment Variables

You will be able to configure the application by changing the variables in the .env file:

  • ADMIN_USERNAME: Username for basic http authentication
  • ADMIN_PASSWORD: Password for basic http authentication

Submitting Data

In order to submit data to your local instance, you can do it like this:

SHARE_URL=http://localhost:3000 bundle exec skunk

Start the server

Run the command:

rails s

If gems or node packages are missing, run:

bundle install
yarn install

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/fastruby/skunk.fyi. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

When Submitting a Pull Request:

  • If your PR closes any open GitHub issues, please include Closes #XXXX in your comment

  • Please include a summary of the change and which issue is fixed or which feature is introduced.

  • If changes to the behavior are made, clearly describe what changes.

  • If changes to the UI are made, please include screenshots of the before and after.

Sponsorship

FastRuby.io | Rails Upgrade Services

Skunk.fyi is maintained and funded by FastRuby.io. The names and logos for FastRuby.io are trademarks of The Lean Software Boutique LLC.

skunk.fyi's People

Contributors

arielj avatar bronzdoc avatar dependabot[bot] avatar etagwerker avatar fionadl avatar kindoflew avatar kostiantynpopovych avatar lubc avatar mateusdeap avatar rahulpuroht avatar rdormer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

rahulpuroht

skunk.fyi's Issues

[BUG] Upgrade Node.js version

IMPORTANT: please make sure you ask yourself all intro questions and fill all sections of the template.

Before we start...:

  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)

Branch/Commit:

Using the latest commit 157b6c3

Expected behavior:

To pay tech debt, let's use the next LTS (Node.js v20)

Actual behavior:

I noticed we are using a deprecated Node.js version, and we should update it for security purposes and still having Node.js support

Steps to reproduce:

How do I achieve this behavior? Use the following format to provide a step-by-step guide:

  1. Install node v20
  2. update the package.json to use v20
  3. npm install -g yarn
  4. yarn install
  5. it might fail or not, solve the issues if any.
  6. run tests, All should pass
  7. Run the app, it should start rails server

Context and environment:

Provide any relevant information about your setup (Customize the list accordingly based on what info is relevant to this project)

  1. Version of the software the issue is being opened for.
  2. Operating System
  3. Operating System version
  4. Browser
  5. Browser version
  6. Device
  7. Firmware version
  8. SDK version
  9. Toolchain version

Delete any information that is not relevant.

If you are unable to reproduce the bug, add the Non-Reproducible tag and describe the steps you followed leading to the bug to the best of your recollection.

Screenshots and Videos

If the issue has an effect in the frontend, include any relevant screenshots and videos here.

Logs

Include relevant log snippets or files here.

I will abide by the code of conduct

[REQUEST] I want to see my skunk score average over time (for a particular project)

Before we start...:

  • I checked the documentation and didn't find this feature
  • I checked to make sure that this feature has not already been requested

Branch/Commit:

In the main branch.

Problem:

Please include a detailed description of the problem this feature would solve.

As a skunk user
I want to see the progress of my skunk score average over time
So that I can track whether my project is getting better or worse ("tech debt"-wise)

Mockups:

Not really a mockup but you can see a slide where I show this idea over here: https://speakerdeck.com/etagwerker/escaping-the-tar-pit-at-socrates?slide=139

Notes:

We will need a new page that will be a "project view" (this depends on #30) which will have to live here: https://skunk.fastruby.io/projects/:project_name

I will abide by the [code of conduct] (https://github.com/fastruby/skunk.fyi/blob/main/CODE_OF_CONDUCT.md)

400 Bad Request when trying to share results via `SHARE=true skunk lib/`

I'm currently getting an error when trying to use the feature proposed here: fastruby/skunk#56

Started POST "/reports" for ::1 at 2020-11-13 11:59:51 -0500
Processing by ReportsController#create as */*
  Parameters: {"{\"entries\":\" ----------------------------------------------------- ---------------- ------------------ -------------- -------------- -------------- \\n| file                                                | skunk_score    | churn_times_cost | churn        | cost         | coverage     |\\n ----------------------------------------------------- ---------------- ------------------ -------------- -------------- -------------- \\n| lib/skunk/share.rb                                  | 115.68         | 1.16             | 1            | 1.16         | 0.0          |\\n| lib/skunk/cli/commands/compare_score.rb             | 62.8           | 1.26             | 2            | 0.63         | 0.0          |\\n| lib/skunk/cli/commands/compare.rb                   | 26.4           | 20.74            | 11           | 1.89         | 86.36        |\\n| lib/skunk/cli/options/argv.rb                       | 16.33          | 8.98             | 11           | 0.82         | 80.95        |\\n| lib/skunk/cli/commands/status_reporter.rb           | 8.96           | 47.78            | 16           | 2.99         | 97.44        |\\n| lib/skunk/cli/commands/version.rb                   | 8.8            | 0.44             | 5            | 0.09         | 0.0          |\\n| lib/skunk/cli/command_factory.rb                    | 8.3            | 1.46             | 3            | 0.49         | 83.33        |\\n| lib/skunk/cli/application.rb                        | 6.86           | 16.67            | 17           | 0.98         | 93.1         |\\n| lib/skunk/rubycritic/analysed_modules_collection.rb | 4.96           | 1.52             | 4            | 0.38         | 87.5         |\\n| lib/skunk/cli/commands/base.rb                      | 2.26           | 0.3              | 3            | 0.1          | 77.78        |\\n| lib/skunk/rubycritic/analysed_module.rb             | 0.93           | 7.43             | 8            | 0.93         | 100.0        |\\n| lib/skunk/cli/options.rb                            | 0.68           | 6.8              | 10           | 0.68         | 100.0        |\\n| lib/skunk/cli/commands/default.rb                   | 0.63           | 3.17             | 5            | 0.63         | 100.0        |\\n| lib/skunk/cli/commands/output.rb                    | 0.09           | 0.09             | 1            | 0.09         | 100.0        |\\n| lib/skunk/version.rb                                | 0.0            | 0.0              | 9            | 0.0          | 0.0          |\\n| lib/skunk/cli/commands/help.rb                      | 0.0            | 0.0              | 3            | 0.0          | 100.0        |\\n| lib/skunk.rb                                        | 0.0            | 0.0              | 4            | 0.0          | 100.0        |\\n ----------------------------------------------------- ---------------- ------------------ -------------- -------------- -------------- \\n\\nSkunkScore Total: 263.68\\nModules Analysed: 17\\nSkunkScore Average: 15.51\\nWorst SkunkScore: 115.68 (lib/skunk/share.rb)\\n\\nGenerated with Skunk v0.4.2\\n\",\"options\":{\"compare\":\"false\"}}"=>nil}
Completed 400 Bad Request in 0ms (ActiveRecord: 0.0ms | Allocations: 105)

[BUG] Exit status is not 0 when the skunk score improved

Branch/Commit:

Version 0.5.2.

Expected behavior:

When comparing 2 branches, if the new branch has a better skunk score above the threshold, the exit status of the command should be 0 so it's not considered a failure.

Actual behavior:

When the score improves above the threshold, the exit status is non-zero so it's considered a failure in CI.

From this PR https://github.com/fastruby/skunk.fyi/actions/runs/6655872886/job/18087134376?pr=103

image

Steps to reproduce:

Run the compare command for a new PR improving the skunk score average by more than the threshold.

I will abide by the code of conduct

reports#show is raising a NoMethodError

When you try to view a report (using reports#show) then the app is raising a NoMethodError:

2020-11-15T15:27:37.789909+00:00 heroku[router]: at=info method=GET path="/2" host=skunk.fastruby.io request_id=e95f0567-a6fb-4142-8dc4-6b4ee6fe23f9 fwd="69.253.239.22" dyno=web.1 connect=1ms service=20ms status=500 bytes=1827 protocol=https
2020-11-15T15:27:37.785233+00:00 app[web.1]: I, [2020-11-15T15:27:37.785139 #4]  INFO -- : [e95f0567-a6fb-4142-8dc4-6b4ee6fe23f9] Completed 500 Internal Server Error in 9ms (ActiveRecord: 1.5ms | Allocations: 883)
2020-11-15T15:27:37.787598+00:00 app[web.1]: F, [2020-11-15T15:27:37.787529 #4] FATAL -- : [e95f0567-a6fb-4142-8dc4-6b4ee6fe23f9]
2020-11-15T15:27:37.787598+00:00 app[web.1]: [e95f0567-a6fb-4142-8dc4-6b4ee6fe23f9] NoMethodError (undefined method `/' for nil:NilClass):
2020-11-15T15:27:37.787599+00:00 app[web.1]: [e95f0567-a6fb-4142-8dc4-6b4ee6fe23f9]
2020-11-15T15:27:37.787600+00:00 app[web.1]: [e95f0567-a6fb-4142-8dc4-6b4ee6fe23f9] app/helpers/reports_helper.rb:31:in `stddev_percentage'
2020-11-15T15:27:37.787600+00:00 app[web.1]: [e95f0567-a6fb-4142-8dc4-6b4ee6fe23f9] app/controllers/reports_controller.rb:69:in `block in show'
2020-11-15T15:27:37.787601+00:00 app[web.1]: [e95f0567-a6fb-4142-8dc4-6b4ee6fe23f9] app/controllers/reports_controller.rb:63:in `each'
2020-11-15T15:27:37.787601+00:00 app[web.1]: [e95f0567-a6fb-4142-8dc4-6b4ee6fe23f9] app/controllers/reports_controller.rb:63:in `show'

rake should default to rake test and run the test suite

Unfortunately it seems that there is something missing:

bundle exec rake
rake aborted!
Don't know how to build task 'default' (See the list of available tasks with `rake --tasks`)
/Users/etagwerker/.rvm/rubies/ruby-2.7.1/bin/bundle:23:in `load'
/Users/etagwerker/.rvm/rubies/ruby-2.7.1/bin/bundle:23:in `<main>'
/Users/etagwerker/.rvm/gems/ruby-2.7.1@skunk-fyi/bin/ruby_executable_hooks:24:in `eval'
/Users/etagwerker/.rvm/gems/ruby-2.7.1@skunk-fyi/bin/ruby_executable_hooks:24:in `<main>'
(See full trace by running task with --trace)

[REQUEST] As a skunk reporter I would like to send over my project id to keep track of skunk score history

Before we start...:

  • I checked the documentation and didn't find this feature
  • I checked to make sure that this feature has not already been requested

Branch/Commit:

main branch.

Problem:

As a skunk user
I want to submit my project ID
And I want to have skunk.fyi keep track of my reports and project ID
So that I can eventually see the progress of my skunk score average over time

Usage:

Skunk should be able to take another parameter to track my project ID. For example:

SHARE=true SKUNK_PROJECT=skunk.fyi bundle exec skunk app

I will abide by the [code of conduct] (https://github.com/fastruby/skunk.fyi/blob/main/CODE_OF_CONDUCT.md)

It shouldn't track `database.yml` file

To prevent conflicts, it should provide a database.yml.sample file but ignore the database.yml.

So:

  • It should have the file ignored in the .gitignore file
  • it should have a database.yml.sample file as reference
  • the bin/setup script should copy the sample file as database.yml

Skunk GitHub action fails on this repository

It seems to be an issue with an uncommitted file (Gemfile.lock)

17 gems installed
66
Executing within branch: HEAD
67
Uncommitted changes are present: :100644 000000 1f03a01d7625e3d76b6a485bd139438a288765d5 0000000000000000000000000000000000000000 D	Gemfile.lock
68
Error: Process completed with exit code 1.

We recently stopped tracking that file. I don't think we should add Gemfile.lock to the repository.

I wonder if there is a quick way to fix this action. This is related to #8

It would be great if IDs were alphanumeric and not easy to be guessed

Hey,

I'm not a big fan of using numeric ids. That is:

I think it would be great if we could automatically generate a slug that is alphanumeric. For example:

That way, users could have some privacy in terms of sharing their skunk information.

URLs would continue to be publicly accessible, but unwanted visitors would have a harder time guessing the slug. ๐Ÿ˜„

What do you think?

[BUG] reports#show raises a 500 error if report is not found

Before we start...:

  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I'm reporting the issue to the correct repository (for multi-repository projects)

Branch/Commit:

main branch

Expected behavior:

https://skunk.fastruby.io/report-not-found-123-id should return a 404 page.

Actual behavior:

https://skunk.fastruby.io/report-not-found-123-id returns a 500 page.

Steps to reproduce:

  1. Step 1: Enter a known to be not found id here: https://skunk.fastruby.io/
  2. Step 2: Watch it explode with a 500 error

Logs

2022-04-17T01:35:08.707346+00:00 app[web.1]: I, [2022-04-17T01:35:08.707271 #4]  INFO -- : [97c3e1cd-7230-4a08-adae-76491709aab1] Started GET "/sadkfhjkjshdf" for 71.224.18.32 at 2022-04-17 01:35:08 +0000
2022-04-17T01:35:08.708552+00:00 app[web.1]: I, [2022-04-17T01:35:08.708475 #4]  INFO -- : [97c3e1cd-7230-4a08-adae-76491709aab1] Processing by ReportsController#show as HTML
2022-04-17T01:35:08.708613+00:00 app[web.1]: I, [2022-04-17T01:35:08.708584 #4]  INFO -- : [97c3e1cd-7230-4a08-adae-76491709aab1]   Parameters: {"id"=>"sadkfhjkjshdf"}
2022-04-17T01:35:08.741814+00:00 app[web.1]: D, [2022-04-17T01:35:08.741723 #4] DEBUG -- : [97c3e1cd-7230-4a08-adae-76491709aab1]   Report Load (1.3ms)  SELECT "reports".* FROM "reports" WHERE "reports"."slug" = $1 LIMIT $2  [["slug", "sadkfhjkjshdf"], ["LIMIT", 1]]
2022-04-17T01:35:08.742498+00:00 app[web.1]: I, [2022-04-17T01:35:08.742442 #4]  INFO -- : [97c3e1cd-7230-4a08-adae-76491709aab1]   Rendering reports/show.html.erb within layouts/application
2022-04-17T01:35:08.743937+00:00 app[web.1]: I, [2022-04-17T01:35:08.743870 #4]  INFO -- : [97c3e1cd-7230-4a08-adae-76491709aab1]   Rendered reports/show.html.erb within layouts/application (Duration: 1.3ms | Allocations: 907)
2022-04-17T01:35:08.744126+00:00 app[web.1]: I, [2022-04-17T01:35:08.744085 #4]  INFO -- : [97c3e1cd-7230-4a08-adae-76491709aab1] Completed 500 Internal Server Error in 35ms (ActiveRecord: 11.7ms | Allocations: 3326)
2022-04-17T01:35:08.745267+00:00 app[web.1]: F, [2022-04-17T01:35:08.745211 #4] FATAL -- : [97c3e1cd-7230-4a08-adae-76491709aab1]
2022-04-17T01:35:08.745268+00:00 app[web.1]: [97c3e1cd-7230-4a08-adae-76491709aab1] ActionView::Template::Error (undefined method `data' for nil:NilClass):
2022-04-17T01:35:08.745269+00:00 app[web.1]: [97c3e1cd-7230-4a08-adae-76491709aab1]      8:       </tr>
2022-04-17T01:35:08.745269+00:00 app[web.1]: [97c3e1cd-7230-4a08-adae-76491709aab1]      9:     </thead>
2022-04-17T01:35:08.745270+00:00 app[web.1]: [97c3e1cd-7230-4a08-adae-76491709aab1]     10:     <tbody>
2022-04-17T01:35:08.745270+00:00 app[web.1]: [97c3e1cd-7230-4a08-adae-76491709aab1]     11:     <% @report.data.each do |part| %>
2022-04-17T01:35:08.745271+00:00 app[web.1]: [97c3e1cd-7230-4a08-adae-76491709aab1]     12:       <tr class="<%= cycle("odd", "even") %>">
2022-04-17T01:35:08.745271+00:00 app[web.1]: [97c3e1cd-7230-4a08-adae-76491709aab1]     13:         <% AnalyzedModule::KEYS.each do |value| %>
2022-04-17T01:35:08.745271+00:00 app[web.1]: [97c3e1cd-7230-4a08-adae-76491709aab1]     14:           <td class="<%= value %>-cell">
2022-04-17T01:35:08.745272+00:00 app[web.1]: [97c3e1cd-7230-4a08-adae-76491709aab1]
2022-04-17T01:35:08.745273+00:00 app[web.1]: [97c3e1cd-7230-4a08-adae-76491709aab1] app/views/reports/show.html.erb:11

I will abide by the code of conduct

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.