Skip to content

pub publish --dry-run doesn't catch some errors #2996

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

Closed
cyanglaz opened this issue May 13, 2021 · 1 comment
Closed

pub publish --dry-run doesn't catch some errors #2996

cyanglaz opened this issue May 13, 2021 · 1 comment

Comments

@cyanglaz
Copy link

When running pub publish --dry-run, some errors are not showing up and the process is considered successful. The error that I found not showing up is:

pubspec.yaml allows Flutter SDK version prior to 1.20.0, which does not support having no `ios/` folder.
Please consider increasing the Flutter SDK requirement to ^1.20.0 or higher (environment.sdk.flutter) or create an `ios/` folder.

pub publish will catch the error and stop the publishing process.

the flutter/plugins repo uses pub publish --dry-run to determine if the package is publishable, so this is causing false positives.

Steps to reproduce

  1. Create a plugin or use any existing plugin. (We might publish this plugin in the process, so it is better to use a dummy plugin, or use a dummy pub server for this)
  2. Remove the ios/ folder, set the min flutter dependency in pubspec.yaml to something lower than 1.20.0, e.g:
    flutter: ">=1.12.13+hotfix.5"
    3 Run pub publish, press Y when asked, see the error above.
  3. Run pub publish --dry-run, see that it is successful.

Expected behavior
The step 4 above should result an error.

@sigurdm
Copy link
Contributor

sigurdm commented May 12, 2022

The pub client cannot decide what the pub server accepts.

Some validation steps will always be server-side - these cannot be part of --dry-run.

The output of --dry-run says "The server may enforce additional checks"

For this specific check we could make a client-side validation - but I think we would actually prefer the linter to handle more of these checks (such that you would not even need --dry-run to get these).

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

No branches or pull requests

2 participants