Skip to content

[shared_preferences] Add shared preferences devtool #8494

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

Merged
merged 5 commits into from
Jan 24, 2025

Conversation

adsonpleal
Copy link
Contributor

This PR adds the shared_preferences_tool package. This package uses the devtools_extension tooling to create a tool for shared preferences. The idea of this PR came from @kenzieschmoll on this issue. Initially I've published this tool as a separate package, but this PR aims to bring the functionality to the main shared_preferences package. Once this PR gets merged I'll archive the shared_preferences_tools package.

shared_preferences_tools.mp4

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@adsonpleal
Copy link
Contributor Author

adsonpleal commented Jan 24, 2025

@tarrinneal @stuartmorgan @kenzieschmoll Reopening #8322.

Third time's a charm 😅.

Edit: registering the revert PR here.

We had to revert it due to the flutter version on the release workflow.

@@ -31,7 +31,7 @@ jobs:
# the change if it doesn't.
run: |
cd $HOME
git clone https://github.com/flutter/flutter.git --depth 1 -b 3.27.0 _flutter
git clone https://github.com/flutter/flutter.git --depth 1 -b 3.27.3 _flutter
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kenzieschmoll and @tarrinneal this is the only change from the previous PR.

Copy link
Contributor

@tarrinneal tarrinneal left a comment

Choose a reason for hiding this comment

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

I'll approve this again, but this is the last time! (hopefully)

@kenzieschmoll
Copy link
Member

Looks like the tests are timing out while running the package:web_benchmarks test:

https://ci.chromium.org/ui/p/flutter/builders/try/Linux_android%20custom_package_tests%20master/14595/overview

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8724845158964231313/+/u/Run_package_tests/custom_tests/stdout

Building Flutter web app (compiler: dart2wasm)...

Is there reason to believe that switching to Flutter version 3.27.3 would impact the build time for dart2wasm? @eyebrowsoffire

@stuartmorgan-g
Copy link
Contributor

Is there reason to believe that switching to Flutter version 3.27.3 would impact the build time for dart2wasm?

The change to release.yaml will only affect the post-submit release process; it cannot impact any presubmit tests.

@kenzieschmoll
Copy link
Member

Looks like they were just flakes. Everything is green now. Merging.

@kenzieschmoll kenzieschmoll merged commit 258f6dc into flutter:main Jan 24, 2025
78 checks passed
@adsonpleal
Copy link
Contributor Author

adsonpleal commented Jan 27, 2025

@kenzieschmoll and @stuartmorgan the release job failed with:

image

Maybe a re-run should be enough?

@stuartmorgan-g
Copy link
Contributor

It's already been re-run. I believe this is a very unfortunately timed out-of-band failure from the previous commit; once that's verified well need to revert that PR.

Once that's resolved I can do a quick revert/reland-without-changes on this so that we can run it through the release process successfully. (In theory we could manually publish, but since this is the first time any of this pre-publish system has been used I would strongly prefer to do it via CI the first time to validate that there are no other issues we haven't uncovered).

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 27, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Jan 27, 2025
flutter/packages@3d3ab7b...258f6dc

