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 6 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.
  • 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.90%. Comparing base (4cf826e) to head (c0db21d).
Report is 5 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #996      +/-   ##
===========================================
+ Coverage    91.82%   91.90%   +0.08%     
===========================================
  Files           74       75       +1     
  Lines         1052     1063      +11     
===========================================
+ Hits           966      977      +11     
  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
name: Unlighthouse reports

on:
workflow_dispatch:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be changed on:

  workflow_run:
    workflows:
      - CD
    types:
      - completed

  pull_request:
    branches:
      - develop
      - master
    types:
      - closed

  release:
    types:
      - published

after all checks

@NVMakarenko NVMakarenko linked an issue Dec 1, 2024 that may be closed by this pull request
1 task
@NVMakarenko NVMakarenko added the Improvement Suggestion to make the product better label Dec 1, 2024
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