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

add unlighthouse scan after staging #996

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

NVMakarenko
Copy link
Contributor

@NVMakarenko NVMakarenko commented Nov 30, 2024

dev

Project

Code reviewers

Second Level Review

Summary of issue

Unlighthouse scanning should start after deployment to the stage. Reports upload as action artifacts.

Summary of change

  • Change cd.yml to scan site after staging.
  • reports chould be downloaded as artifacts.

image

  • add file to convert json report into csv file.
    image

CHECK LIST

  • СI passed
  • Сode coverage >=95%
  • PR is reviewed manually again (to make sure you have 100% ready code)
  • All reviewers agreed to merge the PR
  • PR meets all conventions

@NVMakarenko NVMakarenko self-assigned this Nov 30, 2024
@NVMakarenko NVMakarenko linked an issue Nov 30, 2024 that may be closed by this pull request
2 tasks
Copy link

codecov bot commented Nov 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.92%. Comparing base (4cf826e) to head (94c68ea).
Report is 15 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #996      +/-   ##
===========================================
+ Coverage    91.82%   91.92%   +0.09%     
===========================================
  Files           74       75       +1     
  Lines         1052     1065      +13     
===========================================
+ Hits           966      979      +13     
  Misses          86       86              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 34 to 35
- name: Set up Unlighthouse Scan
run: npm install -g @unlighthouse/cli puppeteer
Copy link
Collaborator

Choose a reason for hiding this comment

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

this report generation should be outside deploy action, with the same conditions, but that's another thing tather deploy


describe ".perform" do
it "converts JSON to CSV" do
ConvertJsonToCsv.perform(input_file, output_file)
Copy link
Collaborator

Choose a reason for hiding this comment

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

before hook

describe ".perform" do
it "converts JSON to CSV" do
ConvertJsonToCsv.perform(input_file, output_file)
csv_content = CSV.read(output_file, headers: true)
Copy link
Collaborator

Choose a reason for hiding this comment

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

use let


class ConvertJsonToCsv
def self.perform(input_file, output_file)
json_data = JSON.parse(File.read(input_file))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
json_data = JSON.parse(File.read(input_file))
json_data = JSON.parse(File.read(input_file))

Comment on lines 4 to 6
class ConvertJsonToCsv
def self.perform(input_file, output_file)
json_data = JSON.parse(File.read(input_file))
Copy link
Collaborator

Choose a reason for hiding this comment

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

write it as service object

Comment on lines 1 to 2
require "json"
require "csv"
Copy link
Collaborator

Choose a reason for hiding this comment

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

that should already present

def self.perform(input_file, output_file)
json_data = JSON.parse(File.read(input_file))
CSV.open(output_file, "w", write_headers: true, headers: json_data.first.keys) do |csv|
json_data.each { |row| csv << row.values }
Copy link
Collaborator

Choose a reason for hiding this comment

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

that would be fine to make link available to open

Copy link
Collaborator

Choose a reason for hiding this comment

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

if it's possible

Copy link
Collaborator

Choose a reason for hiding this comment

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

use rake task for this

@loqimean loqimean mentioned this pull request Dec 1, 2024
2 tasks
@NVMakarenko NVMakarenko linked an issue Dec 1, 2024 that may be closed by this pull request
1 task
@NVMakarenko NVMakarenko requested a review from loqimean December 1, 2024 20:13
@NVMakarenko NVMakarenko added the Improvement Suggestion to make the product better label Dec 1, 2024
@loqimean loqimean force-pushed the develop branch 3 times, most recently from 03a3caf to 7d2dc81 Compare December 2, 2024 12:04
end

it "initializes and calls the instance with the provided arguments" do
result = ConvertJsonToCsvService.call(input_file, output_file)
Copy link
Collaborator

Choose a reason for hiding this comment

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

ну я ж вам і не раз казав, НІКОЛИ не пишіть локал змінні в тестах

@NVMakarenko NVMakarenko requested a review from loqimean December 10, 2024 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Suggestion to make the product better
Projects
Status: Ready for review
Development

Successfully merging this pull request may close these issues.

Display Unlighthouse reports Improving the site and making additions
3 participants