2025-01-24 adsonpleal@gmail.com [shared_preferences] Add shared
preferences devtool (flutter/packages#8494)
2025-01-24 tarrinneal@gmail.com [shared_preferences] update List<String>
encode/decode (flutter/packages#8335)
2025-01-24 engine-flutter-autoroll@skia.org Manual roll Flutter from
c1561a4 to c1ffaa9 (21 revisions) (flutter/packages#8498)
2025-01-24 stuartmorgan@google.com [ios_platform_images] Switch to
`loadImage` (flutter/packages#8216)
2025-01-24 mchudy@users.noreply.github.com [camera] Remove OCMock from
CameraExposureTests and CameraFocusTests (flutter/packages#8351)
2025-01-24 tarrinneal@gmail.com [shared_preferences] Tool for migrating
from legacy shared_preferences to shared_preferences_async
(flutter/packages#8229)
2025-01-23 stuartmorgan@google.com Revert "[shared_preferences] Add
shared preferences devtool" (flutter/packages#8493)
2025-01-23 20254485+kaboc@users.noreply.github.com [go_router] Fix
return type of current state getter to be non-nullable
(flutter/packages#8173)
2025-01-23 engine-flutter-autoroll@skia.org Manual roll Flutter from
b2f515f to c1561a4 (18 revisions) (flutter/packages#8491)
2025-01-23 tarrinneal@gmail.com [pigeon] fixes event channel dart
instance name usage and adds test (flutter/packages#8483)
2025-01-23 51104750+AffanShaikhsurab@users.noreply.github.com [go
_route] fragment parameter added (flutter/packages#8232)
2025-01-23 mchudy@users.noreply.github.com [in_app_purchase] Update
in_app_purchase_android version in in_app_purchase
(flutter/packages#8463)
2025-01-23 stuartmorgan@google.com [image_picker] Reference alternate
macOS implementations (flutter/packages#8487)
2025-01-23 32538273+ValentinVignal@users.noreply.github.com [rfw]
Activate leak testing (flutter/packages#8370)
2025-01-23 32538273+ValentinVignal@users.noreply.github.com
[video_player] Activate leak testing (flutter/packages#8379)
2025-01-23 engine-flutter-autoroll@skia.org Manual roll Flutter from
b9e86a5 to b2f515f (42 revisions) (flutter/packages#8482)
2025-01-23 olli.helenius@codemate.com [camera] Add API support query for
image streaming (app-facing) (flutter/packages#8422)
2025-01-23 engine-flutter-autoroll@skia.org Manual roll Flutter from
b9e86a5 to eb6af3d (13 revisions) (flutter/packages#8473)
2025-01-23 adsonpleal@gmail.com [shared_preferences] Add shared
preferences devtool (flutter/packages#8322)

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-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
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
@camsim99
Copy link
Contributor

@stuartmorgan catching up here on the red packages tree. What's the status of fixing the OOB?

@stuartmorgan-g
Copy link
Contributor

I haven't investigated further yet; the next step would be to see if the failure is fixed locally by pinning the previous version of shared_preferences_android, and if so, reverting that PR.

stuartmorgan-g pushed a commit that referenced this pull request Jan 28, 2025
auto-submit bot pushed a commit that referenced this pull request Jan 28, 2025
Reverts #8494

This is a revert in order to reland (as a revert of this revert) now that the out-of-band failure in shared preferences is resolved, so that the package can go through the CI release process to ensure that the new tooling for pre-publish builds is working correctly.
auto-submit bot pushed a commit that referenced this pull request Jan 28, 2025
Re-lands #8494 without changes, now that the unrelated failure is resolved. See #8515 for context.
auto-submit bot pushed a commit that referenced this pull request Jan 29, 2025
Re-re-lands #8494 with a change to remove `--ignored` from the `git status` check in the repo tooling `publish` command, which is what caused the `release` failure in the last landing. `pub publish` has ignored files in `.gitignore` for years, so there's no longer any value in checking that they don't exist.

I've verified that `publish --dry-run` passes locally with this change. Server-only check failures could still potentially cause another revert, but those can't be found other than the hard way.
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
This PR adds the shared_preferences_tool package. This package uses the
[devtools_extension](https://pub.dev/packages/devtools_extensions)
tooling to create a tool for shared preferences. The idea of this PR
came from @kenzieschmoll on this
[issue](flutter/flutter#145433). Initially
I've published this tool as a [separate
package](https://pub.dev/packages/shared_preferences_tools), but this PR
aims to bring the functionality to the main shared_preferences package.
Once this PR gets merged I'll archive the `shared_preferences_tools`
package.


https://github.com/flutter/packages/assets/11666470/fcf71145-c330-4397-b62e-c0c4c8bc9f01


## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [relevant style guides] and ran the
auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages
repo does use `dart format`.)
- [X] I signed the [CLA].
- [X] The title of the PR starts with the name of the package surrounded
by square brackets, e.g. `[shared_preferences]`
- [X] I [linked to at least one issue that this PR fixes] in the
description above.
- [X] I updated `pubspec.yaml` with an appropriate new version according
to the [pub versioning philosophy], or this PR is [exempt from version
changes].
- [X] I updated `CHANGELOG.md` to add a description of the change,
[following repository CHANGELOG style].
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/packages/blob/main/CONTRIBUTING.md
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[relevant style guides]:
https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[linked to at least one issue that this PR fixes]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[pub versioning philosophy]: https://dart.dev/tools/pub/versioning
[exempt from version changes]:
https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#version-and-changelog-updates
[following repository CHANGELOG style]:
https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changelog-style
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
…#8515)

Reverts flutter#8494

This is a revert in order to reland (as a revert of this revert) now that the out-of-band failure in shared preferences is resolved, so that the package can go through the CI release process to ensure that the new tooling for pre-publish builds is working correctly.
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
…8519)

Re-lands flutter#8494 without changes, now that the unrelated failure is resolved. See flutter#8515 for context.
androidseb pushed a commit to androidseb/packages that referenced this pull request Jun 8, 2025
…8531)

Re-re-lands flutter#8494 with a change to remove `--ignored` from the `git status` check in the repo tooling `publish` command, which is what caused the `release` failure in the last landing. `pub publish` has ignored files in `.gitignore` for years, so there's no longer any value in checking that they don't exist.

I've verified that `publish --dry-run` passes locally with this change. Server-only check failures could still potentially cause another revert, but those can't be found other than the hard way.
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
This PR adds the shared_preferences_tool package. This package uses the
[devtools_extension](https://pub.dev/packages/devtools_extensions)
tooling to create a tool for shared preferences. The idea of this PR
came from @kenzieschmoll on this
[issue](flutter/flutter#145433). Initially
I've published this tool as a [separate
package](https://pub.dev/packages/shared_preferences_tools), but this PR
aims to bring the functionality to the main shared_preferences package.
Once this PR gets merged I'll archive the `shared_preferences_tools`
package.


https://github.com/flutter/packages/assets/11666470/fcf71145-c330-4397-b62e-c0c4c8bc9f01


## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [relevant style guides] and ran the
auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages
repo does use `dart format`.)
- [X] I signed the [CLA].
- [X] The title of the PR starts with the name of the package surrounded
by square brackets, e.g. `[shared_preferences]`
- [X] I [linked to at least one issue that this PR fixes] in the
description above.
- [X] I updated `pubspec.yaml` with an appropriate new version according
to the [pub versioning philosophy], or this PR is [exempt from version
changes].
- [X] I updated `CHANGELOG.md` to add a description of the change,
[following repository CHANGELOG style].
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/packages/blob/main/CONTRIBUTING.md
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[relevant style guides]:
https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[linked to at least one issue that this PR fixes]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[pub versioning philosophy]: https://dart.dev/tools/pub/versioning
[exempt from version changes]:
https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#version-and-changelog-updates
[following repository CHANGELOG style]:
https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changelog-style
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
…#8515)

Reverts flutter#8494

This is a revert in order to reland (as a revert of this revert) now that the out-of-band failure in shared preferences is resolved, so that the package can go through the CI release process to ensure that the new tooling for pre-publish builds is working correctly.
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
…8519)

Re-lands flutter#8494 without changes, now that the unrelated failure is resolved. See flutter#8515 for context.
FMorschel pushed a commit to FMorschel/packages that referenced this pull request Jun 9, 2025
…8531)

Re-re-lands flutter#8494 with a change to remove `--ignored` from the `git status` check in the repo tooling `publish` command, which is what caused the `release` failure in the last landing. `pub publish` has ignored files in `.gitignore` for years, so there's no longer any value in checking that they don't exist.

I've verified that `publish --dry-run` passes locally with this change. Server-only check failures could still potentially cause another revert, but those can't be found other than the hard way.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants