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

[swift5] less restrictive alamofire dependency resolution #13977

Merged
merged 4 commits into from
Nov 10, 2022
Merged

[swift5] less restrictive alamofire dependency resolution #13977

merged 4 commits into from
Nov 10, 2022

Conversation

Jonas1893
Copy link
Contributor

@Jonas1893 Jonas1893 commented Nov 10, 2022

Follow up from discussion here: #13667 (comment)
Currently we only allow dependency resolution to resolve Alamofire 5.4.3 and possible future patch versions of 5.4. Since Alamofire is using semver we can safely optimistically resolve to next major version instead without the danger of breaking API changes. Consuming projects can still opt-in whether to use an older version, currently they are forced to use the old 5.4.* versions.

This PR optimistically pins Alamofire to next major version allowing cocoapods / SPM to resolve everything from version 5.4 until and not including version 6.

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.
  • 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. -> @jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @4brunu (2019/11)

Declaration

The program was tested solely for our own use cases, which might differ from yours.

Link to provider information

https://github.com/mercedes-benz

@4brunu
Copy link
Contributor

4brunu commented Nov 10, 2022

Hey @Jonas1893, thanks for following up with this.
Could you also fix this in Carthage?
What do you think about downgrading the version of Alamofire to something like 5.0 to allow more versions of Alamofire?
Should we also do the same for the other dependencies?

@Jonas1893
Copy link
Contributor Author

Hey @Jonas1893, thanks for following up with this.
Could you also fix this in Carthage?
What do you think about downgrading the version of Alamofire to something like 5.0 to allow more versions of Alamofire?
Should we also do the same for the other dependencies?

Hi @4brunu sorry forgot about Carthage. Will do 👍

I personally would be against allowing even earlier Alamofire versions as this could unnecessarily introduce a new window of potential bugs. Alamofire 5.4.0 is from November 2020 so I think going with it as minimum version is reasonable, 99.99% of libs and apps with AF dependencies will probably support it now anyway.

Regarding other dependencies: I am not familiar with each and everyone of the dependencies regarding how closely they follow semver. Worst case that can happen for consumers of swift generator if we use the same approach: a new version of a dependency introduces a breaking change in a minor version release, in that case a user of the generator could still pin this dependency to an earlier version in their dependency file as a workaround and it would compile just fine.
We would be aware when regenerating the samples and executing tests where we would have to fix the version constraint again.

So: I think we could try and follow through with this strategy for every third party dependency, if we see that some of the dependencies do not follow semver closely and we would have to fix it often we can revert again. Downside is that if these problems happen then this would have an impact for the whole generator project and swift tests will be failing on CI for every PR even if their changes are unrelated to swift generator

@4brunu
Copy link
Contributor

4brunu commented Nov 10, 2022

Looks good to me.

Could you change the other dependencies, except for vapor, since that's a complicated one?
Flight-School/AnyCodable
mxcl/PromiseKit
ReactiveX/RxSwift

Thanks

Copy link
Contributor

@4brunu 4brunu left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

@4brunu 4brunu merged commit f1b8190 into OpenAPITools:master Nov 10, 2022
@wing328 wing328 added this to the 6.3.0 milestone Jan 20, 2023
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.

None yet

3 participants