John "codefu" McDole 7da78cb7b8
fix: get content hash for master on local engine branches (third attempt) (#173169)
The content hash doesn't exist for local engine changes, except for on
CI. If we detect we're on a branch with committed or uncommitted changes
to engine files; use "master".

towards #171790

re-land attempt for #173114 (try 2)
re-land attempt for #172792 (original)

The first commit in this PR is the previously LGTM'd changes for the
above; with tests.

The second commit is the critical change to make this work in post
submits (fixes #173143). It turns out that while LUCI reports the GitHub
private branches; our recipes directly checkout the git sha. This
matters because the content scripts couldn't determine the branch name
and the rev-parse was just HEAD. This lead the scripts down the
merge-base logic, which returns the previous commit.

A test was added specifically for this.

Alternatively to this change, we could have checked for LUCI_CONTEXT
being present in the environment. This is checked by Flutter tools in
some cases, but not by any other scripts in `bin/internal`. The downside
to checking HEAD: if you have a local branch with engine changes and you
move back a revision - `dart`/`flutter` invocations will generate the
hash for your local changes and fail.
2025-08-04 00:05:59 +00:00
..
2025-07-25 14:20:52 +00:00
2025-04-09 14:33:25 +00:00
2025-04-17 21:35:39 +00:00

This wiki is primarily aimed at engineers building or making contributions to Flutter.

If you are new to Flutter, then you will find more general information on the Flutter project, including tutorials and samples, on our website at flutter.dev. For specific information about Flutter's APIs, consider our API reference which can be found at the api.flutter.dev.

If you want to know what we're likely to do in the future, our roadmap may be of interest.

If you intend to contribute to Flutter, welcome! You are encouraged to start with our contributor guide, which helps onboard new team members. It points to the most relevant pages on this wiki. You are also invited to join our Discord server.

Index of notable sections