Repository navigation
[pigeon] Rename and validate the native interop migration skill - #13531
reidbaker-agent wants to merge 6 commits into
Conversation
- Fail the skills test when validateSkills returns false. - Sort skills_lint among dev_dependencies and type the local. - Remove trailing blank line from pubspec.yaml. - Reword the CHANGELOG entry to describe the user-facing rename.
There was a problem hiding this comment.
Code Review
This pull request updates pigeon to version 29.1.1, renames the native-interop-migration skill to pigeon-native-interop-migration with YAML frontmatter, and adds skills_lint configuration along with a validation test. Feedback highlights a compatibility issue where adding skills_lint as a dev dependency and using it in tests breaks support for Dart SDK ^3.11.0, as skills_lint requires SDK >=3.12.0.
| # JNIgen's renamer, then update the version linked in its doc comment. | ||
| jnigen: 1.0.1 | ||
| objective_c: ^9.6.2 | ||
| skills_lint: ^0.5.3 |
There was a problem hiding this comment.
Adding skills_lint: ^0.5.3 as a dev dependency will break pub get for any developer using Dart 3.11, because skills_lint 0.5.3 requires Dart SDK >=3.12.0 while pigeon's SDK constraint is ^3.11.0. Since this is a patch release (29.1.1), bumping the SDK constraint to ^3.12.0 might not be desirable.\n\nTo resolve this, consider one of the following approaches:\n1. Remove skills_lint from dev_dependencies and remove test/validate_skills_test.dart. Instead, run skills_lint as a global tool or a separate step in the CI workflow (e.g., dart pub global run skills_lint).\n2. If a minor/major version bump is acceptable, bump the SDK constraint of pigeon to ^3.12.0 and release this as 29.2.0 or 30.0.0.
| test('validate skills', () async { | ||
| final Configuration config = await ConfigParser.loadConfig(); | ||
| // validateSkills returns true even if the config has parsing errors, so | ||
| // check those separately. | ||
| expect(config.parsingErrors, isEmpty); | ||
| final bool isValid = await validateSkills(config: config); | ||
| expect(isValid, isTrue, reason: 'Skills validation failed. See above for details.'); | ||
| }); |
There was a problem hiding this comment.
This test file imports package:skills_lint/skills_lint.dart, which requires Dart SDK >=3.12.0. Since pigeon supports Dart SDK ^3.11.0, this test will fail to compile/run for developers on Dart 3.11.\n\nIf you want to keep supporting Dart 3.11 without breaking pub get or test execution, consider removing this test file and validating the skills via a CI-based linter step instead (e.g., using dart pub global run skills_lint).
There was a problem hiding this comment.
@tarrinneal I dont like adding one off ci steps in this repo.
Let me know what you want to happen here.
There was a problem hiding this comment.
If you rebase, this should be resolved now.
One heads-up when rebasing SKILL.md: 30.0.0 added a relative link at the end of §6.11 (Step 5 of the Native Interop Guide) that leaves the skill directory and will fail check-relative-paths (within-skill: true). Switching that link to main/packages/pigeon/native_interop_guide.md#step-5-plugin-registration-deregistration-and-multi-engine-support during the rebase will keep validate_skills_test green.
| test('validate skills', () async { | ||
| final Configuration config = await ConfigParser.loadConfig(); | ||
| // validateSkills returns true even if the config has parsing errors, so | ||
| // check those separately. | ||
| expect(config.parsingErrors, isEmpty); | ||
| final bool isValid = await validateSkills(config: config); | ||
| expect(isValid, isTrue, reason: 'Skills validation failed. See above for details.'); | ||
| }); |
There was a problem hiding this comment.
@tarrinneal I dont like adding one off ci steps in this repo.
Let me know what you want to happen here.
| --- | ||
| name: pigeon-native-interop-migration | ||
| description: Migrates a Flutter plugin from channel-based Pigeon code to direct Native Interop (useFfi for Swift, useJni for Kotlin) | ||
| --- | ||
|
|
There was a problem hiding this comment.
@tarrinneal was this intended to be a skill that users could use? If not why have it in the skills directory. If so did anyone try using the skill?
There was a problem hiding this comment.
as mentioned offline, yes it is meant to be user facing.
| import 'package:test/test.dart'; | ||
|
|
||
| void main() { | ||
| test('validate skills', () async { |
There was a problem hiding this comment.
@tarrinneal longer term I think this repo should have one top level skills_lint.yaml but for now per package is easier to understand and can be adopted as skills get adopted across the repo.
There was a problem hiding this comment.
If I open the pigeon directory directly in an editor and try to access a skill at the repo level, will that work properly?
| void main() { | ||
| test('validate skills', () async { | ||
| final Configuration config = await ConfigParser.loadConfig(); | ||
| // validateSkills returns true even if the config has parsing errors, so |
There was a problem hiding this comment.
lets add the bug tracking this change in behavior. 0.6.0 plans to make this errorl
There was a problem hiding this comment.
Done in 28df556: the comment now links google/skills_lint.dart#152, which tracks making validateSkills fail on config errors in 0.6.0.
| severity: error | ||
| within-skill: true | ||
| check-absolute-paths: error | ||
| disallowed-field: error |
There was a problem hiding this comment.
lets sort the single line rules above the multi line rules+
There was a problem hiding this comment.
Done in 28df556: the single-line rules come first, then the check-relative-paths block.
| within-skill: true | ||
| check-absolute-paths: error | ||
| disallowed-field: error | ||
| check-trailing-whitespace: error |
There was a problem hiding this comment.
Removed check-trailing-whitespace in 28df556.
reidbaker
left a comment
There was a problem hiding this comment.
@tarrinneal you need to make the call on dart version 12 and if that is ok to bump or if we need to do something else.
|
Sorry for the delay on looking at this. It's been a busy couple weeks :) |
tarrinneal
left a comment
There was a problem hiding this comment.
Approved after a rebase
There was a problem hiding this comment.
Can we put this at the repo level?
|
Hi @reidbaker-agent, thank you for your contribution! This pull request has been converted to a draft because it does not appear to follow our pull request template:
How to fix this
Click here for the raw Markdown of the Pre-Review Checklist to copy and paste## Pre-Review 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] page, which explains my responsibilities.
- [ ] I read and followed the [relevant style guides] and ran [the auto-formatter].
- [ ] I signed the [CLA].
- [ ] The title of the PR starts with the name of the package surrounded by square brackets, e.g. `[shared_preferences]`
- [ ] I [linked to at least one issue that this PR fixes] in the description above.
- [ ] I followed [the version and CHANGELOG instructions], using [semantic versioning] and the [repository CHANGELOG style], or I have commented below to indicate which documented exception this PR falls under[^1].
- [ ] I updated/added any relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1].
- [ ] All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel on [Discord].
**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.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
<!-- Links -->
[Contributor Guide]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md
[AI contribution guidelines]: https://github.com/flutter/flutter/blob/master/CONTRIBUTING.ai.md#pull-requests
[Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md
[relevant style guides]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style
[the auto-formatter]: https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code
[CLA]: https://cla.developers.google.com/
[Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md
[linked to at least one issue that this PR fixes]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview
[the version and CHANGELOG instructions]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version-and-changelog-updates
[semantic versioning]: https://dart.dev/tools/pub/versioning#semantic-versions
[repository CHANGELOG style]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog-style
[test exemption]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests |
There was a problem hiding this comment.
Code Review
This pull request updates the pigeon package to version 30.0.5. The changes rename the 'native-interop-migration' skill to 'pigeon-native-interop-migration', add YAML frontmatter, and update a documentation link in SKILL.md. Additionally, the 'skills_lint' package is added as a development dependency, a configuration file 'skills_lint.yaml' is introduced, and a new test file 'validate_skills_test.dart' is implemented to validate the skills configuration. There are no review comments, and I have no feedback to provide.
|
autosubmit label was removed for flutter/packages/13531, because This PR has not met approval requirements for merging. The PR author is not a member of flutter-hackers and needs 1 more review(s) in order to merge this PR.
|
|
@reidbaker This will need approval again after I merged main |
Update to skills_lint 0.5.3 and enable new configs for published skills.
Along the way we found that pigeon's published skill had no frontmatter and did not follow the package skill naming convention, so this fixes and renames it.
@reidbaker
Details
This PR makes the agent skill that
pigeonpublishes valid, and adds a test so it stays valid.Changes:
skills/native-interop-migrationtoskills/pigeon-native-interop-migration. Thepublished-skill-namerule requires a skill in a package'sskills/directory to start with the package name.nameanddescription) toSKILL.md, and removes one trailing space.skills_lint: ^0.5.3as a dev dependency and askills_lint.yamlthat enables these rules forskills/:pub-archive-includes-skill(new in 0.5.3): reports skill files thatdart pub publishwould leave out.check-relative-pathswithwithin-skill: true(new in 0.5.3): reports relative links that leave the skill directory.published-skill-name(since 0.5.2) andcheck-absolute-paths(both existed before 0.5.3).test/validate_skills_test.dart. It asserts thatvalidateSkillsreturnstrue. It also asserts thatconfig.parsingErrorsis empty, because the 0.5.3 CHANGELOG notes thatvalidateSkillsreturnstrueeven when the configuration has parsing errors.generator_tools.dart) and adds a CHANGELOG entry.This renames a published skill.
skills/native-interop-migrationhas shipped since pigeon 29.0.0. After this PR, it ships aspigeon-native-interop-migration, which is the namepackage:skillsexpects for a skill from thepigeonpackage (enforced bypublished-skill-name). Anyone who refers to the old name has to update. The oldSKILL.mdhad no frontmatter, so it may never have installed as a skill under the old name. If you would rather keep the old name, the alternative is to turn offpublished-skill-namefor pigeon.skills_lint 0.5.3 requires Dart 3.12 or later. pigeon still allows
sdk: ^3.11.0, so a developer on Dart 3.11 cannot runpub getfor pigeon's dev dependencies. CI is not affected: stable CI uses a newer Flutter, and the legacy analyze job removes dev dependencies first.No issue tracks this change. The template asks for at least one issue, and I have none to link.
This change was prepared with help from an AI agent. I reviewed it.
Verification, run locally against skills_lint 0.5.3 from pub.dev:
dart run script/tool/bin/flutter_plugin_tools.dart analyze --packages pigeon: no issues.dart run script/tool/bin/flutter_plugin_tools.dart format --packages pigeon --no-java --no-kotlin --no-swift --no-clang-format: no changes.dart run script/tool/bin/flutter_plugin_tools.dart validate --packages pigeon --check-for-missing-changes --base-sha=origin/main: no issues.dart run script/tool/bin/flutter_plugin_tools.dart license-check: all files pass.dart run script/tool/bin/flutter_plugin_tools.dart publish-check --packages pigeon:dart pub publish --dry-runreports 0 warnings from a clean tree.dart run skills_lintinpackages/pigeon: the skill is valid.dart testinpackages/pigeon: all 600 tests pass. With a mismatchednameinSKILL.md,test/validate_skills_test.dartfails.Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
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.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2