Skip to content

Conversation

@4brunu
Copy link
Contributor

@4brunu 4brunu commented Jan 9, 2026

Update CI to use Xcode 26 and remove old objective-c samples

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 || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    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.
  • File the PR against the correct branch: master (upcoming 7.x.0 minor release - breaking changes with fallbacks), 8.0.x (breaking changes without fallbacks)
  • If your PR solves a reported issue, reference it using GitHub's linking syntax (e.g., having "fixes #123" present in the PR description)
  • 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) @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.

  • Refactors
    • Set Bitrise stack to osx-xcode-26.2.x in bitrise.yml.
    • Updated xcodebuild destinations to iPhone 17 across Swift sample test scripts.

Written for commit 1e46514. Summary will update on new commits.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a 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
Copy link

@cubic-dev-ai cubic-dev-ai bot Jan 9, 2026

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>
Fix with Cubic

Copy link

@cubic-dev-ai cubic-dev-ai bot left a 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.

@4brunu
Copy link
Contributor Author

4brunu commented Jan 9, 2026

The CI problem is not related to the changes in this PR.

Downloading Swiftly
/usr/bin/gpg --verify /home/runner/work/_temp/65a75e22-06d4-408f-99a8-9657beb490c9 /home/runner/work/_temp/70487320-36c4-4692-9fa2-1a15b1980b93
gpg: directory '/home/runner/.gnupg' created
gpg: keybox '/home/runner/.gnupg/pubring.kbx' created
gpg: Signature made Fri Oct 17 15:00:17 2025 UTC
gpg:                using RSA key E813C892820A6FA13755B268F167DF1ACF9CE069
gpg: Can't check signature: No public key
Error: Unexpected error, unable to continue. Please report at https://github.com/swift-actions/setup-swift/issues
The process '/usr/bin/gpg' failed with exit code 2
Stacktrace:
Error: The process '/usr/bin/gpg' failed with exit code 2
    at ExecState._setResult (/home/runner/work/_actions/swift-actions/setup-swift/v3/dist/index.js:2357:25)
    at ExecState.CheckComplete (/home/runner/work/_actions/swift-actions/setup-swift/v3/dist/index.js:2340:18)
    at ChildProcess.<anonymous> (/home/runner/work/_actions/swift-actions/setup-swift/v3/dist/index.js:2234:27)
    at ChildProcess.emit (node:events:524:28)
    at maybeClose (node:internal/child_process:1104:16)
    at ChildProcess._handle.onexit (node:internal/child_process:304:5)

@4brunu 4brunu merged commit ae8352d into master Jan 9, 2026
28 of 29 checks passed
@4brunu 4brunu deleted the feature/ci-swift branch January 9, 2026 10:30
@wing328 wing328 added this to the 7.19.0 milestone Jan 19, 2026
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.

3 participants