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

frontend: apply prettier to cypress/webapp #417

Merged
merged 8 commits into from
Sep 24, 2021
Merged

frontend: apply prettier to cypress/webapp #417

merged 8 commits into from
Sep 24, 2021

Conversation

eh-am
Copy link
Collaborator

@eh-am eh-am commented Sep 23, 2021

Ran eslint and prettier against ALL files. That is so that everything is consistent (from js files to yamls)
This ends up breaking git blame (since I modified all files).
To solve that added a postinstall script that runs git config blame.ignoreRevsFile .git-blame-ignore-revs, which makes git blame ignore commits from the .git-blame-ignore-revs file.
Therefore, we require existing code to run yarn again.

Plus added husky and lint-staged integration. Which makes us run eslint and prettier to staged files when committing. That will guarantee all new modifications are formatted.

Also added a ci check to validate files have been formatted (let's say the husky hook didn't work for some reason).

@eh-am eh-am marked this pull request as draft September 23, 2021 13:06
@eh-am eh-am force-pushed the add-prettier branch 2 times, most recently from 489890d to 44ac4a7 Compare September 23, 2021 13:36
@codecov
Copy link

codecov bot commented Sep 23, 2021

Codecov Report

Merging #417 (0a59432) into main (ec880c5) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #417   +/-   ##
=======================================
  Coverage   50.85%   50.85%           
=======================================
  Files         125      125           
  Lines        5710     5710           
=======================================
  Hits         2903     2903           
  Misses       2528     2528           
  Partials      279      279           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec880c5...0a59432. Read the comment docs.

@pyroscopebot
Copy link
Collaborator

pyroscopebot commented Sep 23, 2021

Parameters

Details
Name Value
BENCH_RUN_FOR 10m
PYROBENCH_RAND_SEED 2306912
PYROBENCH_PROFILE_WIDTH 20
PYROBENCH_PROFILE_DEPTH 20
PYROBENCH_PROFILE_SYMBOL_LENGTH 30
PYROBENCH_APPS 20
PYROBENCH_CLIENTS 20
PYROBENCH_REQUESTS 10000

Result

main pr diff threshold
throughput 163.84 164.05 0.21 (0.13%) 5%
total items processed 126249.00 126690.00 441.00 (0.35%) 5%
Details
Name Description Query for main Query for pr
throughput rate(pyroscope_http_request_duration_seconds_count{handler="/ingest", instance="pyroscope:4040"}[5m]) rate(pyroscope_http_request_duration_seconds_count{handler="/ingest", instance="pyroscope_main:4040"}[5m])
total items processed pyroscope_http_request_duration_seconds_count{handler="/ingest", instance="pyroscope:4040"} pyroscope_http_request_duration_seconds_count{handler="/ingest", instance="pyroscope_main:4040"}

Screenshots

Throughput Throughput
Disk Usage Disk Usage
Memory Memory
Upload Errors (Total) Upload Errors (Total)
Successful Uploads (Total) Successful Uploads (Total)
CPU Utilization CPU Utilization

Generated by 🚫 dangerJS against 01c9a8b

idea here is to run eslint + prettier
against staged files
so that nothing broken is pushed

frontend: add cypress eslint plugin

frontend: reformat more files
@@ -1,13 +1,13 @@
import { BAR_HEIGHT } from '../../webapp/javascript/components/FlameGraph/FlameGraphComponent/index.jsx'
import { BAR_HEIGHT } from '../../webapp/javascript/components/FlameGraph/FlameGraphComponent';
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this cause a problem or is the /index.jsx not needed?

Copy link
Collaborator Author

@eh-am eh-am Sep 23, 2021

Choose a reason for hiding this comment

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

That's an eslint error

Unexpected use of file extension "jsx" for "../../webapp/javascript/components/FlameGraph/FlameGraphComponent/index.jsx"  import/extensions

We weren't catching it before because our lint rule was only applied to js/jsx files (this one is a ts file).

But overall it's not needed, AFAIK all tools follow the convention that foo/index.{js,jsx,ts,tsx} equals to /foo

@eh-am
Copy link
Collaborator Author

eh-am commented Sep 23, 2021

retest this please

@eh-am eh-am marked this pull request as ready for review September 23, 2021 18:35
@github-actions github-actions bot requested a review from Rperry2174 September 23, 2021 18:35
Copy link
Member

@petethepig petethepig left a comment

Choose a reason for hiding this comment

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

@eh-am Thank you for doing this, this is great!

@petethepig petethepig merged commit fffac60 into main Sep 24, 2021
@petethepig petethepig deleted the add-prettier branch September 24, 2021 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants