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

Improve handling of remediations with non-ascii data #821

Merged
merged 1 commit into from
Apr 26, 2023

Conversation

fernflower
Copy link
Member

When a remediation command is printed that manipulates non-ascii but totally valid utf-8 filenames, leapp should not give out any tracebacks upon report generation.

Related-to: OAMG-8629

@github-actions
Copy link

github-actions bot commented Apr 5, 2023

Thank you for contributing to the Leapp project!

Please note that every PR needs to comply with the Leapp Guidelines and must pass all tests in order to be mergable.
If you want to request a review or rebuild a package in copr, you can use following commands as a comment:

  • review please to notify leapp developers of review request
  • /packit copr-build to submit a public copr build using packit

To launch regression testing public members of oamg organization can leave the following comment:

  • /rerun to schedule basic regression tests using this pr build and leapp-repository*master* as artifacts
  • /rerun 42 to schedule basic regression tests using this pr build and leapp-repository*PR42* as artifacts
  • /rerun-sst to schedule sst tests using this pr build and leapp-repository*master* as artifacts
  • /rerun-sst 42 to schedule sst tests using this pr build and leapp-repository*PR42* as artifacts

Please open ticket in case you experience technical problem with the CI. (RH internal only)

Note: In case there are problems with tests not being triggered automatically on new PR/commit or pending for a long time, please consider rerunning the CI by commenting leapp-ci build (might require several comments). If the problem persists, contact leapp-infra.

@fernflower fernflower force-pushed the fixnonasciiiinremediation branch 10 times, most recently from 3c0aec3 to 2f45be1 Compare April 5, 2023 16:38
@fernflower fernflower force-pushed the fixnonasciiiinremediation branch 7 times, most recently from 6034ffc to 551ed30 Compare April 6, 2023 09:10
@fernflower
Copy link
Member Author

/rerun

@fernflower fernflower force-pushed the fixnonasciiiinremediation branch 5 times, most recently from 4e4565a to 960ed5e Compare April 21, 2023 14:25
@fernflower
Copy link
Member Author

/rerun 1052

@github-actions
Copy link

Copr build succeeded: https://copr.fedorainfracloud.org/coprs/build/5830602

When a remediation command is printed that manipulates
non-ascii but totally valid utf-8 strings, leapp should
not give out any tracebacks upon report generation.
The idea of a fix is to make repr implementation of Remediation
aware of utf-8 encoding.
The root of the problem is that a mixture of native text / encoded
string can appear in a report message and that caused report generating
code go crazy while creating actual log files.
Unit test has been added as well.

Related-to: OAMG-8629
@fernflower fernflower changed the title Add unit test for remediation with non-ascii data Improve handling of remediations with non-ascii data Apr 24, 2023
Copy link
Member

@pirat89 pirat89 left a comment

Choose a reason for hiding this comment

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

@fernflower I am little bit afraid of japannese systems, but I hope they also use UTF-8 (e.g. Ja_jp.utf8) instead of SJIS. I think it's still much better than before, so let's merge it and see if someone report problems in future about that. As UTF has been broken, SJIS has been broken too. So at least UTF should be covered now.

@pirat89 pirat89 merged commit 2952a4e into oamg:master Apr 26, 2023
@pirat89 pirat89 added the changelog-checked The merger/reviewer checked the changelog draft document and updated it when relevant label Apr 26, 2023
pirat89 added a commit to pirat89/leapp that referenced this pull request May 5, 2023
On Python2, the json.dumps library can produce either
unicode or str output. Nowadays, the unicode is required, however
in case the input for json.dumps function does not contain any
unicode objects (e.g. when no report entry exists), it produces
str type.

Relates: oamg#821
pirat89 added a commit to pirat89/leapp that referenced this pull request May 5, 2023
On Python2, the json.dumps library can produce either
unicode or str output. Nowadays, the unicode is required, however
in case the input for json.dumps function does not contain any
unicode objects (e.g. when no report entry exists), it produces
str type.

Relates: oamg#821
fernflower pushed a commit that referenced this pull request May 9, 2023
On Python2, the json.dumps library can produce either
unicode or str output. Nowadays, the unicode is required, however
in case the input for json.dumps function does not contain any
unicode objects (e.g. when no report entry exists), it produces
str type.

Relates: #821
pirat89 added a commit to pirat89/leapp that referenced this pull request Aug 23, 2023
## Packaging
-  Provide leapp-framework 5.0 (oamg#818, oamg#840)

## Framework
### Fixes
- Improve processing of reports with UTF-8 characters (oamg#821, oamg#828)
- Fix info reporting with only one path to log (oamg#834)

### Enhancements
- Include tracebacks of actors into the leapp.db (oamg#832)

## Leapp (tool)
### Fixes
- Dialog creation fails not more for a component without choices (oamg#826)
- Empty report is generated correctly (oamg#828)
- Fix processing data in remediation instructions with non-ascii characters ()

### Enhancements
- Improve report summary output to make it more visible (oamg#818, oamg#840)

## stdlib
### Fixes
- Fixed the call when the execute cannot be performed (oamg#836)
### Enhancements
- changes related just to stdlib - under leapp/libraries/stdlib
@pirat89 pirat89 mentioned this pull request Aug 23, 2023
pirat89 added a commit to pirat89/leapp that referenced this pull request Aug 23, 2023
## Packaging
-  Provide leapp-framework 5.0 (oamg#818, oamg#840)

## Framework
### Fixes
- Improve processing of reports with UTF-8 characters (oamg#821, oamg#828)
- Fix info reporting with only one path to log (oamg#834)

### Enhancements
- Include tracebacks of actors into the leapp.db (oamg#832)

## Leapp (tool)
### Fixes
- Dialog creation fails not more for a component without choices (oamg#826)
- Empty report is generated correctly (oamg#828)
- Fix processing data in remediation instructions with non-ascii characters ()

### Enhancements
- Improve report summary output to make it more visible (oamg#818, oamg#840)

## stdlib
### Fixes
- Fixed the call when the execute cannot be performed (oamg#836)
### Enhancements
- changes related just to stdlib - under leapp/libraries/stdlib
Rezney pushed a commit that referenced this pull request Aug 23, 2023
## Packaging
-  Provide leapp-framework 5.0 (#818, #840)

## Framework
### Fixes
- Improve processing of reports with UTF-8 characters (#821, #828)
- Fix info reporting with only one path to log (#834)

### Enhancements
- Include tracebacks of actors into the leapp.db (#832)

## Leapp (tool)
### Fixes
- Dialog creation fails not more for a component without choices (#826)
- Empty report is generated correctly (#828)
- Fix processing data in remediation instructions with non-ascii characters ()

### Enhancements
- Improve report summary output to make it more visible (#818, #840)

## stdlib
### Fixes
- Fixed the call when the execute cannot be performed (#836)
### Enhancements
- changes related just to stdlib - under leapp/libraries/stdlib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-checked The merger/reviewer checked the changelog draft document and updated it when relevant
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants