apollographql / apollo-ios

📱  A strongly-typed, caching GraphQL client for iOS, written in Swift.
https://www.apollographql.com/docs/ios/
MIT License
3.87k stars 717 forks source link

Version mismatch between package and CLI #3386

Closed Brett-Best closed 4 months ago

Brett-Best commented 4 months ago

Summary

Upgraded package to 1.2.1 but the CLI version wasn't increased so I get an error

Version

1.2.1

Steps to reproduce the behavior

  1. Upgrade to 1.2.1
  2. Try to run the CLI from SPM
  3. Error because the CLI version is incorrect

Logs

Installing Apollo CLI SPM plugin
x apollo-ios-cli
Running Apollo code generation
Error: Error: Apollo Version Mismatch
We've detected that the version of the Apollo Codegen CLI does not match the version of the
Apollo library used in your project. This may lead to incompatible generated objects.

Please update your version of the Codegen CLI by following the instructions at:
https://www.apollographql.com/docs/ios/code-generation/codegen-cli/#installation

CLI version: 1.12.0
Apollo version: 1.12.1

To ignore this error during code generation, use the argument: --ignore-version-mismatch.

Anything else?

No response

calvincestari commented 4 months ago

Looks like I built the CLI binary before setting the new version numbers. That means it's using the correct codegen but failing at the number mismatch. 🤦🏻

calvincestari commented 4 months ago

I've got a PR up to fix this including a new CI job that will catch this and the 1.12.0 error too because it requires that the CLI archive can be extracted, executed and version matched. Unfortunately it'll only get merged once the rest of the team is able to review it in the morning.

Also this version check behaviour should not be needed for too much longer as @BobaFetters is working on having cocoapods installations download the CLI archive from the release instead of needing to use the embedded archive. Once that's done it would be trivial to fix this on the GitHub release and not require a new version release.

github-actions[bot] commented 4 months ago

Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better.