Skip to content

Commit 69506c4

Browse files
authored
Merge branch 'master' into dependabot/npm_and_yarn/tests/e2e/npm_and_yarn-47ce2aa328
2 parents b1e1f9f + bc3996b commit 69506c4

File tree

38 files changed

+843
-254
lines changed

38 files changed

+843
-254
lines changed

packages/service-library/src/servicelib/rabbitmq/_errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class RemoteMethodNotRegisteredError(BaseRPCError):
2424
class RPCServerError(BaseRPCError):
2525
msg_template = (
2626
"While running method '{method_name}' raised "
27-
"'{exc_type}': '{exc_message}'\n{traceback}"
27+
"'{exc_type}' [{error_code}]: '{exc_message}'\n{traceback}"
2828
)
2929

3030

packages/service-library/src/servicelib/rabbitmq/_rpc_router.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@
66
from dataclasses import dataclass, field
77
from typing import Any, TypeVar
88

9+
from common_library.error_codes import create_error_code
910
from models_library.rabbitmq_basic_types import RPCMethodName
11+
from servicelib.logging_errors import create_troubleshootting_log_kwargs
1012

1113
from ..logging_utils import log_context
1214
from ._errors import RPCServerError
1315

1416
DecoratedCallable = TypeVar("DecoratedCallable", bound=Callable[..., Any])
1517

16-
# NOTE: this is equivalent to http access logs
17-
_logger = logging.getLogger("rpc.access")
18+
19+
_logger = logging.getLogger(
20+
# NOTE: this logger is equivalent to http access logs
21+
"rpc.access"
22+
)
1823

1924

2025
def _create_func_msg(func, args: tuple[Any, ...], kwargs: dict[str, Any]) -> str:
@@ -40,7 +45,9 @@ def expose(
4045
*,
4146
reraise_if_error_type: tuple[type[Exception], ...] | None = None,
4247
) -> Callable[[DecoratedCallable], DecoratedCallable]:
48+
4349
def _decorator(func: DecoratedCallable) -> DecoratedCallable:
50+
4451
@functools.wraps(func)
4552
async def _wrapper(*args, **kwargs):
4653
with log_context(
@@ -64,9 +71,19 @@ async def _wrapper(*args, **kwargs):
6471
):
6572
raise
6673

74+
error_code = create_error_code(exc)
6775
_logger.exception(
68-
"Unhandled exception on the rpc-server side. Re-raising as %s.",
69-
RPCServerError.__name__,
76+
# NOTE: equivalent to a 500 http status code error
77+
**create_troubleshootting_log_kwargs(
78+
f"Unhandled exception on the rpc-server side for '{func.__name__}'",
79+
error=exc,
80+
error_code=error_code,
81+
error_context={
82+
"rpc_method": func.__name__,
83+
"args": args,
84+
"kwargs": kwargs,
85+
},
86+
)
7087
)
7188
# NOTE: we do not return internal exceptions over RPC
7289
formatted_traceback = "\n".join(
@@ -77,6 +94,7 @@ async def _wrapper(*args, **kwargs):
7794
exc_type=f"{exc.__class__.__module__}.{exc.__class__.__name__}",
7895
exc_message=f"{exc}",
7996
traceback=f"{formatted_traceback}",
97+
error_code=error_code,
8098
) from None
8199

82100
self.routes[RPCMethodName(func.__name__)] = _wrapper

