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

Move trends plots inside of "Custom" section #3404

Merged
merged 54 commits into from
Mar 20, 2023
Merged

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented Mar 6, 2023

1/3 main <= this <= #3466 <= #3491

Demo

Screen.Recording.2023-03-11.at.6.03.48.PM.mov

Part of #3373

@julieg18 julieg18 added the product PR that affects product label Mar 6, 2023
@julieg18 julieg18 self-assigned this Mar 6, 2023
extension/src/plots/model/collect.ts Outdated Show resolved Hide resolved
extension/src/plots/model/custom.ts Outdated Show resolved Hide resolved
extension/src/plots/model/collect.ts Outdated Show resolved Hide resolved
extension/src/plots/model/index.ts Outdated Show resolved Hide resolved
extension/resources/walkthrough/plots.md Outdated Show resolved Hide resolved
@@ -3,25 +3,31 @@ import omit from 'lodash.omit'
import isEmpty from 'lodash.isempty'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test coverage on the diff in this pull request is 91.2% (85% is the threshold).

I looked over the code and everything looked pretty covered. Any thing I could have missed to improve the coverage?

renderAppWithOptionalData({
checkpoint: checkpointPlotsFixture
comparison: comparisonTableFixture,
custom: customPlotsFixture
Copy link
Contributor Author

Choose a reason for hiding this comment

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

custom won't render currently without additional data. Planning to changing that and will adjust tests according.

@julieg18 julieg18 marked this pull request as ready for review March 12, 2023 00:33
@julieg18 julieg18 requested a review from mattseddon as a code owner March 12, 2023 00:33
@julieg18
Copy link
Contributor Author

julieg18 commented Mar 17, 2023

I believe #3404 (comment) has been resolved with #3466 and #3491 (both approved and ready to be merged into this pr)!

Here's a (hopefully complete) list of what's left:

Anything else that should get taken care of before we merge this? Or did I miss anything when I took care of merge conflicts?

@julieg18 julieg18 marked this pull request as ready for review March 17, 2023 21:49
@julieg18 julieg18 requested review from sroy3 and mattseddon March 17, 2023 21:49
Copy link
Contributor

@sroy3 sroy3 left a comment

Choose a reason for hiding this comment

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

I think you used to have something that blocked the following from happening before:

Screen.Recording.2023-03-20.at.8.46.26.AM.mov

Could be easy to just show the available choice from the list. (Can be a follow-up)

@julieg18
Copy link
Contributor Author

julieg18 commented Mar 20, 2023

I think you used to have something that blocked the following from happening before:
Could be easy to just show the available choice from the list. (Can be a follow-up)

Thanks for spotting that! Simple bug in the quick pick logic/tests that I missed earlier. Will fix it before merging since I'd prefer to stop users' custom plot state having copies of the same plot in it :) Will keep current logic for now and save choosing available choices for a followup.

@julieg18
Copy link
Contributor Author

Code climate seems to be failing with

ERROR: Coverage for lines (94.9%) does not meet global threshold (95%)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "cover:report" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: The process '/usr/bin/xvfb-run' failed with exit code 1
/home/runner/work/_actions/paambaati/codeclimate-action/v3.2.0/node_modules/@actions/exec/lib/toolrunner.js:592
                error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
                        ^

Error: The process '/usr/bin/xvfb-run' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/paambaati/codeclimate-action/v3.2.0/node_modules/@actions/exec/lib/toolrunner.js:592:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/paambaati/codeclimate-action/v3.2.0/node_modules/@actions/exec/lib/toolrunner.js:575:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/paambaati/codeclimate-action/v3.2.0/node_modules/@actions/exec/lib/toolrunner.js:469:27)
    at ChildProcess.emit (node:events:527:28)
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
Error: 🚨 Coverage run failed!

First guess is the issue is amount of lines being covered:

ERROR: Coverage for lines (94.9%) does not meet global threshold (95%)

Will see if upping the code coverage fixes the issue!

@julieg18
Copy link
Contributor Author

julieg18 commented Mar 20, 2023

Updated the tests based of code reviews and looking over things myself:

  • fixed pickMetric not being 100% covered
  • added tests for addCustomPlot and removeCustomPlot ending early due to user not selecting things
  • added additional tests for functions in custom.test.ts that appeared to be missing coverage

But code coverage is still failing just shy of 95%:

ERROR: Coverage for lines (94.96%) does not meet global threshold (95%)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "cover:report" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
/home/runner/work/_actions/paambaati/codeclimate-action/v3.2.0/node_modules/@actions/exec/lib/toolrunner.js:592
Error: The process '/usr/bin/xvfb-run' failed with exit code 1
                error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
                        ^
Error: The process '/usr/bin/xvfb-run' failed with exit code 1
    at ExecState._setResult (/home/runner/work/_actions/paambaati/codeclimate-action/v3.2.0/node_modules/@actions/exec/lib/toolrunner.js:592:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/paambaati/codeclimate-action/v3.2.0/node_modules/@actions/exec/lib/toolrunner.js:575:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/paambaati/codeclimate-action/v3.2.0/node_modules/@actions/exec/lib/toolrunner.js:469:27)
    at ChildProcess.emit (node:events:527:28)
    at maybeClose (node:internal/child_process:1092:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
Error: 🚨 Coverage run failed!

Last things I'm seeing regarding testing is:

  • Add tests for lines like this in collect.test.ts: exp.name || exp.label
  • Add tests for when user recreates the same custom plot

I'll start working on the followup on stopping a user from recreating custom plots since I think it will take about the same time as just creating tests for our current solution. But is there something else that could be going on with CodeClimate that I'm missing? cc @sroy3, @mattseddon

@sroy3
Copy link
Contributor

sroy3 commented Mar 20, 2023

I'll start working on the followup on stopping a user from recreating custom plots since I think it will take about the same time as just creating tests for our current solution. But is there something else that could be going on with CodeClimate that I'm missing? cc @sroy3, @mattseddon

We've merged too many things with low code coverage. We've pretty much hit the limit where we either get 100% coverage on a PR or else coverage will fail. I'll try to add coverage where it's missing if possible. Other than that, we have 2 other options from now on. Always hitting 100% coverage until the situation gets better or lower threshold to something lower (90%?).

@julieg18 julieg18 enabled auto-merge (squash) March 20, 2023 22:54
@codeclimate
Copy link

codeclimate bot commented Mar 20, 2023

Code Climate has analyzed commit 2945e34 and detected 5 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 2
Duplication 3

The test coverage on the diff in this pull request is 96.4% (85% is the threshold).

This pull request will bring the total coverage in the repository to 95.0%.

View more on Code Climate.

@julieg18 julieg18 merged commit 6cfade1 into main Mar 20, 2023
@julieg18 julieg18 deleted the move-trends-inside-custom branch March 20, 2023 23:09
@julieg18 julieg18 mentioned this pull request Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR that affects product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants