-
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. oh, nonexisting module |
||
|
||
from mtui.args import get_parser | ||
from mtui.config import Config | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. why special function if this can be method of RequestReviewID class ? |
||
|
||
|
||
def main(): | ||
|
@@ -33,7 +35,6 @@ def main(): | |
|
||
|
||
def run_mtui(sys, config, logger, Prompt, Display, args): | ||
|
||
if args.debug: | ||
logger.setLevel(level=logging.DEBUG) | ||
|
||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. btw how will |
||
if args.update.kind == "kernel": | ||
config.kernel = True | ||
config.auto = False | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -85,13 +85,15 @@ def __init__(self, config, scripts_src_dir=None): | |||||
self.reviewer = "" | ||||||
self.repository = None | ||||||
self.packages = {} | ||||||
self.srpms = [] | ||||||
|
||||||
self._attrs = [ | ||||||
"products", | ||||||
"category", | ||||||
"packager", | ||||||
"reviewer", | ||||||
"packages", | ||||||
"srpms", | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and parser for srpms is where ? and data source ? |
||||||
"bugs", | ||||||
"repository", | ||||||
] | ||||||
|
@@ -160,7 +162,6 @@ def _parse(self, tpl: str) -> None: | |||||
self._warn_missing_fields() | ||||||
|
||||||
def _parse_json(self, data, tpl: str) -> None: | ||||||
|
||||||
if self.path: | ||||||
raise TestReportAlreadyLoaded(self.path) | ||||||
|
||||||
|
@@ -430,6 +431,14 @@ def refhosts_from_tp(self, testplatform): | |||||
def list_bugs(self, sink, arg): | ||||||
return sink(self.bugs, self.jira, arg) | ||||||
|
||||||
def _get_result_links(self): | ||||||
incident_id = self.repository.rstrip("/").split("/")[-1] | ||||||
dboard_burl = "http://dashboard.qam.suse.de/incident/" | ||||||
openqa_burl = "https://openqa.suse.de/tests/overview?build=:" | ||||||
Comment on lines
+436
to
+437
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. So should I avoid this change entirely? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more. rly ? this can't work |
||||||
return (dboard_lnk, openqa_lnk) | ||||||
|
||||||
def _show_yourself_data(self): | ||||||
return ( | ||||||
[ | ||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
("OpenQA Link", self._get_result_links()[1]), | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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". |
||||||
] | ||||||
+ [("Testplatform", x) for x in self.testplatforms] | ||||||
+ [("Products", x) for x in self.products] | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. why ? this should be method of RequestReviewID ... |
||
return id_str.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.
valid extension. But please make that a separate commit