services/catalog/src/simcore_service_catalog/api/rpc/_services.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from models_library.users import UserID
2121
from pydantic import TypeAdapter, ValidationError, validate_call
2222
from pyinstrument import Profiler
23-
from servicelib.logging_utils import log_decorator
2423
from servicelib.rabbitmq import RPCRouter
2524
from servicelib.rabbitmq.rpc_interfaces.catalog.errors import (
2625
CatalogForbiddenError,
@@ -106,7 +105,6 @@ async def list_services_paginated(
106105
ValidationError,
107106
)
108107
)
109-
@log_decorator(_logger, level=logging.DEBUG)
110108
@_profile_rpc_call
111109
@validate_call(config={"arbitrary_types_allowed": True})
112110
async def get_service(
@@ -141,7 +139,6 @@ async def get_service(
141139
ValidationError,
142140
)
143141
)
144-
@log_decorator(_logger, level=logging.DEBUG)
145142
@validate_call(config={"arbitrary_types_allowed": True})
146143
async def update_service(
147144
app: FastAPI,
@@ -179,7 +176,6 @@ async def update_service(
179176
ValidationError,
180177
)
181178
)
182-
@log_decorator(_logger, level=logging.DEBUG)
183179
@validate_call(config={"arbitrary_types_allowed": True})
184180
async def check_for_service(
185181
app: FastAPI,
@@ -203,7 +199,6 @@ async def check_for_service(
203199

204200

205201
@router.expose(reraise_if_error_type=(CatalogForbiddenError, ValidationError))
206-
@log_decorator(_logger, level=logging.DEBUG)
207202
@validate_call(config={"arbitrary_types_allowed": True})
208203
async def batch_get_my_services(
209204
app: FastAPI,
@@ -233,7 +228,6 @@ async def batch_get_my_services(
233228

234229

235230
@router.expose(reraise_if_error_type=(ValidationError,))
236-
@log_decorator(_logger, level=logging.DEBUG)
237231
@validate_call(config={"arbitrary_types_allowed": True})
238232
async def list_my_service_history_latest_first(
239233
app: FastAPI,
@@ -281,7 +275,6 @@ async def list_my_service_history_latest_first(
281275
ValidationError,
282276
)
283277
)
284-
@log_decorator(_logger, level=logging.DEBUG)
285278
@validate_call(config={"arbitrary_types_allowed": True})
286279
async def get_service_ports(
287280
app: FastAPI,

services/director-v2/src/simcore_service_director_v2/modules/dask_client.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,10 @@ async def _get_task_state(job_id: str) -> RunningState:
450450
parsed_event = TaskLifeCycleState.model_validate(dask_events[-1][1])
451451

452452
if parsed_event.state == RunningState.FAILED:
453+
log_error_context = {
454+
"job_id": job_id,
455+
"dask-scheduler": self.backend.scheduler_id,
456+
}
453457
try:
454458
# find out if this was a cancellation
455459
task_future: distributed.Future = (
@@ -461,10 +465,7 @@ async def _get_task_state(job_id: str) -> RunningState:
461465
timeout=_DASK_DEFAULT_TIMEOUT_S
462466
)
463467
assert isinstance(exception, Exception) # nosec
464-
log_error_context = {
465-
"job_id": job_id,
466-
"dask-scheduler": self.backend.scheduler_id,
467-
}
468+
468469
if isinstance(exception, TaskCancelledError):
469470
_logger.info(
470471
**create_troubleshootting_log_kwargs(

services/static-webserver/client/source/class/osparc/NewRelease.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ qx.Class.define("osparc.NewRelease", {
7373
const releaseTag = osparc.utils.Utils.getReleaseTag();
7474
const releaseLink = osparc.utils.Utils.getReleaseLink();
7575
const linkLabel = new osparc.ui.basic.LinkLabel().set({
76-
value: this.tr("What's new in ") + releaseTag,
76+
value: this.tr("What's New in ") + releaseTag,
7777
url: releaseLink,
7878
font: "link-label-14"
7979
});

services/static-webserver/client/source/class/osparc/dashboard/Dashboard.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,12 @@ qx.Class.define("osparc.dashboard.Dashboard", {
5454
osparc.wrapper.JsonTreeViewer.getInstance().init();
5555
osparc.wrapper.JsonFormatter.getInstance().init();
5656
osparc.wrapper.DOMPurify.getInstance().init();
57-
osparc.wrapper.RadialMenu.getInstance().init()
58-
.then(loaded => {
59-
if (loaded) {
60-
// hack to trigger fonts loading
61-
const menu = osparc.wrapper.RadialMenu.getInstance().createMenu();
62-
menu.show();
63-
menu.hide();
64-
}
65-
});
57+
osparc.wrapper.RadialMenu.getInstance().init();
58+
6659
this.__createMainViewLayout();
60+
61+
62+
qx.event.message.Bus.getInstance().subscribe("showTab", msg => this.showTab(msg.getData()), this);
6763
},
6864

6965
properties: {
@@ -99,6 +95,13 @@ qx.Class.define("osparc.dashboard.Dashboard", {
9995
return this.__appBrowser;
10096
},
10197

98+
showTab: function(tabId) {
99+
const tabFound = this.getSelectables().find(s => s.id === tabId);
100+
if (tabFound) {
101+
this.setSelection([tabFound]);
102+
}
103+
},
104+
102105
__createMainViewLayout: function() {
103106
const permissions = osparc.data.Permissions.getInstance();
104107
const tabIconSize = 20;

services/static-webserver/client/source/class/osparc/dashboard/StudyBrowser.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -356,20 +356,24 @@ qx.Class.define("osparc.dashboard.StudyBrowser", {
356356
}
357357
}
358358

359-
// Show Quick Start if there are no studies in the root folder of the personal workspace
360-
const quickStartInfo = osparc.product.quickStart.Utils.getQuickStart();
361-
if (quickStartInfo) {
362-
const dontShowQuickStart = osparc.utils.Utils.localCache.getLocalStorageItem(quickStartInfo.localStorageStr);
363-
if (dontShowQuickStart === "true" || this.__dontQuickStart) {
364-
return;
365-
}
366-
const nStudies = "_meta" in resp ? resp["_meta"]["total"] : 0;
367-
if (
368-
nStudies === 0 &&
369-
this.getCurrentContext() === osparc.dashboard.StudyBrowser.CONTEXT.PROJECTS &&
370-
this.getCurrentWorkspaceId() === null &&
371-
this.getCurrentFolderId() === null
372-
) {
359+
// Check if this is the first time the user logged in
360+
const nStudies = "_meta" in resp ? resp["_meta"]["total"] : 0;
361+
if (
362+
nStudies === 0 &&
363+
this.getCurrentContext() === osparc.dashboard.StudyBrowser.CONTEXT.PROJECTS &&
364+
this.getCurrentWorkspaceId() === null &&
365+
this.getCurrentFolderId() === null
366+
) {
367+
// It is!
368+
// Open Support Center
369+
osparc.support.SupportCenter.openWindow();
370+
// and open the Introductory Quick Start if any
371+
const quickStartInfo = osparc.product.quickStart.Utils.getQuickStart();
372+
if (quickStartInfo) {
373+
const dontShowQuickStart = osparc.utils.Utils.localCache.getLocalStorageItem(quickStartInfo.localStorageStr);
374+
if (dontShowQuickStart === "true" || this.__dontQuickStart) {
375+
return;
376+
}
373377
const quickStartWindow = quickStartInfo.tutorial();
374378
quickStartWindow.center();
375379
quickStartWindow.open();

services/static-webserver/client/source/class/osparc/data/model/IframeHandler.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ qx.Class.define("osparc.data.model.IframeHandler", {
116116

117117
__initIFrame: function() {
118118
const iframe = new osparc.widget.PersistentIframe();
119+
if (this.getNode().getKey().includes("s4l-ui")) {
120+
iframe.getIframe().setAppearance("iframe-no-border");
121+
}
119122
osparc.utils.Utils.setIdToWidget(iframe.getIframe(), "iframe_"+this.getNode().getNodeId());
120123
this.self().evalShowToolbar(iframe, this.getStudy());
121124
iframe.addListener("restart", () => this.restartIFrame(), this);

services/static-webserver/client/source/class/osparc/desktop/account/ProfilePage.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ qx.Class.define("osparc.desktop.account.ProfilePage", {
5858
},
5959

6060
createSectionBox: function(title) {
61-
const box = osparc.ui.window.TabbedView.createSectionBox(title).set({
61+
const box = new osparc.widget.SectionBox(title).set({
6262
alignX: "left",
6363
maxWidth: 500
6464
});
@@ -337,9 +337,7 @@ qx.Class.define("osparc.desktop.account.ProfilePage", {
337337
const privacyModel = this.__userPrivacyModel = qx.data.marshal.Json.createModel(defaultModel, true);
338338

339339
const box = this.self().createSectionBox(this.tr("Privacy"));
340-
341-
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("Choose what others see."));
342-
box.add(label);
340+
box.addHelper(this.tr("Choose what others see."));
343341

344342
const hideUserName = new qx.ui.form.CheckBox().set({
345343
value: defaultModel.hideUserName
@@ -453,9 +451,7 @@ qx.Class.define("osparc.desktop.account.ProfilePage", {
453451

454452
__create2FASection: function() {
455453
const box = this.self().createSectionBox(this.tr("Two-Factor Authentication"));
456-
457-
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("Set your preferred method to use for two-factor authentication when signing in:"));
458-
box.add(label);
454+
box.addHelper(this.tr("Set your preferred method to use for two-factor authentication when signing in:"));
459455

460456
const form = new qx.ui.form.Form();
461457

@@ -659,9 +655,7 @@ qx.Class.define("osparc.desktop.account.ProfilePage", {
659655
__createDeleteAccount: function() {
660656
// layout
661657
const box = this.self().createSectionBox(this.tr("Delete Account"));
662-
663-
const label = osparc.ui.window.TabbedView.createHelpLabel(this.tr("Request the deletion of your account."));
664-
box.add(label);
658+
box.addHelper(this.tr("Request the deletion of your account."));
665659

666660
const deleteBtn = new qx.ui.form.Button(this.tr("Delete Account")).set({
667661
appearance: "danger-button",

services/static-webserver/client/source/class/osparc/desktop/credits/BuyCreditsStepper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ qx.Class.define("osparc.desktop.credits.BuyCreditsStepper", {
6868
const { paymentId, paymentFormUrl } = data;
6969
this.setPaymentId(paymentId)
7070
this.__iframe = new qx.ui.embed.Iframe(paymentFormUrl).set({
71-
decorator: "no-border-2"
71+
decorator: "no-border-0"
7272
});
7373
this.add(this.__iframe);
7474
this.setSelection([this.__iframe])

0 commit comments

Comments
 (0)