openSUSE / openSUSE-release-tools

Tools to aid in staging and release work for openSUSE/SUSE
GNU General Public License v2.0
57 stars 91 forks source link

build-fail-reminder: don't escape characters #3059

Closed tacerus closed 1 month ago

tacerus commented 4 months ago

osc uses the string literally, make the generated log entry more readable by using the correct characters instead of a character reference.

Previous behavior were commit messages showing character references which are not useful for humans:

$ osc log -D openSUSE:Factory kopete |head -4
----------------------------------------------------------------------------
r134 | anag+factory | 2024-02-08 18:02:03 | 8b84f116348051059ea6ac6b364667a7 | 23.08.4 | rq1144747

[botdel] Package has had build problems for >= 6 weeks

Change tested using:

r = osc.core.Request()
r.add_action('delete', tgt_project='home:crameleon:ignore', tgt_package='dummy2')
r.description = 'foo >= 1'
r.create('https://api.opensuse.org')

$ osc request list home:crameleon:ignore dummy2
1147567  State:new        By:crameleon    When:2024-02-19T12:18:04
        Created by: crameleon
        delete:                                                             home:crameleon:ignore/dummy2
        Descr: foo >= 1

$ osc request log 1147567
...
----------------------------------------------------------------------------
created | crameleon | 2024-02-19T12:18:04

foo >= 1

$  osc log -D home:crameleon:ignore dummy2|head -n4
----------------------------------------------------------------------------
r2 | crameleon | 2024-02-19 12:28:43 | 83b58530a64eab9b3792d6eec7fbae4c | unknown | rq1147567

foo >= 1
codecov-commenter commented 4 months ago

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 28.02%. Comparing base (2c8dfbe) to head (17f7a9c).

Files Patch % Lines
build-fail-reminder.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3059 +/- ## ======================================= Coverage 28.02% 28.02% ======================================= Files 86 86 Lines 14981 14981 ======================================= Hits 4199 4199 Misses 10782 10782 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Vogtinator commented 4 months ago

It's not clear whether the SR description is meant to be HTML/markdown or plain text.

Currently osc displays it as plain text while the Web UI displays it as HTML/MD. This means that it's going to be wrong in either the CLI or Web UI, it'll never look correct everywhere.

Currently it looks correct in the web UI which is probably what most users use, also because notification mails link to it, so IMO the best option for now.

However, there is a way to make it work for both!

r.description = "[botdel] Package has failed to build for more than 6 weeks"

tacerus commented 4 months ago

@Vogtinator My variant looks fine in both, the shell as seen in my output, and the web UI as well: https://build.opensuse.org/request/show/1147567.

Vogtinator commented 4 months ago

@Vogtinator My variant looks fine in both, the shell as seen in my output, and the web UI as well: https://build.opensuse.org/request/show/1147567.

I guess because it triggers some fallback behaviour?

Vogtinator commented 1 month ago

Let's just see what happens :shrug:

tacerus commented 1 month ago

Good with me. ;-)