Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into pr-osparc-orphane…
Browse files Browse the repository at this point in the history
…d-containers-removal
  • Loading branch information
Andrei Neagu committed Dec 10, 2024
2 parents e68afac + 6d1ee29 commit 4424d0f
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 89 deletions.
81 changes: 0 additions & 81 deletions .github/workflows/ci-testing-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }} \
.
87 changes: 87 additions & 0 deletions .github/workflows/ci-testing-pull-request.yml
Original file line number Diff line number Diff line change
@@ -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 }} \
.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class CreditClassification(StrAutoEnum):

class PricingPlanClassification(StrAutoEnum):
TIER = auto()
LICENSE = auto()


class PricingInfo(BaseModel):
Expand Down
Original file line number Diff line number Diff line change
@@ -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 ###
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class PricingPlanClassification(str, enum.Enum):
"""

TIER = "TIER"
LICENSE = "LICENSE"


resource_tracker_pricing_plans = sa.Table(
Expand Down
3 changes: 2 additions & 1 deletion services/api-server/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -6469,7 +6469,8 @@
"PricingPlanClassification": {
"type": "string",
"enum": [
"TIER"
"TIER",
"LICENSE"
],
"title": "PricingPlanClassification"
},
Expand Down
11 changes: 10 additions & 1 deletion services/catalog/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down Expand Up @@ -2843,7 +2849,10 @@
"thumbnail": {
"anyOf": [
{
"type": "string"
"type": "string",
"maxLength": 2083,
"minLength": 1,
"format": "uri"
},
{
"type": "null"
Expand Down
3 changes: 2 additions & 1 deletion services/resource-usage-tracker/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,8 @@
"PricingPlanClassification": {
"type": "string",
"enum": [
"TIER"
"TIER",
"LICENSE"
],
"title": "PricingPlanClassification"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11432,6 +11432,7 @@ components:
type: string
enum:
- TIER
- LICENSE
title: PricingPlanClassification
PricingPlanToServiceAdminGet:
properties:
Expand Down
7 changes: 2 additions & 5 deletions services/web/server/tests/unit/isolated/test_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,15 @@
def mock_webserver_service_environment(
monkeypatch: pytest.MonkeyPatch, mock_webserver_service_environment: EnvVarsDict
) -> EnvVarsDict:
envs = mock_webserver_service_environment | setenvs_from_dict(
monkeypatch.delenv("WEBSERVER_TRACING")
return mock_webserver_service_environment | setenvs_from_dict(
monkeypatch,
{
"TRACING_OPENTELEMETRY_COLLECTOR_ENDPOINT": "http://opentelemetry-collector",
"TRACING_OPENTELEMETRY_COLLECTOR_PORT": "4318",
},
)

envs.pop("WEBSERVER_TRACING")

return envs


def test_middleware_restrictions_opentelemetry_is_second_middleware(
mock_webserver_service_environment: EnvVarsDict,
Expand Down

0 comments on commit 4424d0f

Please sign in to comment.