Skip to content

refactor the flutter-analyze try bot and downstream failure notifications #46075

Open

Description

@devoncarew

This is a meta issue to track work related to 1) adding more repositories to our flutter-analyze try bot, and 2) relax some of the analysis settings on the flutter/tests contributed tests repo. The general goal for these changes are to enable the analyzer team to be aware of breakages that their changes would cause, know which places will need to be forward patched to not impede the sdk -> flutter roll process, and to omit a class of issues from needing to be patched (to not break the roll process for some category of changes).

Currently most (all?) of the flutter/tests user contributed tests fail on any analysis change. However, the intent here is more to make sure that flutter is aware of breaking API changes. Below, I propose to change the tests to only fail on more severe analysis issues (errors or warnings). We may in the future make this more sophisticated - to leverage package:flutter_lints in some capacity to also fail on some set of lint warnings.

See #46063 for more context; https://github.com/flutter/tests/tree/master/registry for the flutter customer tests repo.

Activity

  1. added
    P1A high priority bug; for example, a single project is unusable or has many test failures
    area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).
    on May 19, 2021
  2. devoncarew commented on May 19, 2021

    @devoncarew
    ContributorAuthor

    cc @Hixie @goderbauer - if we can agree on some of the items above (wrt flutter/tests changes), I'll follow up with some PRs to flutter/tests

  3. goderbauer commented on May 19, 2021

    @goderbauer
    Contributor

    Is there an overview of what the analyzer considers an error or warning? I am curious to see what issues we would still catch for packages who have contributed tests to the tests repository.

  4. devoncarew commented on May 19, 2021

    @devoncarew
    ContributorAuthor

    Most actual issues related to an API refactoring would be error level severity issues. Lints and hints (essentially built-in lints) are info level severity. There are actually very few warning level severity items (there were more in the Dart 1 days).

    Lints can't emit warning level items, however, an analysis options file can later upgrade them to be warning level items for a project. I'll poke around for a list of the warning level items.

  5. devoncarew commented on May 19, 2021

    @devoncarew
    ContributorAuthor

    Adding the full set of analysis infos, warnings, and errors.

    infos.txt
    warnings.txt
    errors.txt

    And here's the set of warnings, inlined:

    analysis_option_deprecated
    camera_permissions_incompatible
    dead_null_aware_expression
    include_file_not_found
    included_file_warning
    invalid_dependency
    invalid_null_aware_operator
    invalid_null_aware_operator
    invalid_option
    invalid_override_different_default_values_named
    invalid_override_different_default_values_positional
    invalid_section_format
    missing_enum_constant_in_switch
    no_touchscreen_feature
    non_resizable_activity
    path_does_not_exist
    path_pubspec_does_not_exist
    permission_implies_unsupported_hardware
    setting_orientation_on_activity
    spec_mode_removed
    unnecessary_non_null_assertion
    unrecognized_error_code
    unsupported_chrome_os_feature
    unsupported_chrome_os_hardware
    unsupported_option_with_legal_value
    unsupported_option_with_legal_values
    unsupported_option_without_values
    unsupported_value
    
  6. goderbauer commented on May 19, 2021

    @goderbauer
    Contributor

    I couldn't find any documentation on these warnings. Does the presence of these may mean that your app doesn't compile/run anymore?

    In other words, I am fine with this proposal as long as we still get notified if we break packages in the tests repository in the sense that their code doesn't compile or run anymore.

  7. devoncarew commented on May 19, 2021

    @devoncarew
    ContributorAuthor

    I removed some of the warnings for pubspec files and other non-dart files, and added in the descriptions:

    dead_null_aware_expression:
      https://dart.dev/tools/diagnostic-messages#dead_null_aware_expression
      The left operand can't be null, so the right operand is never executed.
    
    invalid_null_aware_operator:
      https://dart.dev/tools/diagnostic-messages#invalid_null_aware_operator
      The receiver can't be null, so the null-aware operator '{0}' is unnecessary.
    
    invalid_null_aware_operator:
      https://dart.dev/tools/diagnostic-messages#invalid_null_aware_operator
      The receiver can't be null because of short-circuiting, so the null-aware operator '{0}' can't be used.
    
    invalid_override_different_default_values_named:
      Parameters can't override default values, this method overrides '{0}.{1}' where '{2}' has a different value.
    
    invalid_override_different_default_values_positional:
      Parameters can't override default values, this method overrides '{0}.{1}' where this positional parameter has a different value.
    
    missing_enum_constant_in_switch:
      https://dart.dev/tools/diagnostic-messages#missing_enum_constant_in_switch
      Missing case clause for '{0}'.
    
    unnecessary_non_null_assertion:
      https://dart.dev/tools/diagnostic-messages#unnecessary_non_null_assertion
      The '!' will have no effect because the receiver can't be null.
    
  8. devoncarew commented on May 19, 2021

    @devoncarew
    ContributorAuthor

    In other words, I am fine with this proposal as long as we still get notified if we break packages in the tests repository in the sense that their code doesn't compile or run anymore.

    Yes, that'll be the case - for those kinds of breakages, we'll emit error level issues.

  9. goderbauer commented on May 19, 2021

    @goderbauer
    Contributor

    Looking at that list, it would make sense to fail on errors and warnings. For example, if we add a new value to an existing enum (which presumably triggers missing_enum_constant_in_switch ) we'd want that to be treated as a breaking change.

  10. devoncarew commented on May 19, 2021

    @devoncarew
    ContributorAuthor

    If it's just that one code - missing_enum_constant_in_switch - I think I'd like to look to make this more restrictive in the future; to look to how we could switch to just using errors (promoting that warning to an error)?

    But I think we can tackle that as part of the 'come back and decide whether we want to change the flutter/tests analysis criteria' checkbox above. For now, just ignoring info level items sgtm.

  11. devoncarew commented on May 19, 2021

    @devoncarew
    ContributorAuthor

    A PR to flutter/tests to update the static analysis and the test guidance: flutter/tests#105. We may evolve the criteria we check on in the future (ignore warnings? use errors and a sub-set of package:flutter_lints?).

  12. self-assigned this
    on May 19, 2021
  13. devoncarew commented on May 20, 2021

    @devoncarew
    ContributorAuthor

    #46075 will update the flutter-analyze bot to also check the dartdoc samples.

  14. added
    P2A bug or feature request we're likely to work on
    and removed
    P1A high priority bug; for example, a single project is unusable or has many test failures
    on Jun 14, 2021
  15. removed their assignment
    on Nov 3, 2022
  16. added
    area-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.
    and removed on Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-dart-modelFor issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).customer-fluttertype-taskA well-defined stand-alone task

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions