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-6056: Warn consumers if part directive is present but there's no generated output #302

Merged
merged 5 commits into from
Jun 11, 2019

Conversation

corwinsheahan-wf
Copy link
Contributor

@corwinsheahan-wf corwinsheahan-wf commented Jun 7, 2019

Motivation

In cases where an .over_react.g.dart part directive are included in a file where there are no generations, the consumer doesn't get any error or warning messages from this builder.

Changes

Log a warning when a part directive exists, but there is no output.

Release Notes

Review

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

Please review: @greglittlefield-wf @aaronlademann-wf @seanburke-wf

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed

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

@aviary3-wk
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.

@corwinsheahan-wf corwinsheahan-wf changed the title Warn consumers if part directive is present, but no generations were … Warn consumers if part directive is present bet there's no generated output Jun 10, 2019
@corwinsheahan-wf corwinsheahan-wf changed the title Warn consumers if part directive is present bet there's no generated output Warn consumers if part directive is present but there's no generated output Jun 10, 2019
@corwinsheahan-wf corwinsheahan-wf changed the title Warn consumers if part directive is present but there's no generated output CPLAT-6056: Warn consumers if part directive is present but there's no generated output Jun 10, 2019
@@ -90,6 +90,26 @@ main() {
reason: 'Expected a WARNING log for the missing over_react part.');
});

test('warns if .over_react.g.dart part directive is present and no delcarations are present, but no code is generated', () async {

Choose a reason for hiding this comment

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

#typo: "delcarations" -> "declarations"

log.warning('Missing "part \'$expectedPart\';".');
}

await _writePart(buildStep, outputId, outputs);
} else {
if (hasOutputPartDirective()) {
log.warning('An over react part directive was found in ${buildStep.inputId.path}, but no code was generated.');

Choose a reason for hiding this comment

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

It might be good to indicate potential causes of this so that the user can attempt to correct them. (E.g., "The part directive may be unnecessary if the file does not contain any concrete components.")

Co-Authored-By: Evan Weible <[email protected]>
@evanweible-wf
Copy link
Contributor

QA +1

  • Verified that WSD builds successfully with this branch

@evanweible-wf
Copy link
Contributor

@Workiva/release-management-p

@rm-astro-wf rm-astro-wf merged commit 663d9e0 into master Jun 11, 2019
@rm-astro-wf rm-astro-wf deleted the warn_missing_gen_has_part branch June 11, 2019 20:23
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