Skip to content

Conversation

@mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Feb 10, 2023

Instead of returning an empty string, let's assert whenever the code is trying to get a filename for a non-file artifact. When this happens, it's most likely a bug in our logic that needs to be fixed, so an assertion seems more appropriate.

Depends on #120363

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Feb 10, 2023
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

case Artifact.windowsDesktopPath:
case Artifact.flutterToolsFileGenerators:
return '';
assert(false, 'No filename for a folder path, should not be invoked');
Copy link
Contributor

Choose a reason for hiding this comment

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

can we throw UnimplementedError()? asserts only run in unit tests, so if we have untested code paths I think it would be better to know about it.

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

change LGTM, I suppose it remains to be seen if we can get all the tests passing or if there was some workflow that depended on the empty strings

@mdebbar
Copy link
Contributor Author

mdebbar commented Feb 13, 2023

@mdebbar mdebbar closed this Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants