Skip to content
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/extends products plugin (⚠️ devops) #3540

Merged
merged 24 commits into from
Nov 14, 2022

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Nov 10, 2022

What do these changes do?

This PR extends the functionality of the product's plugin to support new requirements in the front-end (see PR #3534)

  • ✨ Major changes in the product's table (see (⚠️ devops) below)
    • added new JSONB columns for manuals, support resources or vendor information
    • see details in postgres_database/models/products.py
  • GET /static-frontend-data.json response includes ONLY information of selected product

⚠️ devops

front-end

New GET /static/frontend-data.json

{
  "apiVersion": "0.10.0",
  "appName": "simcore_service_webserver",
  "buildDate": "2022-11-11T20:17:52Z",
  "vcsRef": "4b69691ae08f2460fe08aad12f24e4c9f4b6b39f",
  "vcsUrl": "[email protected]:pcrespov/osparc-simcore.git",
  "stackName": "master-simcore",
  "webserverProjects": {
    "PROJECTS_MAX_NUM_RUNNING_DYNAMIC_NODES": 5
  },
  "pluginsDisabled": [
    "WEBSERVER_VERSION_CONTROL",
    "WEBSERVER_META_MODELING",
    "WEBSERVER_CLUSTERS"
  ],
  "thirdPartyReferences": [
    {
      "name": "adminer",
      "version": "4.8.0",
      "url": "https://www.adminer.org/",
      "thumbnail": "https://www.adminer.org/static/images/logo.png"
    },
    {
      "name": "dask",
      "version": "-",
      "url": "https://docs.dask.org/en/latest/scheduler-overview.html",
      "thumbnail": "https://dask.org/_images/dask_horizontal_white_no_pad.svg"
    },
    {
      "name": "docker",
      "version": "-",
      "url": "https://www.docker.com/",
      "thumbnail": "https://www.docker.com/sites/default/files/d8/2019-07/horizontal-logo-monochromatic-white.png"
    },
    {
      "name": "github",
      "version": "-",
      "url": "https://github.com/",
      "thumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/9/91/Octicons-mark-github.svg/2048px-Octicons-mark-github.svg.png"
    },
    {
      "name": "minio",
      "version": "-",
      "url": "https://min.io/",
      "thumbnail": "https://min.io/resources/img/logo.svg"
    },
    {
      "name": "portainer",
      "version": "-",
      "url": "https://www.portainer.io/",
      "thumbnail": "https://www.portainer.io/hubfs/Brand%20Assets/Logos/Portainer%20Logo%20Solid%20All%20-%20Blue%20no%20padding.svg"
    },
    {
      "name": "postgres",
      "version": "10.11",
      "url": "https://www.postgresql.org/",
      "thumbnail": "https://www.postgresql.org/media/img/about/press/elephant.png"
    },
    {
      "name": "redis",
      "version": "-",
      "url": "https://redis.io/",
      "thumbnail": "https://redis.io/images/redis-white.png"
    }
  ],
  "displayName": "o\u00b2S\u00b2PARC",
  "supportEmail": "[email protected]",
  "vendor": {
    "name": "ACME",
    "copyright": "\u00a9 ACME correcaminos",
    "url": "https://acme.com"
  },
  "issues": [
    {
      "label": "github",
      "login_url": "https://github.com/ITISFoundation/osparc-simcore",
      "new_url": "https://github.com/ITISFoundation/osparc-simcore/issues/new/choose"
    },
    {
      "label": "fogbugz",
      "login_url": "https://fogbugz.com/login",
      "new_url": "https://fogbugz.com/new?project=123"
    }
  ],
  "manuals": [
    {
      "label": "main",
      "url": "doc.acme.com"
    },
    {
      "label": "z43",
      "url": "yet-another-manual.acme.com"
    }
  ],
  "support": [
    {
      "kind": "forum",
      "label": "forum",
      "url": "forum.acme.com"
    },
    {
      "kind": "email",
      "label": "email",
      "email": "[email protected]"
    },
    {
      "kind": "web",
      "label": "web-form",
      "url": "support.acme.com"
    }
  ]
}

image

@odeimaiz I think the viewer needs some changes so it can render objects (i.e. trees). Otherwise, just show the json as is (at the end of the day, this is only for testers)

Related issue/s

How to test

cd services/web/server
make install-dev
pytest -vv tests/**/test_product*.py

