Repository navigation
Move examples/api to packages/flutter/examples/api and fix CI errors - #190481
Conversation
There was a problem hiding this comment.
Code Review
This pull request relocates the examples/api directory to packages/flutter/examples/api and updates all associated CI configurations, labelers, analysis scripts, tests, and documentation to reflect this new path. The review feedback points out several incorrect path prefixes and relative paths introduced in .github/labeler.yml and dev/bots/analyze_snippet_code.dart that require correction.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request relocates the API examples from the root examples/api directory to packages/flutter/examples/api, updating various CI configurations, analyzer scripts, and tests to reflect the new path. The review feedback highlights potential Windows-specific path issues in check_code_samples.dart and its tests, where backslashes in paths on Windows could cause prefix matching and string comparison failures. Code suggestions are provided to normalize path separators to forward slashes.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request relocates the API examples from examples/api to packages/flutter/examples/api and updates the CI targets, labeler configuration, analysis scripts, snippet tools, and tests to use the new path. Feedback on the changes suggests skipping all File entities early in the cross-import checker loop to prevent type errors with non-Dart files, and normalizing paths to use forward slashes in the code sample tests to simplify the logic.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request relocates the API examples directory from examples/api to packages/flutter/examples/api and updates associated CI configurations, analysis tools, tests, and documentation to reflect the new path. Feedback suggests checking if the API documentation directory exists before adding it to the list of example files to prevent potential runtime exceptions.
navaronbracke
left a comment
There was a problem hiding this comment.
LGTM, assuming the added reduced test set tags in the handful of tests are intentional.
Also, note for reviewers, Github does not seem to like the sheer size of the diff (even if 99% is moves/renames). The Github UI gets a little janky
|
Dashboard checks hit an infra failure it seems. And this'll also need an override label for the code freeze I suppose |
jtmcdole
left a comment
There was a problem hiding this comment.
The LGTM exchange rates are currently trading at:
- 1 LGTM = golden images match closely enough if I squint.
- 2 LGTMs = I checked that this won't break the devicelab benchmarks
- 3 LGTMs = I trust that this C++ pointer won't leak memory every frame.
- 4 LGTMs = CI is green on the first try without a single retry or shard failure
… whitelist (flutter#191025) In flutter#190481, the API docs were moved from `<repo_root>/examples/api` to `<repo_root>/packages/flutter/examples/api`. `flutter create` is typically forbidden within Flutter's repo except for a few whitelisted directories. With the aforementioned migration, the whitelist should include the new API doc package as well. ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Upstream master moved examples/api to packages/flutter/examples/api (flutter#190481) while this PR was open. Merging master in left this PR's two new files (added after that move, so not covered by its rename detection) stranded at the old, now-unused examples/api path. Move them to match every other example under the flutter_api_samples package. The `** See code in examples/api/... **` doc references in container.dart are unchanged: they're resolved relative to the package root, which is exactly what moved.
This PR moves API examples from
<root>/examples/apito<root>/packages/flutter/examples/api.This change is required because the standard dartdoc directive
{@example}requires API examples to reside within the package directory. For more details, see issue #189629 (item 1 under "What's needed").Summary of changes
Moved all API example files to
packages/flutter/examples/api.Updated related scripts and CI configurations to reflect the new directory structure.
examples/apitopackages/flutter/examples/api.<root>/examplesdirectory, are now split across two separate locations.Existing paths in
"See code in "directives are retained. These paths are now treated as relative to the package root rather than the repository root. For example, the following API doc comment remains valid despite the file move:Three API doc tests are now marked as
reduced-test-setbecause they're now facing additional analysis for being underpackages/flutter.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.