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
better wording when packit cannot parse YAML file #1861
Conversation
414da0e
to
423cadb
Compare
Build succeeded. ✔️ pre-commit SUCCESS in 2m 01s |
Updated. |
Build succeeded. ✔️ pre-commit SUCCESS in 1m 50s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rebase and add mergeit
labels once ready
EDIT: And thanks, it's definitely an improvement 👍
msg = ( | ||
" parser says\n" | ||
+ str(ex.problem_mark) | ||
+ "\n " | ||
+ str(ex.problem) # type: ignore | ||
) # type: ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msg = f" parser says\n{ex.problem_mark}\n {ex.problem}" # type: ignore
works OK (pre-commit doesn't complain) for me, but I don't mind having it multi-line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I am going to update the release notes to match other: make it only a single sentence.
Previously it prints: 2023-02-23 16:23:13.305 package_config.py ERROR Cannot load package config /tmp/fedora-upgrade/.packit.yaml. 2023-02-23 16:23:13.305 utils.py ERROR Cannot load package config: ScannerError('while scanning for the next token', None, "found character '\\t' that cannot start any token", <yaml.error.Mark object at 0x7f3310e2a190>). Now it prints: 2023-02-23 17:25:59.950 package_config.py ERROR Cannot load package config /tmp/fedora-upgrade/.packit.yaml. 2023-02-23 17:25:59.950 package_config.py ERROR parser says in "<unicode string>", line 12, column 1: - fedora-stable ^ found character '\t' that cannot start any token while scanning for the next token 2023-02-23 17:25:59.950 utils.py ERROR Please correct data and retry. Waive mypy errors about packit/config/package_config.py:198: error: "YAMLError" has no attribute "context" [attr-defined] packit/config/package_config.py:203: error: "YAMLError" has no attribute "problem" [attr-defined] packit/config/package_config.py:205: error: "YAMLError" has no attribute "context" [attr-defined] packit/config/package_config.py:209: error: "YAMLError" has no attribute "problem" [attr-defined] as they exists when the error occure.
Build succeeded. ✔️ pre-commit SUCCESS in 1m 42s |
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 1m 39s |
Well done Mirek! I already saw the first sentry issues about this and knew exactly what went wrong. |
Previously it printed:
Now it prints:
TODO:
packit/packit.dev
.RELEASE NOTES BEGIN
Command
packit validate-config
now provides details about errors when it cannot parse the config file.RELEASE NOTES END