-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[swift][client] Update CI to use Xcode 26 #22648
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 issues found across 225 files
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="samples/client/petstore/swift6/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh">
<violation number="1" location="samples/client/petstore/swift6/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh:3">
P2: The `${PIPESTATUS[0]}` variable is bash-specific and not available in POSIX sh. Since this script uses `#!/bin/sh`, the exit status from the xcodebuild pipeline may not be captured correctly on systems where `/bin/sh` is not bash (e.g., macOS Catalina+ uses zsh, many Linux systems use dash). Consider changing the shebang to `#!/bin/bash` to ensure PIPESTATUS works correctly.</violation>
</file>
<file name="samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh">
<violation number="1" location="samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh:3">
P2: Using `;` instead of `&&` means xcodebuild will run even if `cd` fails. Use `&&` to ensure the build only runs if the directory change succeeds.</violation>
<violation number="2" location="samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh:3">
P2: Unquoted variable `$DIRECTORY` will break if the path contains spaces. Quote the variable to prevent word splitting.</violation>
</file>
<file name="samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh">
<violation number="1" location="samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh:3">
P2: The `$DIRECTORY` variable should be quoted to handle paths with spaces safely. Unquoted variables in shell scripts are subject to word splitting, which can cause unexpected behavior.</violation>
</file>
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Ask questions if you need clarification on any suggestion
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| @@ -1,3 +1,3 @@ | |||
| #!/bin/sh | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: The ${PIPESTATUS[0]} variable is bash-specific and not available in POSIX sh. Since this script uses #!/bin/sh, the exit status from the xcodebuild pipeline may not be captured correctly on systems where /bin/sh is not bash (e.g., macOS Catalina+ uses zsh, many Linux systems use dash). Consider changing the shebang to #!/bin/bash to ensure PIPESTATUS works correctly.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At samples/client/petstore/swift6/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh, line 3:
<comment>The `${PIPESTATUS[0]}` variable is bash-specific and not available in POSIX sh. Since this script uses `#!/bin/sh`, the exit status from the xcodebuild pipeline may not be captured correctly on systems where `/bin/sh` is not bash (e.g., macOS Catalina+ uses zsh, many Linux systems use dash). Consider changing the shebang to `#!/bin/bash` to ensure PIPESTATUS works correctly.</comment>
<file context>
@@ -1,3 +1,3 @@
#!/bin/sh
-xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}
+xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}
</file context>
samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh
Outdated
Show resolved
Hide resolved
samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh
Outdated
Show resolved
Hide resolved
samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh
Outdated
Show resolved
Hide resolved
This reverts commit b501899.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7 issues found across 207 files (changes from recent commits).
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONResponseSerializer.m">
<violation number="1">
P1: Potential null pointer dereference: The `error` parameter should be checked for NULL before dereferencing. In Objective-C, callers may pass NULL for the error parameter when they don't need error information, and dereferencing it will cause a crash.</violation>
</file>
<file name="samples/client/petstore/objc/core-data/README.md">
<violation number="1">
P2: Incorrect Objective-C pointer syntax in code example. `SWGPet* *pet` declares a pointer-to-pointer, but it should be `SWGPet *pet` to declare a simple object pointer. This typo in the documentation could confuse developers trying to use the sample code.</violation>
</file>
<file name="samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m">
<violation number="1">
P1: Calling `initWithDomain:code:userInfo:` on an already-initialized `error` object is undefined behavior in Objective-C. Create a new NSError instance instead using `errorWithDomain:code:userInfo:` or `[[NSError alloc] initWithDomain:code:userInfo:]`.</violation>
</file>
<file name="samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m">
<violation number="1">
P1: Potential crash: `stringByAddingPercentEncodingWithAllowedCharacters:` can return nil, and calling `appendString:` with nil will crash. Add a nil check before appending.</violation>
</file>
<file name="samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.m">
<violation number="1">
P2: Calling `dataUsingEncoding:` without verifying `parameters` is an `NSString` can cause a runtime crash if an unexpected type is passed. Consider adding a type check: `if ([parameters isKindOfClass:[NSString class]])` before calling `dataUsingEncoding:`.</violation>
</file>
<file name="samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.h">
<violation number="1">
P3: File is missing a trailing newline. POSIX-compliant files should end with a newline character to avoid potential issues with tools that expect this convention.</violation>
</file>
<file name="samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.m">
<violation number="1">
P2: Nil parameters will produce invalid credentials. If `username` or `password` is nil (but not both), `stringWithFormat:@"%@:%@"` will insert "(null)" into the credentials string, producing invalid Basic Auth values like "(null):password". Consider adding nil checks before the string format.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
The CI problem is not related to the changes in this PR. |
Update CI to use Xcode 26 and remove old objective-c samples
PR checklist
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*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)"fixes #123"present in the PR description)@jgavris (2017/07) @ehyche (2017/08) @Edubits (2017/09) @jaz-ah (2017/09) @4brunu (2019/11) @dydus0x14 (2023/06)
Summary by cubic
Updates CI to Xcode 26.2 on Bitrise and bumps iOS Simulator targets to iPhone 17 for Swift client tests.
Written for commit 1e46514. Summary will update on new commits.