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

feat(dynamite)!: validate version of dynamite_runtime when generating #1228

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

Leptopoda
Copy link
Member

fixes: #1167

Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

This should not only check dynamite_runtime but also every package that the generated code depends on (https://github.com/nextcloud/neon/blob/main/packages/dynamite/dynamite/lib/src/builder/imports.dart).

@Leptopoda
Copy link
Member Author

I don't know if this is a good idea.
both dynamite_e2e and dynamite_petstore do not import all of these as they don't depend on all of them.
And which versions should we require?

@provokateurin
Copy link
Member

I'd say if a package is missing from the pubspec then we can skip it since it might not be used as you said.
Regarding the required versions we could either test basically everything or just use the current major versions we depend on and then check the minimum minor and patch versions using pub downgrade and running tests.

@Leptopoda
Copy link
Member Author

Downgrading for the test should not be needed if we assume devs follow semver (and the packages we choose should come from reputable publishers like we already do).

While we (nextcloud package) might be affected by a bug/need a feature does not mean other users face the same.
An example is that a user might not use a someOf in their spec so in that case we should not force them to use built_value:8.8.0.

@provokateurin
Copy link
Member

I disagree, we should require dependencies that work for everyone, regardless of the features they use. Otherwise it makes no sense to check for dependency versions.
The downgrading was only meant as a way to figure out the lowest supported version. From our current dependency constraints it's impossible to know if we really support all the versions or depend on something that was added or fixed n a minor or patch release.

@Leptopoda Leptopoda force-pushed the feat/dynamite/warn_dynamite_runtimer_version_mismatch branch from 39fffd8 to 3ed6a9b Compare December 5, 2023 16:01
@Leptopoda Leptopoda force-pushed the feat/dynamite/warn_dynamite_runtimer_version_mismatch branch from 3ed6a9b to 8d47d09 Compare December 5, 2023 16:32
@Leptopoda Leptopoda force-pushed the feat/dynamite/warn_dynamite_runtimer_version_mismatch branch from 8d47d09 to 1482d5f Compare December 11, 2023 10:32
@Leptopoda
Copy link
Member Author

forgot to push yesterday 😅
Should be ready now.

@Leptopoda Leptopoda force-pushed the feat/dynamite/warn_dynamite_runtimer_version_mismatch branch from 1482d5f to 0288c42 Compare December 11, 2023 16:25
@provokateurin
Copy link
Member

Please adjust the built_value_generator minimum to 8.8.1 (also in the dynamite docs): #1274.

@Leptopoda Leptopoda force-pushed the feat/dynamite/warn_dynamite_runtimer_version_mismatch branch from 0288c42 to 19e7e1c Compare December 12, 2023 11:19
@Leptopoda Leptopoda force-pushed the feat/dynamite/warn_dynamite_runtimer_version_mismatch branch from 19e7e1c to 8a9f3a4 Compare December 12, 2023 20:45
Copy link
Member

@provokateurin provokateurin left a comment

Choose a reason for hiding this comment

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

LGTM, just one question

packages/dynamite/dynamite/lib/src/openapi_builder.dart Outdated Show resolved Hide resolved
@Leptopoda Leptopoda force-pushed the feat/dynamite/warn_dynamite_runtimer_version_mismatch branch from 8a9f3a4 to 40c5f3e Compare December 13, 2023 08:55
@Leptopoda Leptopoda enabled auto-merge December 13, 2023 09:00
@Leptopoda Leptopoda merged commit 39255db into main Dec 13, 2023
8 checks passed
@Leptopoda Leptopoda deleted the feat/dynamite/warn_dynamite_runtimer_version_mismatch branch December 13, 2023 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check dependency constraints when generating with dynamite
2 participants