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

Add --legacy flag, for compatibility with Xcode 16 #3

Closed
wants to merge 5 commits into from

Conversation

gemmakbarlow
Copy link

Some related discussion can be seen here - fastlane/fastlane#22132

@gemmakbarlow
Copy link
Author

@jozefizso - this is my first attempt at Typescript - I welcome any testing pointers.

@JJdeGroot
Copy link

Does anyone what the non-deprecated alternative is for this command?

xcrun xcresulttool -h

OVERVIEW: Xcode Result Bundle Tool (version 23028).

USAGE: xcresulttool <subcommand>

OPTIONS:
  --version               Show the version.
  -h, --help              Show help information.

SUBCOMMANDS:
  get                     Get Result Bundle contents.
  export                  Export Result Bundle contents.
  graph                   Print Result Bundle Object Graph. This subcommand is deprecated and will be removed in a future release, consider using
                          `xcresulttool get test-report` instead.
  metadata                Result Bundle Metadata.
  formatDescription       Result Bundle Format Description. This subcommand is deprecated and will be removed in a future release.
  merge                   Merge Result Bundles.

graph and formatDescription have been deprecated. For graph, it says: consider using xcresulttool get test-report instead.

xcrun xcresulttool get -h

OVERVIEW: Get Result Bundle contents.

USAGE: xcresulttool get <subcommand>

OPTIONS:
  --version               Show the version.
  -h, --help              Show help information.

SUBCOMMANDS:
  object (default)        Get Result Bundle Object. This subcommand is deprecated and will be removed in a future release, consider using
                          `xcresulttool get test-report` instead.
  test-results            Get a high level description of what was tested, the destinations on which tests ran, and other metadata along with all
                          failures reported.
  build-results           Get a high level description of build action, the run destination for which the build was performed, and other metadata
                          along with warnings and issues.
  log                     Get build, action, or console log from Result Bundle.

  See 'xcresulttool help get <subcommand>' for detailed help.

For get it's odd that a deprecated subcommand object is the default.

It also tells you to "consider xcresulttool get test-report instead."

However, test-report is not listed as subcommand.... but it does exist.

xcrun xcresulttool get test-report -h

OVERVIEW: Get Result Bundle Object. This subcommand is deprecated and will be removed in a future release, consider using `xcresulttool get
test-report` instead.

USAGE: xcresulttool get object [--legacy] --path <path> [--id <id>] [--version <version>] [--format <format>]

OPTIONS:
  --legacy                Required to enable legacy API.
  --path <path>           The result bundle path.
  --id <id>               The ID of the object [optional, assumes rootID if not specified].
  --version <version>     For incomplete result bundles (lacking Info.plist), specify version explicitly [optional, assumes latest version if not
                          specified].
  --format <format>       The output format. (values: json, raw; default: raw)
  --version               Show the version.
  -h, --help              Show help information.

This command is deprecated as well.... it appears to be an alias for get object, which is also mentioned in the usage?

All in all it's super confusing and unclear what the undeprecated way is.

@JJdeGroot
Copy link

Relevant topic: https://forums.developer.apple.com/forums/thread/763050

Looks like xcrun xcresulttool get test-results summary --path X.xcresult is a close alternative, at least for our use case it contains the information we need.

@jozefizso
Copy link
Member

Hello, we are sorry we missed this pull request. I will take a look at it as we are at the transition to Xcode 16.

@jozefizso jozefizso self-assigned this Oct 21, 2024
if (match) {
return parseInt(match[1], 10);
}
throw new Error('Unable to determine Xcode version');
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer the script to continue working if it cannot determine the Xcode version instead of bailing out.

.concat(inputPaths)
.concat(['--output-path', outputPath])

if (xcodeVersion >= 16) {
Copy link
Member

Choose a reason for hiding this comment

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

I would add the --legacy only if the Xcode is exactly 16. Later releases may not have this flag:

Error: This command is deprecated and will be removed in a future release, --legacy flag is required to use it.

Comment on lines +164 to +166
.concat(inputPaths)
.concat(['--output-path', outputPath])

Copy link
Member

Choose a reason for hiding this comment

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

Please, use the same code style as is in the whole project.

@jozefizso
Copy link
Member

Hi @gemmakbarlow, I have some feedback for the PR:

  1. It is always better to create PR from a topic/feature branch and not the master branch. This would allow us to make small adjustments to the code before merging if it was on a topic branch.
  2. I would prefer script to continue working if it cannot determine the Xcode version instead of bailing out
  3. The code formatting and styling should match other source code.

@gemmakbarlow
Copy link
Author

Hi @gemmakbarlow, I have some feedback for the PR:

  1. It is always better to create PR from a topic/feature branch and not the master branch. This would allow us to make small adjustments to the code before merging if it was on a topic branch.
  2. I would prefer script to continue working if it cannot determine the Xcode version instead of bailing out
  3. The code formatting and styling should match other source code.

All very valid, thank-you for the feedback. I hope to get some time to address those comments later in the week.

If you need to proceed with another approach in the interim, please go ahead, as I'm a little swamped at the moment.

@jozefizso
Copy link
Member

I am closing this PR as the fix was implemented in #10

@jozefizso jozefizso closed this Oct 29, 2024
@jozefizso
Copy link
Member

Release is ready: https://github.com/slidoapp/xcresulttool/releases/tag/v3.1.0

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