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

CPLAT-13170 Analyze over_react examples without generated code #676

Conversation

sydneyjodon-wk
Copy link
Contributor

@sydneyjodon-wk sydneyjodon-wk commented Jan 26, 2021

Motivation

In order to verify that there are no edge cases we missed in the new boilerplate, we need to run analysis in CI pre-build without the generated files checked in. Because pre-build analysis without generated files won't run cleanly in Dart 2.9 (because we can't ignore undefined_identifier errors), we can't run pre-build analysis on the whole repo so we will just run it on examples of each boilerplate.

Changes

  • 22ced1c / d1fbdd6 Stop checking in generated files in tests/examples where possible by updating build.yaml to build to cache.
  • 37d3493 Add missing ignore comments to tests/examples/web so that they will analyze cleanly without a build.
  • 2509241 Add examples of each boilerplate to the example directory.
  • 8d20eb9 Update GitHub actions to run pre-build analysis on the examples in Dart 2.7.2 and Dart 2.12.x (skipping Dart stable because this will fail on Dart >=2.9 and < 2.12)
    • As a part of this, update CI analysis check to run tuneup check for Dart 2.7 and dart analyze for Dart >2.10 because dartanalyzer doesn't use the analysis server and won't see the generated files (see discussion here)

Release Notes

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed
    • Steps from PR author:
      • Verify CI passes (for Dart 2.7.2 and Dart stable)
        • for Dart 2.7.2 CI, verify that:
          • the pre-build analysis step runs tuneup check on just example/boilerplate_versions
          • the post-build analysis step runs tuneup check on the whole project
        • for Dart stable CI, verify that:
          • the pre-build analysis step does not run analysis
          • the post-build analysis step runs dart analyze on the whole project
        • for Dart dev CI, verify that:
          • the pre-build analysis step runs dart analyze on just example/boilerplate_versions/mixin_based/dart_2_9_compatible
          • the pre-build analysis step passes
      • Serve example and verify that the boilerplate version testing page doesn't have any errors
    • Anything falling under manual testing criteria outlined in CONTRIBUTING.md

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Client Platform member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

@aviary-wf
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

@sydneyjodon-wk sydneyjodon-wk force-pushed the CPLAT-13170-analyze-without-generated-files branch from 8b7d195 to 22ced1c Compare January 29, 2021 00:08
@sydneyjodon-wk sydneyjodon-wk force-pushed the CPLAT-13170-analyze-without-generated-files branch from a3e59fb to 2509241 Compare January 29, 2021 22:22
@sydneyjodon-wk
Copy link
Contributor Author

It might be easier to review changes by commit (see changes in PR description)

@sydneyjodon-wk sydneyjodon-wk marked this pull request as ready for review February 1, 2021 16:39
@sydneyjodon-wk sydneyjodon-wk changed the title CPLAT-13170 Analyze over_react examples/tests without generated code CPLAT-13170 Analyze over_react examples without generated code Feb 1, 2021
Copy link
Contributor

@joebingham-wk joebingham-wk left a comment

Choose a reason for hiding this comment

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

This looks great to me! I also don't know builders super well though, so the config options are a little beyond me haha

Copy link
Contributor

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

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

Changes look great! Just one small comment.

I also noticed that the dev build is actually failing and not getting to the post-analysis step :/, which would be really nice to have running.

It looks like the build_vm_compilers|entrypoint builder might be the culprit. It only serves as an optimization when running VM tests, and isn't required; could you try removing that?

It should involve just removing (or maybe commenting out since we will probably want to turn it back on at some point) the build_vm_compilers|entrypoint section of build.yaml, and also removing the build_vm_compilers dep from pubspec.yaml.

build.yaml Outdated Show resolved Hide resolved
- name: Analyze example source (pre-build)
run: |
cd example/boilerplate_versions
if [ ${{ matrix.sdk }} = 'stable@2.7.2' ]; then pub global activate tuneup && tuneup check; fi
Copy link
Contributor

Choose a reason for hiding this comment

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

@sydneyjodon-wk since we're using the new "official" setup-dart GH action, you'll want to merge in the latest from the dart-2.9-boilerplate-wip branch, and then replace stable@2.7.2 with just 2.7.2 anywhere you've used it in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in 5f5a492

@greglittlefield-wf
Copy link
Contributor

@sydneyjodon-wk It looks like CI is failing due to outdated generated files, caused by merging in master :/

@sydneyjodon-wk
Copy link
Contributor Author

@greglittlefield-wf, fixed!

Copy link
Contributor

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

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

  • Changes look good (see one last comment)
  • CI runs analysis as expected for each version
  • CI passes except for known, unrelated failures in dev branch related to NNBD configuration
  • Examples look good

I was about to approve/QA, but I found one more small thing, sorry :(

.github/workflows/dart_ci.yml Show resolved Hide resolved
Co-authored-by: Greg Littlefield <greg.littlefield@workiva.com>
Copy link
Contributor

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

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

  • Changes look good (see one last comment)
  • CI runs analysis as expected for each version
  • CI passes except for known, unrelated failures in dev branch related to NNBD configuration
  • Examples look good

+10

@sydneyjodon-wk
Copy link
Contributor Author

@Workiva/release-management-p

Copy link

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

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

+1 from RM

@rmconsole4-wk rmconsole4-wk merged commit 0b1f3ab into dart-2.9-boilerplate-wip Feb 3, 2021
@rmconsole4-wk rmconsole4-wk deleted the CPLAT-13170-analyze-without-generated-files branch February 3, 2021 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants