Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move snippets package back into flutter repo #147690

Merged
merged 6 commits into from May 3, 2024

Conversation

gspencergoog
Copy link
Contributor

Description

This moves the snippets package back into the Flutter repo so that API documentation generation can happen without the use of dart pub global run because pub run doesn't handle concurrency well.

The change modifies the dartdoc building process to include building an executable from the snippets tool and installing that in the cache directory for use during docs generation.

The snippets tool will reside in dev/snippets, where it originally resided before being moved to https://github.com/flutter/assets-for-api-docs.

The snippets code itself is unchanged from the code that is in https://github.com/flutter/assets-for-api-docs/packages/snippets.

Related Issues

Tests

  • Added snippets tests to the overall testing build.

Copy link
Contributor

@sigurdm sigurdm left a comment

Choose a reason for hiding this comment

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

Using global activate for running the documentation step was very messy to say the least. It modifies user-configuration to do a temporary setup.

I think there's more we can do for supporting concurrency with dart pub global run but I don't think it is the right solution for you.

An alternative to this PR if you want to keep snippets in a package would be to

  • make snippets a dev-dependency in dev/tools/pubspec.yaml,
  • compile it manually before running dartdoc.

Currently there is no really good way of resolving bin/<X>.dart given a package.
But it is not much more than searching package_config.json for the package name, and going relative from its rootUri.

@gspencergoog
Copy link
Contributor Author

  • make snippets a dev-dependency in dev/tools/pubspec.yaml.
  • compile it manually before running dartdoc.

Can you clarify what this would look like @sigurdm? I don't know what the command would be that would generate the executable from a dev dependency on the tool. Do I need to create a new dart package that has a executable: clause and that package depends on snippets? And why would it be a dev dependency and not a dependency?

Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM, but the analyzer is unhappy.

dev/bots/docs.sh Outdated Show resolved Hide resolved
dev/bots/docs.sh Outdated Show resolved Hide resolved
dev/bots/docs.sh Outdated Show resolved Hide resolved
dev/bots/test.dart Show resolved Hide resolved
dev/snippets/README.md Outdated Show resolved Hide resolved
dev/snippets/README.md Show resolved Hide resolved
dev/snippets/lib/snippets.dart Outdated Show resolved Hide resolved
@goderbauer
Copy link
Member

Can you also send a PR to delete the tool from https://github.com/flutter/assets-for-api-docs/tree/main/packages/snippets so we are not confused about the two copies?

Should we also mark https://pub.dev/packages/snippets as discontinued since we are probably not going to publish any new versions there?

@gspencergoog
Copy link
Contributor Author

Can you also send a PR to delete the tool from flutter/assets-for-api-docs@main/packages/snippets so we are not confused about the two copies?

Yes, will do.

Should we also mark pub.dev/packages/snippets as discontinued since we are probably not going to publish any new versions there?

Yes, that too.

@gspencergoog gspencergoog added the autosubmit Merge PR when tree becomes green via auto submit App label May 3, 2024
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 3, 2024
Copy link
Contributor

auto-submit bot commented May 3, 2024

auto label is removed for flutter/flutter/147690, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@gspencergoog gspencergoog added the autosubmit Merge PR when tree becomes green via auto submit App label May 3, 2024
@auto-submit auto-submit bot merged commit 183bc15 into flutter:master May 3, 2024
138 checks passed
@sigurdm
Copy link
Contributor

sigurdm commented May 3, 2024

Can you clarify what this would look like @sigurdm? I don't know what the command would be that would generate the executable from a dev dependency on the tool. Do I need to create a new dart package that has a executable: clause and that package depends on snippets? And why would it be a dev dependency and not a dependency?

Yeah - that's the trouble, I don't think we currently have a command that will do it. (Hopefully we'll get that soon)

More details:

I would

  • make snippets a dev-dependency in dev/tools/pubspec.yaml,
  • (in Dart code, in the docs script before running dartdoc)

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 3, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request May 3, 2024
flutter/flutter@bf7191f...f1037a0

2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 445c3bfc0d5b to 8cce00433073 (1 revision) (flutter/flutter#147778)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1f9edbeeceb3 to 445c3bfc0d5b (1 revision) (flutter/flutter#147776)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 75eb18090510 to 1f9edbeeceb3 (1 revision) (flutter/flutter#147769)
2024-05-03 108989782+drown0315@users.noreply.github.com Improved documentation for SpringSimulation (flutter/flutter#146674)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from b8d81a4f6e5a to 75eb18090510 (1 revision) (flutter/flutter#147766)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from d8c8cf4384f0 to b8d81a4f6e5a (2 revisions) (flutter/flutter#147765)
2024-05-03 gspencergoog@users.noreply.github.com Move snippets package back into flutter repo (flutter/flutter#147690)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 98a800b00cfc to d8c8cf4384f0 (2 revisions) (flutter/flutter#147763)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from c380e9fd4122 to 98a800b00cfc (3 revisions) (flutter/flutter#147761)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from fc71b650a70a to c380e9fd4122 (4 revisions) (flutter/flutter#147759)
2024-05-03 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#147741)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3f1f81915620 to fc71b650a70a (2 revisions) (flutter/flutter#147753)
2024-05-02 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5088f63ecee2 to 3f1f81915620 (3 revisions) (flutter/flutter#147748)
2024-05-02 yjbanov@google.com [web] skip debug mode CanvasKit e2e tests due to flakiness; unskip all other modes (flutter/flutter#147736)
2024-05-02 nate.w5687@gmail.com Control flow collections: `flutter_tools/` (flutter/flutter#147450)
2024-05-02 nate.w5687@gmail.com Add default arguments to `AnimatedPhysicalModel` (flutter/flutter#147424)
2024-05-02 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9982b5ffd913 to 5088f63ecee2 (3 revisions) (flutter/flutter#147740)
2024-05-02 31859944+LongCatIsLooong@users.noreply.github.com `_RenderDecorator.computeDryBaseline`  (flutter/flutter#146365)
2024-05-02 engine-flutter-autoroll@skia.org Roll Flutter Engine from e1126e59b698 to 9982b5ffd913 (1 revision) (flutter/flutter#147727)
2024-05-02 yjbanov@google.com [web] increase chromedriver logging level (flutter/flutter#147687)
2024-05-02 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1fb36ac9d718 to e1126e59b698 (1 revision) (flutter/flutter#147720)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC dit@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
vashworth pushed a commit to vashworth/packages that referenced this pull request May 6, 2024
…r#6641)

flutter/flutter@bf7191f...f1037a0

2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 445c3bfc0d5b to 8cce00433073 (1 revision) (flutter/flutter#147778)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1f9edbeeceb3 to 445c3bfc0d5b (1 revision) (flutter/flutter#147776)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 75eb18090510 to 1f9edbeeceb3 (1 revision) (flutter/flutter#147769)
2024-05-03 108989782+drown0315@users.noreply.github.com Improved documentation for SpringSimulation (flutter/flutter#146674)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from b8d81a4f6e5a to 75eb18090510 (1 revision) (flutter/flutter#147766)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from d8c8cf4384f0 to b8d81a4f6e5a (2 revisions) (flutter/flutter#147765)
2024-05-03 gspencergoog@users.noreply.github.com Move snippets package back into flutter repo (flutter/flutter#147690)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 98a800b00cfc to d8c8cf4384f0 (2 revisions) (flutter/flutter#147763)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from c380e9fd4122 to 98a800b00cfc (3 revisions) (flutter/flutter#147761)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from fc71b650a70a to c380e9fd4122 (4 revisions) (flutter/flutter#147759)
2024-05-03 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#147741)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3f1f81915620 to fc71b650a70a (2 revisions) (flutter/flutter#147753)
2024-05-02 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5088f63ecee2 to 3f1f81915620 (3 revisions) (flutter/flutter#147748)
2024-05-02 yjbanov@google.com [web] skip debug mode CanvasKit e2e tests due to flakiness; unskip all other modes (flutter/flutter#147736)
2024-05-02 nate.w5687@gmail.com Control flow collections: `flutter_tools/` (flutter/flutter#147450)
2024-05-02 nate.w5687@gmail.com Add default arguments to `AnimatedPhysicalModel` (flutter/flutter#147424)
2024-05-02 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9982b5ffd913 to 5088f63ecee2 (3 revisions) (flutter/flutter#147740)
2024-05-02 31859944+LongCatIsLooong@users.noreply.github.com `_RenderDecorator.computeDryBaseline`  (flutter/flutter#146365)
2024-05-02 engine-flutter-autoroll@skia.org Roll Flutter Engine from e1126e59b698 to 9982b5ffd913 (1 revision) (flutter/flutter#147727)
2024-05-02 yjbanov@google.com [web] increase chromedriver logging level (flutter/flutter#147687)
2024-05-02 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1fb36ac9d718 to e1126e59b698 (1 revision) (flutter/flutter#147720)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC dit@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
itsjustkevin pushed a commit to itsjustkevin/flutter that referenced this pull request May 8, 2024
This moves the snippets package back into the Flutter repo so that API documentation generation can happen without the use of `dart pub global run` because `pub run` doesn't handle concurrency well.

The change modifies the dartdoc building process to include building an executable from the snippets tool and installing that in the cache directory for use during docs generation.

The snippets tool will reside in dev/snippets, where it originally resided before being moved to https://github.com/flutter/assets-for-api-docs.

The snippets code itself is unchanged from the code that is in https://github.com/flutter/assets-for-api-docs/packages/snippets.

 - flutter#144408
 - flutter#147609
 - flutter#147645

 - Added snippets tests to the overall testing build.
TecHaxter pushed a commit to TecHaxter/flutter_packages that referenced this pull request May 22, 2024
…r#6641)

flutter/flutter@bf7191f...f1037a0

2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 445c3bfc0d5b to 8cce00433073 (1 revision) (flutter/flutter#147778)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1f9edbeeceb3 to 445c3bfc0d5b (1 revision) (flutter/flutter#147776)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 75eb18090510 to 1f9edbeeceb3 (1 revision) (flutter/flutter#147769)
2024-05-03 108989782+drown0315@users.noreply.github.com Improved documentation for SpringSimulation (flutter/flutter#146674)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from b8d81a4f6e5a to 75eb18090510 (1 revision) (flutter/flutter#147766)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from d8c8cf4384f0 to b8d81a4f6e5a (2 revisions) (flutter/flutter#147765)
2024-05-03 gspencergoog@users.noreply.github.com Move snippets package back into flutter repo (flutter/flutter#147690)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 98a800b00cfc to d8c8cf4384f0 (2 revisions) (flutter/flutter#147763)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from c380e9fd4122 to 98a800b00cfc (3 revisions) (flutter/flutter#147761)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from fc71b650a70a to c380e9fd4122 (4 revisions) (flutter/flutter#147759)
2024-05-03 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#147741)
2024-05-03 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3f1f81915620 to fc71b650a70a (2 revisions) (flutter/flutter#147753)
2024-05-02 engine-flutter-autoroll@skia.org Roll Flutter Engine from 5088f63ecee2 to 3f1f81915620 (3 revisions) (flutter/flutter#147748)
2024-05-02 yjbanov@google.com [web] skip debug mode CanvasKit e2e tests due to flakiness; unskip all other modes (flutter/flutter#147736)
2024-05-02 nate.w5687@gmail.com Control flow collections: `flutter_tools/` (flutter/flutter#147450)
2024-05-02 nate.w5687@gmail.com Add default arguments to `AnimatedPhysicalModel` (flutter/flutter#147424)
2024-05-02 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9982b5ffd913 to 5088f63ecee2 (3 revisions) (flutter/flutter#147740)
2024-05-02 31859944+LongCatIsLooong@users.noreply.github.com `_RenderDecorator.computeDryBaseline`  (flutter/flutter#146365)
2024-05-02 engine-flutter-autoroll@skia.org Roll Flutter Engine from e1126e59b698 to 9982b5ffd913 (1 revision) (flutter/flutter#147727)
2024-05-02 yjbanov@google.com [web] increase chromedriver logging level (flutter/flutter#147687)
2024-05-02 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1fb36ac9d718 to e1126e59b698 (1 revision) (flutter/flutter#147720)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC dit@google.com,rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants