Skip to content

[Dart] Convert DioError to DioException#15783

Merged
wing328 merged 13 commits intoOpenAPITools:masterfrom
Rexios80:dart-dio-error-to-exception
Jun 15, 2023
Merged

[Dart] Convert DioError to DioException#15783
wing328 merged 13 commits intoOpenAPITools:masterfrom
Rexios80:dart-dio-error-to-exception

Conversation

@Rexios80
Copy link
Contributor

@Rexios80 Rexios80 commented Jun 7, 2023

The class DioError has been deprecated in favor of DioExcption

https://pub.dev/packages/dio/changelog#520

This command didn't run on my machine: ./bin/utils/export_docs_generators.sh

@jaumard @josh-burton @amondnet @sbu-WBT @kuhnroyal @agilob @ahmednfwela

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • In case you are adding a new generator, run the following additional script :
    ./bin/utils/ensure-up-to-date
    
    Commit all changed files.
  • File the PR against the correct branch: master (6.3.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@wing328
Copy link
Member

wing328 commented Jun 8, 2023

@Rexios80 thanks for the PR. Can you please take a look at the CI failure when you've time?

https://github.com/OpenAPITools/openapi-generator/actions/runs/5201409315/jobs/9393144388?pr=15783

@Rexios80
Copy link
Contributor Author

Rexios80 commented Jun 8, 2023

@wing328 It seems to be a dependency resolution issue. The workflow uses Dart 2.15.0 which is probably too old to resolve all sub-dependencies. Should we update it? If so what version should we update it to?

@wing328
Copy link
Member

wing328 commented Jun 9, 2023

Dart 2.15.0 was released on Dec 2021: https://dart.dev/guides/language/evolution#dart-215

With this change, we completely drop Dart 2.15.0 support, right? What's the minimum version the auto-generated Dart SDK will support in the upcoming v7.0.0 release?

Is everyone ok with that?

I can't seem to find EOL of Dart releases. If anyone has the info, Please share.

cc @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12) @ahmednfwela (2021/08)

@ahmednfwela
Copy link
Contributor

It's not a problem with dart version, it's just for some reason pulling dio 5.0.0 as can be seen here
https://github.com/OpenAPITools/openapi-generator/actions/runs/5201409315/jobs/9393144388?pr=15783#step:7:876

this is because you forgot to change the dio version in the test project here, since it doesn't get auto generated
https://github.com/OpenAPITools/openapi-generator/blob/113cf9db40ea6c4405d70a87b763636b1ddf334c/samples/openapi3/client/petstore/dart-dio/petstore_client_lib_fake_tests/pubspec.yaml#LL13C3-L13C6

@kuhnroyal
Copy link
Contributor

@Rexios80 Can you please bump dio to 5.2.1 - (5.2.0+2) does actually not exist - see my PR here: cfug/dio#1861

Also, with this change we do drop support for dio < 5.2.0 so we need to raise it in the pubspec.mustache template.

@wing328 This will still support Dart 2.15

@kuhnroyal
Copy link
Contributor

@Rexios80 I think you need to regenerate samples with the new dio version

@kuhnroyal
Copy link
Contributor

@wing328 Can you please approve?

@wing328
Copy link
Member

wing328 commented Jun 14, 2023

CI tests still failed: https://github.com/OpenAPITools/openapi-generator/actions/runs/5254958800/jobs/9516265653?pr=15783

please take another look when you've time.

@kuhnroyal
Copy link
Contributor

Yea not all samples seem to be up-to-date.
@Rexios80 Please run ./bin/generate-samples.sh bin/configs/dart* again and see if there are any changes.

@Rexios80
Copy link
Contributor Author

There weren't any changes. I already ran ./bin/generate-samples.sh bin/configs/dart-* which I think caught them all

The files the tests are complaining about don't contain any references to DioError (in fact the entire root project doesn't) so I'm not exactly sure what's going on.

@kuhnroyal
Copy link
Contributor

There are probably new changes on the master branch which you need to merge into your branch before.

@wing328
Copy link
Member

wing328 commented Jun 15, 2023

can you please run the script to regenerate the samples one more time?

https://github.com/OpenAPITools/openapi-generator/actions/runs/5266780237/jobs/9543293287?pr=15783

@wing328
Copy link
Member

wing328 commented Jun 15, 2023

updated samples via e248046

let's see how that goes

@wing328 wing328 merged commit 95cefae into OpenAPITools:master Jun 15, 2023
fmoraespadtec pushed a commit to padteclab/openapi-generator that referenced this pull request Jun 26, 2023
* Convert `DioError` to `DioException`

* Update samples

* Update dio version in example

* Use proper dio version

* Regenerate dart samples

* Regenerate

* Regenerate samples

* update samples

* remove outdated test files

* update test

* remove outdated test files

---------

Co-authored-by: William Cheng <wing328hk@gmail.com>
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