-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
status.rs: Make json output more verbose #1367
Conversation
Currently if the status response has no status code, json output contains only a text field which gives no real information about the cause of the problem. The patch adds field with more detailed information when the status response contains some details. Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
Nice. lychee/lychee-bin/tests/cli.rs Lines 136 to 147 in 54e6386
|
Yes, I have. Currently it looks like this: {
"total": 77,
"successful": 36,
"unknown": 0,
"unsupported": 0,
"timeouts": 0,
"redirects": 0,
"excludes": 39,
"errors": 2,
"cached": 0,
"success_map": {},
"fail_map": {
"./themes/dasharo/layouts/partials/essentials/style.html": [
{
"url": "https://use.fontawesome.com/",
"status": {
"text": "Failed: Network error",
"code": 404
}
},
{
"url": "https://expired.badssl.com/",
"status": {
"text": "Failed: Network error",
"details": "error:0A000086:SSL routines:tls_post_process_server_certificate:certificate verify failed:../ssl/statem/statem_clnt.c:1883: (certificate has expired)"
}
}
]
},
"suggestion_map": {},
"excluded_map": {},
"duration_secs": 3,
"detailed_stats": false
} And this is how it looks without this patch (latest stable): {
"total": 77,
"successful": 36,
"unknown": 0,
"unsupported": 0,
"timeouts": 0,
"redirects": 0,
"excludes": 39,
"errors": 2,
"cached": 0,
"success_map": {},
"fail_map": {
"./themes/dasharo/layouts/partials/essentials/style.html": [
{
"url": "https://use.fontawesome.com/",
"status": {
"text": "Failed: Network error",
"code": 404
}
},
{
"url": "https://expired.badssl.com/",
"status": {
"text": "Failed: Network error"
}
}
]
},
"suggestion_map": {},
"excluded_map": {},
"duration_secs": 3,
"detailed_stats": false
}
I'll try to do this in a moment. |
Some network error such as SSL has no status code but it can be identified by error status details. This patch adds a test case to verify if the error details are parsed properly in the json format. Signed-off-by: Norbert Kamiński <norbert.kaminski@3mdeb.com>
6c7cc54
to
ca14655
Compare
Looking great! Thanks a lot @Asiderr 😃 |
[](https://renovatebot.com) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [lycheeverse/lychee](https://togithub.com/lycheeverse/lychee) | patch | `0.14.0` -> `0.14.3` | --- ### Release Notes <details> <summary>lycheeverse/lychee (lycheeverse/lychee)</summary> ### [`v0.14.3`](https://togithub.com/lycheeverse/lychee/releases/tag/v0.14.3): Version 0.14.3 [Compare Source](https://togithub.com/lycheeverse/lychee/compare/v0.14.0...v0.14.3) <!-- Release notes generated using configuration in .github/release.yml at master --> #### What's Changed ##### Miscellaneous and Others 🔔 - fix(tests): update the expected output in cli tests by [@​orhun](https://togithub.com/orhun) in [https://github.com/lycheeverse/lychee/pull/1362](https://togithub.com/lycheeverse/lychee/pull/1362) - status.rs: Make json output more verbose by [@​Asiderr](https://togithub.com/Asiderr) in [https://github.com/lycheeverse/lychee/pull/1367](https://togithub.com/lycheeverse/lychee/pull/1367) - Set URI to HTTPS for ErrorKind::InsecureURL by [@​Elkiwa](https://togithub.com/Elkiwa) in [https://github.com/lycheeverse/lychee/pull/1369](https://togithub.com/lycheeverse/lychee/pull/1369) - Fixed fragment generation for headings with inline code by [@​HU90m](https://togithub.com/HU90m) in [https://github.com/lycheeverse/lychee/pull/1370](https://togithub.com/lycheeverse/lychee/pull/1370) - Move to workspace versioning by [@​mre](https://togithub.com/mre) in [https://github.com/lycheeverse/lychee/pull/1372](https://togithub.com/lycheeverse/lychee/pull/1372) #### New Contributors - [@​Asiderr](https://togithub.com/Asiderr) made their first contribution in [https://github.com/lycheeverse/lychee/pull/1367](https://togithub.com/lycheeverse/lychee/pull/1367) - [@​Elkiwa](https://togithub.com/Elkiwa) made their first contribution in [https://github.com/lycheeverse/lychee/pull/1369](https://togithub.com/lycheeverse/lychee/pull/1369) **Full Changelog**: lycheeverse/lychee@v0.14.2...v0.14.3 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "every weekend" (UTC), Automerge - "before 4am" (UTC). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/woodpecker-ci/woodpecker). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMDAuMCIsInVwZGF0ZWRJblZlciI6IjM3LjIwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
Currently if the status response has no status code, json output contains only a text field which gives no real information about the cause of the problem. The patch adds field with more detailed information when the status response contains some details.