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

[fastlane_core] fix the display of non-unicode characters when printing lane context #21857

Merged
merged 3 commits into from Feb 17, 2024

Conversation

lacostej
Copy link
Collaborator

@lacostej lacostej commented Feb 7, 2024

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 (connect CircleCI to GitHub if not)
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.
  • I've added or updated relevant unit tests.

Motivation and Context

Resolves #21852

Note that I think the real fix should be either in

  • Terminal::Table
  • FastlaneCore::PrintTable.transform_output

So I'll mark this as WIP for now.

/Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/cell.rb:51:in `split': [!] invalid byte sequence in UTF-8 (ArgumentError)
        @value.to_s.split(/\n/)
                          ^^^^
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/cell.rb:51:in `lines'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/cell.rb:71:in `value_for_column_width_recalc'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/table.rb:233:in `block (2 levels) in recalc_column_widths'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/table.rb:232:in `each'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/table.rb:232:in `block in recalc_column_widths'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/table.rb:230:in `each'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/table.rb:230:in `recalc_column_widths'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/table.rb:368:in `column_widths'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/table.rb:97:in `column_width'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/separator.rb:33:in `block in render'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/separator.rb:32:in `each'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/separator.rb:32:in `render'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/table.rb:171:in `block in render'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/table.rb:171:in `map'
	from /Users/vagrant/git/vendor/bundle/ruby/3.2.0/gems/terminal-table-3.0.2/lib/terminal-table/table.rb:171:in `render'

Description

Implemented a fix in terminal-table gem tj/terminal-table#131

But until it is fixed, I suspect we can live with a local monkey patching?

Testing Steps

@lacostej lacostej marked this pull request as draft February 7, 2024 11:04
@lacostej lacostej changed the title [Fix] support non unicode when printing lane context [Fix] support non unicode when printing lane context [WIP] Feb 7, 2024
@lacostej lacostej changed the title [Fix] support non unicode when printing lane context [WIP] [Fix] support non unicode when printing lane context Feb 8, 2024
@lacostej lacostej marked this pull request as ready for review February 8, 2024 21:35
Copy link
Member

@rogerluan rogerluan left a comment

Choose a reason for hiding this comment

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

Nice!

@rogerluan rogerluan changed the title [Fix] support non unicode when printing lane context [fastlane_core] fix the display of non-unicode characters when printing lane context Feb 12, 2024
@lacostej lacostej merged commit 8c4903c into fastlane:master Feb 17, 2024
3 checks passed
@lacostej lacostej deleted the fix/print_lane_context_non_unicode branch February 17, 2024 06:37
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.

[!] invalid byte sequence in UTF-8 (ArgumentError)
2 participants