Skip to content

[scan] Forward force_legacy_xcresulttool to trainer#30092

Merged
AliSoftware merged 1 commit into
fastlane:masterfrom
eyupcanakman:fix/scan-forward-force-legacy-xcresulttool
Jun 25, 2026
Merged

[scan] Forward force_legacy_xcresulttool to trainer#30092
AliSoftware merged 1 commit into
fastlane:masterfrom
eyupcanakman:fix/scan-forward-force-legacy-xcresulttool

Conversation

@eyupcanakman

Copy link
Copy Markdown
Contributor

Motivation and Context

Resolves #29614.

scan runs its test results through Trainer::TestParser.auto_convert, but it never forwarded the force_legacy_xcresulttool option that trainer added in #29463. Setting it (or TRAINER_FORCE_LEGACY_XCRESULTTOOL) had no effect when running tests through scan, and the issue confirms it was left out by mistake.

Description

Adds a force_legacy_xcresulttool option to scan (env SCAN_FORCE_LEGACY_XCRESULTTOOL, default false) and passes it through to trainer in the params hash, next to the existing output_remove_retry_attempts.

Testing Steps

  • bundle exec rspec scan/spec/runner_spec.rb
  • bundle exec rubocop scan/lib/scan/options.rb scan/lib/scan/runner.rb scan/spec/runner_spec.rb

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I see several green ci/circleci builds in the "All checks have passed" section of my PR
  • I've read the Contribution Guidelines
  • I've added or updated relevant unit tests.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ad4b1f81e3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scan/lib/scan/options.rb Outdated
type: Boolean,
default_value: false),
FastlaneCore::ConfigItem.new(key: :force_legacy_xcresulttool,
env_name: "SCAN_FORCE_LEGACY_XCRESULTTOOL",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor TRAINER_FORCE_LEGACY_XCRESULTTOOL through scan

When scan is invoked in CI with the trainer env var from the reported workaround (TRAINER_FORCE_LEGACY_XCRESULTTOOL=true bundle exec fastlane scan), this new option still resolves to its default false because Scan::Options only reads SCAN_FORCE_LEGACY_XCRESULTTOOL; Runner then passes that false value in a plain hash, so trainer's own env-backed configuration is never consulted. Include the trainer env name here (or otherwise merge it before calling Trainer::TestParser) so existing trainer-style configuration actually takes effect through scan.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

After reading the PR description I was actually immediately thinking about this very thing — i.e. you mention in the PR description that you use SCAN_FORCE_LEGACY_XCRESULTTOOL for the env var but I immediately thought that for consistency with trainer, using TRAINER_FORCE_LEGACY_XCRESULTTOOL would probably make more sense (that way, if you set TRAINER_FORCE_LEGACY_XCRESULTTOOL env var it applies to both)?

Suggested change
env_name: "SCAN_FORCE_LEGACY_XCRESULTTOOL",
env_name: 'TRAINER_FORCE_LEGACY_XCRESULTTOOL',

Alternatively, you could at least use both (ConfigItem supports env_names (plural) in addition to env_name to allow you to provide a list, the first one matching being the one taken into account at runtime

Suggested change
env_name: "SCAN_FORCE_LEGACY_XCRESULTTOOL",
env_names: ['SCAN_FORCE_LEGACY_XCRESULTTOOL', 'TRAINER_FORCE_LEGACY_XCRESULTTOOL'],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Went with env_names so both the scan name and TRAINER_FORCE_LEGACY_XCRESULTTOOL resolve. It also lines up with output_remove_retry_attempts right above, which forwards to trainer the same way.

@iBotPeaches

Copy link
Copy Markdown
Member

Hmm is Codex from you? I don't see it configured on our side and its messaging suggests it is.

@eyupcanakman

Copy link
Copy Markdown
Contributor Author

That's an automatic reviewer tied to my account, not anything configured on fastlane's side. It kicked in when I opened the PR. I've turned it off so it won't post here again, sorry for the noise.

@iBotPeaches

Copy link
Copy Markdown
Member

No worries. The messaging just confused me as it read like it was configured on our side.

@iBotPeaches

Copy link
Copy Markdown
Member

I think @AliSoftware might be best to review this one. It looks like #30092 discussions

@AliSoftware AliSoftware left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for fixing this, this was indeed an oversight!

The PR looks good so approving on principle. I just left a suggestion (actually agreeing with your Codex bot's review) about the env var name, that I think could be worth adjusting (using env_names to support both might be the best compromise?)

@eyupcanakman eyupcanakman force-pushed the fix/scan-forward-force-legacy-xcresulttool branch from ad4b1f8 to 3f9afa1 Compare June 25, 2026 19:30
@AliSoftware AliSoftware merged commit bd63a64 into fastlane:master Jun 25, 2026
12 checks passed

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @eyupcanakman 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a month, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀"

This was referenced Jul 4, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Congratulations! 🎉 This was released as part of fastlane 2.237.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scan invokes trainer without the ability to specify :force_legacy_xcresulttool option

3 participants