-
Notifications
You must be signed in to change notification settings - Fork 26
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
Is765/fix default product (⚠️ devops ) #3552
Is765/fix default product (⚠️ devops ) #3552
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3552 +/- ##
======================================
Coverage 83.4% 83.4%
======================================
Files 854 854
Lines 35945 35945
Branches 765 765
======================================
Hits 30002 30002
Misses 5744 5744
Partials 199 199
Flags with carried forward coverage won't be shown. Click here to find out more. |
4455e46
to
a6aecb7
Compare
|
||
:: raises ValueError if undefined | ||
""" | ||
product_name = await conn.scalar( |
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 the obvious question.. who creates the entry in the database?
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.
It has to be done by an operator
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.
But if it is not done, the services fail to start
@@ -101,7 +101,7 @@ def auth(mocker, app: FastAPI, faker: Faker) -> HTTPBasicAuth: | |||
# mock engine if db was not init | |||
if app.state.settings.API_SERVER_POSTGRES is None: | |||
|
|||
engine = mocker.Mock() | |||
engine = mocker.MagicMock() |
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.
Q: what is the difference?
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.
one is magic, the other isn't ;-b
e.g. in this case, with Magic he auto-generate mocks for functions e.g. async with engine.acquire()
would return a new MagicMock
. This does not happen with only Mock
1974146
to
7a0886b
Compare
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.
Some comments below
services/web/server/src/simcore_service_webserver/products_events.py
Outdated
Show resolved
Hide resolved
packages/postgres-database/src/simcore_postgres_database/utils_products.py
Show resolved
Hide resolved
7a0886b
to
bbeb86a
Compare
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.
👍 Very nice! Thanks for the changes.
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.
👍
167dd22
to
6f6407d
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
What do these changes do?
The design of products was originally conceived as a way to serve different "software products" (e.g. different front-end, catalog, ... ) within the same deployment in addition to the default
osparc
product. Nonetheless, this idea has evolved into having a single product per deploy which might NOT necessarily beosparc
.In this PR we default the concept of
default_product
which corresponds to the item with highest priority in theproducts
table.This definition affects three services, namely the
web-server
, thecatalog
and theapi-server
.API_SERVER_DEFAULT_PRODUCT_NAME
CATALOG_ACCESS_RIGHTS_DEFAULT_PRODUCT_NAME
products.priority==0
for the main product in the deploy and andproducts.priority>0
for the restRelated issue/s
How to test