Checklist

  • make version-*
  • make openapi.json
  • cd packages/postgres-database, make setup-commit, sc-pg review -m "my changes"
  • Unit tests for the changes exist
  • Runs in the swarm
  • Documentation reflects the changes
  • New module? Add your github username to .github/CODEOWNERS

@pcrespov pcrespov self-assigned this Nov 10, 2022
@codecov
Copy link

codecov bot commented Nov 10, 2022

Codecov Report

Merging #3540 (8d8847a) into master (8532cf0) will decrease coverage by 1.3%.
The diff coverage is 84.6%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #3540     +/-   ##
========================================
- Coverage    83.5%   82.1%   -1.4%     
========================================
  Files         852     802     -50     
  Lines       35978   34193   -1785     
  Branches      759     616    -143     
========================================
- Hits        30054   28105   -1949     
- Misses       5727    5921    +194     
+ Partials      197     167     -30     
Flag Coverage Δ
integrationtests 47.1% <62.9%> (-20.1%) ⬇️
unittests 81.0% <84.6%> (+0.4%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ervice-library/src/servicelib/statics_constants.py 0.0% <ø> (ø)
...er/src/simcore_service_webserver/statics_events.py 38.1% <16.6%> (-1.1%) ⬇️
...eb/server/src/simcore_service_webserver/statics.py 61.1% <50.0%> (-1.4%) ⬇️
.../src/simcore_service_webserver/statics_handlers.py 33.3% <57.1%> (-1.5%) ⬇️
...erver/src/simcore_service_webserver/products_db.py 80.0% <75.0%> (-3.8%) ⬇️
...er/src/simcore_service_webserver/products_model.py 96.0% <96.0%> (ø)
...e/src/simcore_postgres_database/models/products.py 100.0% <100.0%> (ø)
...er/src/simcore_service_api_server/core/settings.py 100.0% <100.0%> (ø)
...talog/src/simcore_service_catalog/core/settings.py 100.0% <100.0%> (ø)
...b/server/src/simcore_service_webserver/products.py 74.5% <100.0%> (+0.5%) ⬆️
... and 98 more

@pcrespov pcrespov force-pushed the is765/s4lite-products branch 2 times, most recently from 02d2348 to 2a0e22d Compare November 11, 2022 16:07
@pcrespov pcrespov changed the title Is765/s4lite products backend Is765/s4lite products backend (⚠️ devops) Nov 11, 2022
@pcrespov pcrespov marked this pull request as ready for review November 11, 2022 17:49
@pcrespov pcrespov added the a:webserver issue related to the webserver service label Nov 11, 2022
@pcrespov pcrespov changed the title Is765/s4lite products backend (⚠️ devops) ✨ Is765/s4lite products backend (⚠️ devops) Nov 13, 2022
@pcrespov pcrespov changed the title ✨ Is765/s4lite products backend (⚠️ devops) ✨ Is765/extends products plugin (⚠️ devops) Nov 13, 2022
Copy link
Member

@sanderegg sanderegg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great, just one thing is that the migration should actually take care of migrating the data. else that means you require manual changes (as stated in the description, but that goes against having a migration that works out of the box).



def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: why is there no migration script for the data there? Same for the downgrade.

Copy link
Member Author

@pcrespov pcrespov Nov 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the interest of time, @odeimaiz and me decided that this had a very low return of investment (would have to pass str columns to json columns).
I think in this case it is "affordable" since this is read-only data and inserted manually via adminer. In addition, it is version-controlled separately in the repo indicated above.
what do you think?

packages/postgres-database/tests/test_models_products.py Outdated Show resolved Hide resolved
@pcrespov pcrespov added this to the Athena milestone Nov 13, 2022
Copy link
Member

@odeimaiz odeimaiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exposed frontend-data.json is exactly what we need. Thanks!

@sonarcloud
Copy link

sonarcloud bot commented Nov 14, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@pcrespov pcrespov merged commit a028fcd into ITISFoundation:master Nov 14, 2022
@pcrespov pcrespov deleted the is765/s4lite-products branch November 15, 2022 10:08
@pcrespov pcrespov restored the is765/s4lite-products branch November 15, 2022 10:09
@pcrespov pcrespov deleted the is765/s4lite-products branch November 15, 2022 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:webserver issue related to the webserver service
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants