Repository navigation
fix: Limit how many projects are considered for version check validation on generate - #3273
Merged
nielsenko merged 24 commits intoMar 12, 2025
Conversation
nielsenko
force-pushed
the
fix-2762-symlink-windows-when-serverpod-generate
branch
6 times, most recently
from
March 6, 2025 07:46
559546f to
8240191
Compare
nielsenko
commented
Mar 6, 2025
nielsenko
force-pushed
the
fix-2762-symlink-windows-when-serverpod-generate
branch
2 times, most recently
from
March 6, 2025 08:06
eb62291 to
d155091
Compare
SandPod
reviewed
Mar 6, 2025
SandPod
left a comment
Contributor
There was a problem hiding this comment.
Really neat cleanup and improvements of that part of the system!
It really feels like there were a couple of hot patches in that code that could be removed.
I have a couple of questions and comments, main focus is ensuring that we don't introduce unhandled crashes that we did not have before.
nielsenko
force-pushed
the
fix-2762-symlink-windows-when-serverpod-generate
branch
2 times, most recently
from
March 10, 2025 12:17
e0ea6c5 to
064eb9c
Compare
- Refactored the version check logic to use a new `PubspecPlus` class for better encapsulation and handling of pubspec files. - Updated the `validateServerpodPackagesVersion` function to work with the new `PubspecPlus` class. - Only check the generated server and client packages (this implicitly fix: 2762). - Removed outdated and redundant test assets.
- Moved the `PubspecPlus` class and related code from `serverpod_packages_version_check.dart` to a new file `pubspec_plus.dart`. - Updated imports in `serverpod_packages_version_check.dart` to reference the new `pubspec_plus.dart` file. - Introduce loadYamlMap function in `yaml_util.dart`. This will correctly parse an empty string as a map, when a map expected (defaults to YamlScalar).
This commit removes redundant tests from the serverpod_packages_version_check_test.dart file. The removed tests were checking all pubspec.yaml files below the test_assets directory, but version check no longer traverses the parent of the generated serverpod directory recursively, so the tests were redundant.
nielsenko
force-pushed
the
fix-2762-symlink-windows-when-serverpod-generate
branch
from
March 10, 2025 14:38
bb92ea8 to
51cd174
Compare
nielsenko
force-pushed
the
fix-2762-symlink-windows-when-serverpod-generate
branch
from
March 11, 2025 13:56
2977438 to
96152fd
Compare
SandPod
reviewed
Mar 12, 2025
SandPod
left a comment
Contributor
There was a problem hiding this comment.
Nice cleanup of the code!
A couple of comments and suggestions.
nielsenko
force-pushed
the
fix-2762-symlink-windows-when-serverpod-generate
branch
from
March 12, 2025 14:36
c46c216 to
2e0290a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR changes how
serverpod_clivalidates versions duringserverpod generate.Previously it would consider all pubspec.yaml files below the parent of the generated server project. This could potentially include a lot of projects, and is not needed.
It is important (for now) that the serverpod dependencies used between the generated server and client library match the version of
serverpod_cliexactly. We ensure that by pining the version, and haveserverpod generatecheck that the versions matches its own, and are still pinned. This guarantees that the generated code, and protocol matches.However we don't need to run this check on any other projects. If any other project (fx. the flutter project setup during
serverpod create) depends on the generated client, then normal package resolution will ensure that the project uses the same version, as it is pinned.This change came about while investigating #2762 . There is a known issue with
Directory.listSyncand friends on windows, when traversing directories containing symlinks.Flutter uses symlinks (..\ephemeral.plugin_symlinks..) in platforms projects, if an app uses native plugins. Since we no longer invoke
Directory.listSyncwe implicitly sidestep this issue.fix: #2762
Pre-launch Checklist
///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.If you need help, consider asking for advice on the discussion board.
Breaking changes
None, this will produce less warnings than before.