diff --git a/.github/workflows/ci-testing-deploy.yml b/.github/workflows/ci-testing-deploy.yml index 50765b74cdc..aa1efbee7a9 100644 --- a/.github/workflows/ci-testing-deploy.yml +++ b/.github/workflows/ci-testing-deploy.yml @@ -2661,84 +2661,3 @@ jobs: env: TAG_PREFIX: hotfix-staging-github run: ./ci/deploy/dockerhub-deploy.bash -n - - system-api-specs: - needs: [changes] - if: ${{ needs.changes.outputs.anything-py == 'true' || github.event_name == 'push' }} - timeout-minutes: 10 - name: "[sys] check api-specs are up to date" - runs-on: ubuntu-latest - steps: - - name: Ensure job passes if not PR # ensure pass so upstream jobs which depend on this will run (dockerhub deployment) - if: ${{ github.event.pull_request == null }} - run: echo "::notice Passing job because not in PR"; exit 0 - - name: setup python environment - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - name: install uv - uses: astral-sh/setup-uv@v4 - with: - version: "0.4.x" - enable-cache: false - - name: checkout source branch - uses: actions/checkout@v4 - - name: Regenerate specs and check - run: | - uv venv .venv && source .venv/bin/activate - make openapi-specs - ./ci/github/helpers/openapi-specs-diff.bash diff \ - https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.full_name }}/refs/heads/${{ github.event.pull_request.head.ref }} \ - . - - system-backwards-compatibility: - needs: [changes, system-api-specs] - if: ${{ needs.changes.outputs.anything-py == 'true' || github.event_name == 'push' }} - timeout-minutes: 10 - name: "[sys] api-server backwards compatibility" - runs-on: ubuntu-latest - steps: - - name: Ensure job passes if not PR # ensure pass so upstream jobs which depend on this will run (dockerhub deployment) - if: ${{ github.event.pull_request == null }} - run: echo "::notice Passing job because not in PR"; exit 0 - - name: setup python environment - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - name: install uv - uses: astral-sh/setup-uv@v4 - with: - version: "0.4.x" - enable-cache: false - - name: checkout - uses: actions/checkout@v4 - - name: check api-server backwards compatibility - run: | - ./scripts/openapi-diff.bash breaking --fail-on ERR\ - https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/refs/heads/${{ github.event.pull_request.base.ref }}/services/api-server/openapi.json \ - /specs/services/api-server/openapi.json - - api-spec-backwards-compatibility: - needs: [changes, system-api-specs] - if: ${{ needs.changes.outputs.anything-py == 'true' && github.event_name == 'push' && github.event.pull_request != null }} - continue-on-error: true - timeout-minutes: 10 - name: "api-specs-backwards-compatibility" - runs-on: ubuntu-latest - steps: - - name: setup python environment - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - name: install uv - uses: astral-sh/setup-uv@v4 - with: - version: "0.4.x" - enable-cache: false - - name: checkout - uses: actions/checkout@v4 - - name: Check openapi-specs backwards compatibility - run: | - ./ci/github/helpers/openapi-specs-diff.bash breaking \ - https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/refs/heads/${{ github.event.pull_request.base.ref }} \ - . diff --git a/.github/workflows/ci-testing-pull-request.yml b/.github/workflows/ci-testing-pull-request.yml new file mode 100644 index 00000000000..3d877cb091a --- /dev/null +++ b/.github/workflows/ci-testing-pull-request.yml @@ -0,0 +1,87 @@ +# This workflow holds jobs which are required to pass before merging into master + +name: PR CI +on: + pull_request: + branches: + - "*" + # https://github.blog/changelog/2023-02-08-pull-request-merge-queue-public-beta/ + merge_group: + branches: + - "master" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + api-specs: + timeout-minutes: 10 + name: "check oas' are up to date" + runs-on: ubuntu-latest + steps: + - name: setup python environment + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: install uv + uses: astral-sh/setup-uv@v4 + with: + version: "0.4.x" + enable-cache: false + - name: checkout source branch + uses: actions/checkout@v4 + - name: Regenerate specs and check + run: | + uv venv .venv && source .venv/bin/activate + make openapi-specs + ./ci/github/helpers/openapi-specs-diff.bash diff \ + https://raw.githubusercontent.com/${{ github.event.pull_request.head.repo.full_name }}/refs/heads/${{ github.event.pull_request.head.ref }} \ + . + + api-server-backwards-compatibility: + needs: api-specs + timeout-minutes: 10 + name: "api-server backwards compatibility" + runs-on: ubuntu-latest + steps: + - name: setup python environment + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: install uv + uses: astral-sh/setup-uv@v4 + with: + version: "0.4.x" + enable-cache: false + - name: checkout + uses: actions/checkout@v4 + - name: check api-server backwards compatibility + run: | + ./scripts/openapi-diff.bash breaking --fail-on ERR\ + https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/refs/heads/${{ github.event.pull_request.base.ref }}/services/api-server/openapi.json \ + /specs/services/api-server/openapi.json + + oas-backwards-compatibility: + needs: api-specs + continue-on-error: true + timeout-minutes: 10 + name: "oas backwards compatibility" + runs-on: ubuntu-latest + steps: + - name: setup python environment + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: install uv + uses: astral-sh/setup-uv@v4 + with: + version: "0.4.x" + enable-cache: false + - name: checkout + uses: actions/checkout@v4 + - name: Check openapi-specs backwards compatibility + run: | + ./ci/github/helpers/openapi-specs-diff.bash breaking \ + https://raw.githubusercontent.com/${{ github.event.pull_request.base.repo.full_name }}/refs/heads/${{ github.event.pull_request.base.ref }} \ + . diff --git a/packages/models-library/src/models_library/resource_tracker.py b/packages/models-library/src/models_library/resource_tracker.py index 53e370913a9..c94755817b3 100644 --- a/packages/models-library/src/models_library/resource_tracker.py +++ b/packages/models-library/src/models_library/resource_tracker.py @@ -52,6 +52,7 @@ class CreditClassification(StrAutoEnum): class PricingPlanClassification(StrAutoEnum): TIER = auto() + LICENSE = auto() class PricingInfo(BaseModel): diff --git a/packages/postgres-database/src/simcore_postgres_database/migration/versions/4d007819e61a_add_license_type_to_pricing_plan.py b/packages/postgres-database/src/simcore_postgres_database/migration/versions/4d007819e61a_add_license_type_to_pricing_plan.py new file mode 100644 index 00000000000..03b117ca485 --- /dev/null +++ b/packages/postgres-database/src/simcore_postgres_database/migration/versions/4d007819e61a_add_license_type_to_pricing_plan.py @@ -0,0 +1,25 @@ +"""add LICENSE type to pricing plan + +Revision ID: 4d007819e61a +Revises: 38c9ac332c58 +Create Date: 2024-12-09 14:25:45.024814+00:00 + +""" +import sqlalchemy as sa +from alembic import op + +# revision identifiers, used by Alembic. +revision = "4d007819e61a" +down_revision = "38c9ac332c58" +branch_labels = None +depends_on = None + + +def upgrade(): + op.execute(sa.DDL("ALTER TYPE pricingplanclassification ADD VALUE 'LICENSE'")) + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### diff --git a/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_plans.py b/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_plans.py index e0e1c69efa6..70c9ec53e03 100644 --- a/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_plans.py +++ b/packages/postgres-database/src/simcore_postgres_database/models/resource_tracker_pricing_plans.py @@ -18,6 +18,7 @@ class PricingPlanClassification(str, enum.Enum): """ TIER = "TIER" + LICENSE = "LICENSE" resource_tracker_pricing_plans = sa.Table( diff --git a/services/api-server/openapi.json b/services/api-server/openapi.json index e04d4b41d32..ee8d7f9479d 100644 --- a/services/api-server/openapi.json +++ b/services/api-server/openapi.json @@ -6469,7 +6469,8 @@ "PricingPlanClassification": { "type": "string", "enum": [ - "TIER" + "TIER", + "LICENSE" ], "title": "PricingPlanClassification" }, diff --git a/services/catalog/openapi.json b/services/catalog/openapi.json index 5f5204053cd..ad9422734c8 100644 --- a/services/catalog/openapi.json +++ b/services/catalog/openapi.json @@ -628,11 +628,17 @@ }, "image": { "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri", "title": "Image", "description": "Url to the badge" }, "url": { "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri", "title": "Url", "description": "Link to the status" } @@ -2843,7 +2849,10 @@ "thumbnail": { "anyOf": [ { - "type": "string" + "type": "string", + "maxLength": 2083, + "minLength": 1, + "format": "uri" }, { "type": "null" diff --git a/services/resource-usage-tracker/openapi.json b/services/resource-usage-tracker/openapi.json index 91ee050d3d9..b267c3f0a9e 100644 --- a/services/resource-usage-tracker/openapi.json +++ b/services/resource-usage-tracker/openapi.json @@ -378,7 +378,8 @@ "PricingPlanClassification": { "type": "string", "enum": [ - "TIER" + "TIER", + "LICENSE" ], "title": "PricingPlanClassification" }, diff --git a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml index 91516c62ee8..0ab1f87a5c1 100644 --- a/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml +++ b/services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml @@ -11432,6 +11432,7 @@ components: type: string enum: - TIER + - LICENSE title: PricingPlanClassification PricingPlanToServiceAdminGet: properties: diff --git a/services/web/server/tests/unit/isolated/test_tracing.py b/services/web/server/tests/unit/isolated/test_tracing.py index ddec0d10422..c236e446ab9 100644 --- a/services/web/server/tests/unit/isolated/test_tracing.py +++ b/services/web/server/tests/unit/isolated/test_tracing.py @@ -17,14 +17,15 @@ def mock_webserver_service_environment( monkeypatch: pytest.MonkeyPatch, mock_webserver_service_environment: EnvVarsDict ) -> EnvVarsDict: - - return mock_webserver_service_environment | setenvs_from_dict( + monkeypatch.delenv("WEBSERVER_TRACING") + envs = mock_webserver_service_environment | setenvs_from_dict( monkeypatch, { "TRACING_OPENTELEMETRY_COLLECTOR_ENDPOINT": "http://opentelemetry-collector", "TRACING_OPENTELEMETRY_COLLECTOR_PORT": "4318", }, ) + return envs def test_middleware_restrictions_opentelemetry_is_second_middleware(