-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add some cosmetics to identify the ReviewRequest ID #17
base: main
Are you sure you want to change the base?
Conversation
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.
Hi Logu, Happy to see your contributions. I am tempted to say please add test coverage but I don't know if the surrounding code is already covered by automatic tests at all. Anyway, please take a look. Maybe it's not that hard :) and second there is a duplication which you can avoid by extracting a method
5bc43dd
to
43f928c
Compare
I dont know which duplication you have mentioned, is it leveraging subprocess instead of setproctitle ? |
mtui/main.py
Outdated
@@ -45,6 +45,11 @@ def run_mtui(sys, config, logger, Prompt, Display, args): | |||
|
|||
prompt = Prompt(config, logger, sys, Display) | |||
if args.update: | |||
short_rrid = ( | |||
str(args.update.id).replace("SUSE", "S").replace("Maintenance", "M") |
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.
this is duplicating ...
mtui/prompt.py
Outdated
|
||
def load_update(self, update, autoconnect): | ||
tr = update.make_testreport(self.config, autoconnect=autoconnect) | ||
self.metadata = tr | ||
self.targets = tr.targets | ||
self.set_prompt(None) | ||
short_rrid = str(update.id).replace("SUSE", "S").replace("Maintenance", "M") |
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.
... this
43f928c
to
c072b3b
Compare
c072b3b
to
e2588e5
Compare
.PHONY: tidy-diff | ||
tidy-diff: | ||
black --diff ./ | ||
|
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.
valid extension. But please make that a separate commit
dboard_burl = "http://dashboard.qam.suse.de/incident/" | ||
openqa_burl = "https://openqa.suse.de/tests/overview?build=:" |
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.
Please avoid specifying any SUSE internal URLs that are not relevant to this "upstream" open source project
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.
So should I avoid this change entirely?
or get the base urls from some other ways like the user environment?
or have them in mtui/config.py where a few simillar urls are already defined?
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.
reading from user environment or mtu/config.py both sounds good. I would just avoid specifying any SUSE internal URLs but for convenience maybe it makes sense to provide them but then please in a specific config file. https://github.com/openSUSE/mtui/blob/main/mtui/config.py#L114 looks similar so I guess it's ok if you define URLs there.
@@ -443,6 +452,8 @@ def _show_yourself_data(self): | |||
("Build checks", self._testreport_url()[:-3] + "build_checks"), | |||
("Testreport", self._testreport_url()), | |||
("Repository", self.repository), | |||
("DashBoard Link", self._get_result_links()[0]), | |||
("OpenQA Link", self._get_result_links()[1]), |
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.
("OpenQA Link", self._get_result_links()[1]), | |
("openQA Link", self._get_result_links()[1]), |
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.
I would also lowercase "Link" here, as well as in the line above. If this ends up rendered as link then maybe also drop " Link" completely. The other entries also don't have " Link".
@@ -443,6 +452,8 @@ def _show_yourself_data(self): | |||
("Build checks", self._testreport_url()[:-3] + "build_checks"), | |||
("Testreport", self._testreport_url()), | |||
("Repository", self.repository), | |||
("DashBoard Link", self._get_result_links()[0]), |
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.
("DashBoard Link", self._get_result_links()[0]), | |
("Dashboard Link", self._get_result_links()[0]), |
@@ -1,6 +1,7 @@ | |||
import logging | |||
import sys | |||
from subprocess import CalledProcessError | |||
import setproctitle |
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.
oh, nonexisting module
@@ -11,6 +12,7 @@ | |||
|
|||
from .argparse import ArgsParseFailure | |||
from .colorlog import create_logger | |||
from .utils import get_short_rrid |
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.
why special function if this can be method of RequestReviewID class ?
@@ -45,6 +46,9 @@ def run_mtui(sys, config, logger, Prompt, Display, args): | |||
|
|||
prompt = Prompt(config, logger, sys, Display) | |||
if args.update: | |||
short_rrid = get_short_rrid(str(args.update.id)) | |||
# helps to set window/tab title with reviewid | |||
setproctitle.setproctitle("mtui-" + short_rrid) |
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.
btw how will load_template
command change title ?
dboard_burl = "http://dashboard.qam.suse.de/incident/" | ||
openqa_burl = "https://openqa.suse.de/tests/overview?build=:" | ||
dboard_lnk = dboard_burl + incident_id | ||
openqa_lnk = openqa_burl + incident_id + ":" + self.srpms[0] |
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.
rly ? this can't work
|
||
self._attrs = [ | ||
"products", | ||
"category", | ||
"packager", | ||
"reviewer", | ||
"packages", | ||
"srpms", |
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.
and parser for srpms is where ? and data source ?
@@ -333,3 +333,7 @@ def walk(inc): | |||
if isinstance(inc[key], (list, dict)): | |||
inc[key] = walk(inc[key]) | |||
return inc | |||
|
|||
|
|||
def get_short_rrid(id_str): |
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.
why ? this should be method of RequestReviewID ...
S:M:xxxxx:yyyyyy/mtui-auto>
. This requirespython311-settproctitle
.Would like to get more insights and comments.