From 39206443ec1835c6049a2b5e94cf59d4ceb10483 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Thu, 7 Dec 2023 15:39:35 +0000 Subject: [PATCH 01/10] feat: Can use old and new Firebolt --- setup.cfg | 2 +- src/firebolt_db/firebolt_dialect.py | 11 +++++++++-- tests/unit/test_firebolt_dialect.py | 8 ++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/setup.cfg b/setup.cfg index 648ac77..9d3e66c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -25,7 +25,7 @@ project_urls = [options] packages = find: install_requires = - firebolt-sdk>=1.0.0a + firebolt-sdk>=1.1.0 sqlalchemy>=1.0.0 python_requires = >=3.7 package_dir = diff --git a/src/firebolt_db/firebolt_dialect.py b/src/firebolt_db/firebolt_dialect.py index 73cd1c2..7823d4a 100644 --- a/src/firebolt_db/firebolt_dialect.py +++ b/src/firebolt_db/firebolt_dialect.py @@ -5,7 +5,7 @@ import firebolt.db as dbapi import sqlalchemy.types as sqltypes -from firebolt.client.auth import Auth, ClientCredentials +from firebolt.client.auth import Auth, ClientCredentials, UsernamePassword from firebolt.db import Cursor from sqlalchemy.engine import Connection as AlchemyConnection from sqlalchemy.engine import ExecutionContext, default @@ -143,7 +143,7 @@ def create_connect_args(self, url: URL) -> Tuple[List, Dict]: # parameters are all passed as a string, we need to convert # bool flag to boolean for SDK compatibility token_cache_flag = bool(strtobool(parameters.pop("use_token_cache", "True"))) - auth = ClientCredentials(url.username, url.password, token_cache_flag) + auth = _determine_auth(url.username, url.password, token_cache_flag) kwargs: Dict[str, Union[str, Auth, Dict[str, Any], None]] = { "database": url.host or None, "auth": auth, @@ -356,3 +356,10 @@ def do_commit(self, dbapi_connection: AlchemyConnection) -> None: def get_is_nullable(column_is_nullable: int) -> bool: return column_is_nullable == 1 + + +def _determine_auth(key: str, secret: str, token_cache_flag: bool = True) -> Auth: + if "@" in key: + return UsernamePassword(key, secret, token_cache_flag) + else: + return ClientCredentials(key, secret, token_cache_flag) diff --git a/tests/unit/test_firebolt_dialect.py b/tests/unit/test_firebolt_dialect.py index c1a442d..361be1b 100644 --- a/tests/unit/test_firebolt_dialect.py +++ b/tests/unit/test_firebolt_dialect.py @@ -33,16 +33,16 @@ def test_create_dialect(self, dialect: FireboltDialect): assert isinstance(dialect.type_compiler, FireboltTypeCompiler) assert dialect.context == {} - def test_create_connect_args_service_account(self, dialect: FireboltDialect): + def test_create_connect_args_user_password(self, dialect: FireboltDialect): u = url.make_url( - "test_engine://test-sa-user-key:test_password@test_db_name/test_engine_name" + "test_engine://test-sa@user.com:test_password@test_db_name/test_engine_name" "?account_name=dummy" ) with mock.patch.dict(os.environ, {"FIREBOLT_BASE_URL": "test_url"}): result_list, result_dict = dialect.create_connect_args(u) assert result_dict["engine_name"] == "test_engine_name" - assert result_dict["auth"].client_id == "test-sa-user-key" - assert result_dict["auth"].client_secret == "test_password" + assert result_dict["auth"].username == "test-sa@user.com" + assert result_dict["auth"].password == "test_password" assert result_dict["auth"]._use_token_cache is True assert result_dict["database"] == "test_db_name" assert result_dict["api_endpoint"] == "test_url" From 5cf123ec0eef2902a828a10a436a6b0eef08d36c Mon Sep 17 00:00:00 2001 From: ptiurin Date: Thu, 7 Dec 2023 15:58:52 +0000 Subject: [PATCH 02/10] nightly --- .../{nightly-v0.yml => nightly-v1.yml} | 33 ++++++++----------- .../workflows/{nightly.yml => nightly-v2.yml} | 21 ++++++------ 2 files changed, 23 insertions(+), 31 deletions(-) rename .github/workflows/{nightly-v0.yml => nightly-v1.yml} (81%) rename .github/workflows/{nightly.yml => nightly-v2.yml} (86%) diff --git a/.github/workflows/nightly-v0.yml b/.github/workflows/nightly-v1.yml similarity index 81% rename from .github/workflows/nightly-v0.yml rename to .github/workflows/nightly-v1.yml index 99df3d6..d514993 100644 --- a/.github/workflows/nightly-v0.yml +++ b/.github/workflows/nightly-v1.yml @@ -1,4 +1,4 @@ -name: v0.x Nightly code check +name: v1 Nightly code check on: workflow_dispatch: schedule: @@ -6,39 +6,32 @@ on: jobs: code-check: uses: ./.github/workflows/code-check.yml - with: - branch: 0.x unit-tests: uses: ./.github/workflows/unit-tests.yml - with: - branch: 0.x secrets: GIST_PAT: ${{ secrets.GIST_PAT }} security-scan: needs: [unit-tests] uses: ./.github/workflows/security-scan.yml - with: - branch: 0.x secrets: - FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }} SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} tests: runs-on: ${{ matrix.os }} strategy: fail-fast: false # finish all jobs even if one fails max-parallel: 2 - matrix: + matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] python-version: ['3.7', '3.8', '3.9', '3.10'] steps: - name: Check out code uses: actions/checkout@v2 - + - name: Set up Python 3.7 uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - + - name: Install dependencies run: | python -m pip install --upgrade pip @@ -52,9 +45,9 @@ jobs: id: setup uses: firebolt-db/integration-testing-setup@v1 with: - firebolt-username: ${{ secrets.FIREBOLT_USERNAME }} - firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }} - api-endpoint: "api.dev.firebolt.io" + firebolt-username: ${{ secrets.FIREBOLT_STG_USERNAME }} + firebolt-password: ${{ secrets.FIREBOLT_STG_PASSWORD }} + api-endpoint: "api.staging.firebolt.io" region: "us-east-1" db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }} @@ -64,21 +57,21 @@ jobs: with: path: | .pytest_cache/v/cache/lastfailed - key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }} + key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}-v1 - name: Run integration tests env: - USER_NAME: ${{ secrets.FIREBOLT_USERNAME }} - PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }} - SERVICE_ID: ${{ secrets.SERVICE_ID }} - SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }} + USER_NAME: ${{ secrets.FIREBOLT_STG_USERNAME }} + PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }} + SERVICE_ID: ${{ secrets.SERVICE_ID_STG }} + SERVICE_SECRET: ${{ secrets.SERVICE_SECRET_STG }} DATABASE_NAME: ${{ steps.setup.outputs.database_name }} ENGINE_NAME: ${{ steps.setup.outputs.engine_name }} ENGINE_URL: ${{ steps.setup.outputs.engine_url }} STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }} STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }} ACCOUNT_NAME: "firebolt" - FIREBOLT_BASE_URL: "api.dev.firebolt.io" + FIREBOLT_BASE_URL: "api.staging.firebolt.io" run: | pytest --last-failed -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly-v2.yml similarity index 86% rename from .github/workflows/nightly.yml rename to .github/workflows/nightly-v2.yml index a45e751..fbf066c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly-v2.yml @@ -1,4 +1,4 @@ -name: Nightly code check +name: v2 Nightly code check on: workflow_dispatch: schedule: @@ -14,25 +14,24 @@ jobs: needs: [unit-tests] uses: ./.github/workflows/security-scan.yml secrets: - FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }} SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} tests: runs-on: ${{ matrix.os }} strategy: fail-fast: false # finish all jobs even if one fails max-parallel: 2 - matrix: + matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] python-version: ['3.7', '3.8', '3.9', '3.10'] steps: - name: Check out code uses: actions/checkout@v2 - + - name: Set up Python 3.7 uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - + - name: Install dependencies run: | python -m pip install --upgrade pip @@ -46,10 +45,10 @@ jobs: id: setup uses: firebolt-db/integration-testing-setup@v2 with: - firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }} - firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }} + firebolt-client-id: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }} + firebolt-client-secret: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }} account: "developer" - api-endpoint: "api.dev.firebolt.io" + api-endpoint: "api.staging.firebolt.io" db_suffix: ${{ format('{0}_{1}', matrix.os, matrix.python-version) }} - name: Restore cached failed tests @@ -62,12 +61,12 @@ jobs: - name: Run integration tests env: - SERVICE_ID: ${{ secrets.FIREBOLT_CLIENT_ID_NEW_IDN }} - SERVICE_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_NEW_IDN }} + SERVICE_ID: ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }} + SERVICE_SECRET: ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }} DATABASE_NAME: ${{ steps.setup.outputs.database_name }} ENGINE_NAME: ${{ steps.setup.outputs.engine_name }} STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }} - FIREBOLT_BASE_URL: "api.dev.firebolt.io" + FIREBOLT_BASE_URL: "api.staging.firebolt.io" ACCOUNT_NAME: "developer" run: | pytest --last-failed -o log_cli=true -o log_cli_level=INFO --junit-xml=report/junit.xml tests/integration From 38ceebc9e078af14ea85856092351f24784a449b Mon Sep 17 00:00:00 2001 From: ptiurin Date: Thu, 7 Dec 2023 16:24:41 +0000 Subject: [PATCH 03/10] integration tests wf --- ...-tests-v0.yml => integration-tests-v1.yml} | 62 ++++++++++++++----- ...ion-tests.yml => integration-tests-v2.yml} | 12 ++-- .github/workflows/integration-tests.yml | 55 ++++++++++++++++ .github/workflows/security-scan.yml | 3 - 4 files changed, 107 insertions(+), 25 deletions(-) rename .github/workflows/{python-integration-tests-v0.yml => integration-tests-v1.yml} (50%) rename .github/workflows/{python-integration-tests.yml => integration-tests-v2.yml} (94%) create mode 100644 .github/workflows/integration-tests.yml diff --git a/.github/workflows/python-integration-tests-v0.yml b/.github/workflows/integration-tests-v1.yml similarity index 50% rename from .github/workflows/python-integration-tests-v0.yml rename to .github/workflows/integration-tests-v1.yml index a87c25d..b8b1c68 100644 --- a/.github/workflows/python-integration-tests-v0.yml +++ b/.github/workflows/integration-tests-v1.yml @@ -1,17 +1,39 @@ -name: v0.x Integration tests +name: v1 Integration tests on: workflow_dispatch: + inputs: + environment: + description: 'Environment to run the tests against' + type: choice + required: true + default: 'dev' + options: + - dev + - staging workflow_call: + inputs: + environment: + default: 'staging' + required: false + type: string secrets: FIREBOLT_USERNAME: required: true FIREBOLT_PASSWORD: required: true + FIREBOLT_STG_USERNAME: + required: true + FIREBOLT_STG_PASSWORD: + required: true SERVICE_ID: required: true SERVICE_SECRET: required: true + SERVICE_ID_STG: + required: true + SERVICE_SECRET_STG: + required: true jobs: integration-tests: @@ -19,8 +41,6 @@ jobs: steps: - name: Check out code uses: actions/checkout@v2 - with: - ref: 0.x - name: Set up Python 3.7 uses: actions/setup-python@v2 @@ -32,13 +52,27 @@ jobs: python -m pip install --upgrade pip pip install ".[dev]" + - name: Determine env variables + run: | + if [ "${{ inputs.environment }}" == 'staging' ]; then + echo "USERNAME=${{ secrets.FIREBOLT_STG_USERNAME }}" >> "$GITHUB_ENV" + echo "PASSWORD=${{ secrets.FIREBOLT_STG_PASSWORD }}" >> "$GITHUB_ENV" + echo "CLIENT_ID=${{ secrets.SERVICE_ID_STG }}" >> "$GITHUB_ENV" + echo "CLIENT_SECRET=${{ secrets.SERVICE_SECRET_STG }}" >> "$GITHUB_ENV" + else + echo "USERNAME=${{ secrets.FIREBOLT_USERNAME }}" >> "$GITHUB_ENV" + echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD }}" >> "$GITHUB_ENV" + echo "CLIENT_ID=${{ secrets.SERVICE_ID }}" >> "$GITHUB_ENV" + echo "CLIENT_SECRET=${{ secrets.SERVICE_SECRET }}" >> "$GITHUB_ENV" + fi + - name: Setup database and engine id: setup uses: firebolt-db/integration-testing-setup@v1 with: - firebolt-username: ${{ secrets.FIREBOLT_USERNAME }} - firebolt-password: ${{ secrets.FIREBOLT_PASSWORD }} - api-endpoint: "api.dev.firebolt.io" + firebolt-username: ${{ env.USERNAME }} + firebolt-password: ${{ env.PASSWORD }} + api-endpoint: "api.${{ inputs.environment }}.firebolt.io" region: "us-east-1" - name: Restore cached failed tests @@ -47,23 +81,23 @@ jobs: with: path: | .pytest_cache/v/cache/lastfailed - key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }} - + key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}-v1 + - name: Run integration tests env: - USER_NAME: ${{ secrets.FIREBOLT_USERNAME }} - PASSWORD: ${{ secrets.FIREBOLT_PASSWORD }} - SERVICE_ID: ${{ secrets.SERVICE_ID }} - SERVICE_SECRET: ${{ secrets.SERVICE_SECRET }} + USER_NAME: ${{ env.USERNAME }} + PASSWORD: ${{ env.PASSWORD }} + SERVICE_ID: ${{ env.CLIENT_ID }} + SERVICE_SECRET: ${{ env.CLIENT_SECRET }} DATABASE_NAME: ${{ steps.setup.outputs.database_name }} ENGINE_NAME: ${{ steps.setup.outputs.engine_name }} ENGINE_URL: ${{ steps.setup.outputs.engine_url }} STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }} STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }} - FIREBOLT_BASE_URL: "api.dev.firebolt.io" + FIREBOLT_BASE_URL: "api.${{ inputs.environment }}.firebolt.io" run: | pytest --last-failed -o log_cli=true -o log_cli_level=INFO tests/integration - + - name: Save failed tests id: cache-tests-save uses: actions/cache/save@v3 diff --git a/.github/workflows/python-integration-tests.yml b/.github/workflows/integration-tests-v2.yml similarity index 94% rename from .github/workflows/python-integration-tests.yml rename to .github/workflows/integration-tests-v2.yml index 76a5085..e40ee14 100644 --- a/.github/workflows/python-integration-tests.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -1,4 +1,4 @@ -name: Integration tests +name: v2 Integration tests on: workflow_dispatch: @@ -17,10 +17,6 @@ on: default: 'staging' required: false type: string - branch: - required: false - type: string - description: 'Branch to run on' secrets: FIREBOLT_CLIENT_ID_STG_NEW_IDN: required: true @@ -73,8 +69,8 @@ jobs: with: path: | .pytest_cache/v/cache/lastfailed - key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }} - + key: ${{ runner.os }}-pytest-restore-failed-${{ github.ref }}-${{ github.sha }}-v2 + - name: Run integration tests env: SERVICE_ID: ${{ env.CLIENT_ID }} @@ -86,7 +82,7 @@ jobs: ACCOUNT_NAME: "developer" run: | pytest --last-failed -o log_cli=true -o log_cli_level=INFO tests/integration - + - name: Save failed tests id: cache-tests-save uses: actions/cache/save@v3 diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml new file mode 100644 index 0000000..ced13a1 --- /dev/null +++ b/.github/workflows/integration-tests.yml @@ -0,0 +1,55 @@ +name: Integration tests +on: + workflow_dispatch: + inputs: + environment: + description: 'Environment to run the tests against' + type: choice + required: true + default: 'dev' + options: + - dev + - staging + workflow_call: + inputs: + environment: + default: 'staging' + required: false + type: string + secrets: + FIREBOLT_USERNAME: + required: true + FIREBOLT_PASSWORD: + required: true + FIREBOLT_STG_USERNAME: + required: true + FIREBOLT_STG_PASSWORD: + required: true + SERVICE_ID: + required: true + SERVICE_SECRET: + required: true + SERVICE_ID_STG: + required: true + SERVICE_SECRET_STG: + required: true + # V2 secrets + FIREBOLT_CLIENT_ID_STG_NEW_IDN: + required: true + FIREBOLT_CLIENT_SECRET_STG_NEW_IDN: + required: true + FIREBOLT_CLIENT_ID_NEW_IDN: + required: true + FIREBOLT_CLIENT_SECRET_NEW_IDN: + required: true +jobs: + integration-test-v1: + uses: ./.github/workflows/integration-tests-v1.yml + with: + environment: ${{ inputs.environment }} + secrets: inherit + integration-test-v2: + uses: ./.github/workflows/integration-tests-v2.yml + with: + environment: ${{ inputs.environment }} + secrets: inherit diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml index 04ca88a..8d79934 100644 --- a/.github/workflows/security-scan.yml +++ b/.github/workflows/security-scan.yml @@ -8,8 +8,6 @@ on: type: string description: 'Branch to run on' secrets: - FOSSA_TOKEN: - required: true SONARCLOUD_TOKEN: required: true @@ -31,5 +29,4 @@ jobs: uses: firebolt-db/action-security-scan@main with: github-key: ${{ secrets.GITHUB_TOKEN }} - fossa-key: ${{ secrets.FOSSA_TOKEN }} sonar-key: ${{ secrets.SONARCLOUD_TOKEN }} From d52eb49f1711aefcc8d1fbd693faf333d15f0238 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Thu, 7 Dec 2023 16:29:52 +0000 Subject: [PATCH 04/10] integration --- .github/workflows/integration-tests-v1.yml | 8 ++++---- .github/workflows/integration-tests-v2.yml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/integration-tests-v1.yml b/.github/workflows/integration-tests-v1.yml index b8b1c68..69eb53d 100644 --- a/.github/workflows/integration-tests-v1.yml +++ b/.github/workflows/integration-tests-v1.yml @@ -85,16 +85,16 @@ jobs: - name: Run integration tests env: - USER_NAME: ${{ env.USERNAME }} - PASSWORD: ${{ env.PASSWORD }} - SERVICE_ID: ${{ env.CLIENT_ID }} - SERVICE_SECRET: ${{ env.CLIENT_SECRET }} + # the distinction is on the SDK side so just use CLIENT_* for username password + CLIENT_ID: ${{ env.USERNAME }} + CLIENT_SECRET: ${{ env.PASSWORD }} DATABASE_NAME: ${{ steps.setup.outputs.database_name }} ENGINE_NAME: ${{ steps.setup.outputs.engine_name }} ENGINE_URL: ${{ steps.setup.outputs.engine_url }} STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }} STOPPED_ENGINE_URL: ${{ steps.setup.outputs.stopped_engine_url }} FIREBOLT_BASE_URL: "api.${{ inputs.environment }}.firebolt.io" + ACCOUNT_NAME: "firebolt" run: | pytest --last-failed -o log_cli=true -o log_cli_level=INFO tests/integration diff --git a/.github/workflows/integration-tests-v2.yml b/.github/workflows/integration-tests-v2.yml index e40ee14..234a8da 100644 --- a/.github/workflows/integration-tests-v2.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -73,8 +73,8 @@ jobs: - name: Run integration tests env: - SERVICE_ID: ${{ env.CLIENT_ID }} - SERVICE_SECRET: ${{ env.CLIENT_SECRET }} + CLIENT_ID: ${{ env.CLIENT_ID }} + CLIENT_SECRET: ${{ env.CLIENT_SECRET }} DATABASE_NAME: ${{ steps.setup.outputs.database_name }} ENGINE_NAME: ${{ steps.setup.outputs.engine_name }} STOPPED_ENGINE_NAME: ${{ steps.setup.outputs.stopped_engine_name }} From 1bbac9646875ac47b9d45bdf5c979493737f4b14 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Thu, 7 Dec 2023 16:30:45 +0000 Subject: [PATCH 05/10] clearer env name --- tests/integration/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 1257ffa..9cdfbeb 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -13,8 +13,8 @@ ENGINE_NAME_ENV = "ENGINE_NAME" DATABASE_NAME_ENV = "DATABASE_NAME" ACCOUNT_NAME_ENV = "ACCOUNT_NAME" -CLIENT_ID_ENV = "SERVICE_ID" -CLIENT_KEY_ENV = "SERVICE_SECRET" +CLIENT_ID_ENV = "CLIENT_ID" +CLIENT_KEY_ENV = "CLIENT_SECRET" def must_env(var_name: str) -> str: From 79ea154c4193edb78189f9952591c3be3baff64e Mon Sep 17 00:00:00 2001 From: ptiurin Date: Thu, 7 Dec 2023 16:55:13 +0000 Subject: [PATCH 06/10] rename to be able to test from a branch --- .../{integration-tests.yml => python-integration-tests.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{integration-tests.yml => python-integration-tests.yml} (100%) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/python-integration-tests.yml similarity index 100% rename from .github/workflows/integration-tests.yml rename to .github/workflows/python-integration-tests.yml From a54f3c555bf04bb6fc7e50aeddd122dda03a34a7 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Thu, 7 Dec 2023 16:57:52 +0000 Subject: [PATCH 07/10] remove unused secret --- .github/workflows/integration-tests-v1.yml | 12 ------------ .github/workflows/nightly-v1.yml | 6 ++---- .github/workflows/python-integration-tests.yml | 8 -------- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/.github/workflows/integration-tests-v1.yml b/.github/workflows/integration-tests-v1.yml index 69eb53d..ae60a16 100644 --- a/.github/workflows/integration-tests-v1.yml +++ b/.github/workflows/integration-tests-v1.yml @@ -26,14 +26,6 @@ on: required: true FIREBOLT_STG_PASSWORD: required: true - SERVICE_ID: - required: true - SERVICE_SECRET: - required: true - SERVICE_ID_STG: - required: true - SERVICE_SECRET_STG: - required: true jobs: integration-tests: @@ -57,13 +49,9 @@ jobs: if [ "${{ inputs.environment }}" == 'staging' ]; then echo "USERNAME=${{ secrets.FIREBOLT_STG_USERNAME }}" >> "$GITHUB_ENV" echo "PASSWORD=${{ secrets.FIREBOLT_STG_PASSWORD }}" >> "$GITHUB_ENV" - echo "CLIENT_ID=${{ secrets.SERVICE_ID_STG }}" >> "$GITHUB_ENV" - echo "CLIENT_SECRET=${{ secrets.SERVICE_SECRET_STG }}" >> "$GITHUB_ENV" else echo "USERNAME=${{ secrets.FIREBOLT_USERNAME }}" >> "$GITHUB_ENV" echo "PASSWORD=${{ secrets.FIREBOLT_PASSWORD }}" >> "$GITHUB_ENV" - echo "CLIENT_ID=${{ secrets.SERVICE_ID }}" >> "$GITHUB_ENV" - echo "CLIENT_SECRET=${{ secrets.SERVICE_SECRET }}" >> "$GITHUB_ENV" fi - name: Setup database and engine diff --git a/.github/workflows/nightly-v1.yml b/.github/workflows/nightly-v1.yml index d514993..9fc0ab9 100644 --- a/.github/workflows/nightly-v1.yml +++ b/.github/workflows/nightly-v1.yml @@ -61,10 +61,8 @@ jobs: - name: Run integration tests env: - USER_NAME: ${{ secrets.FIREBOLT_STG_USERNAME }} - PASSWORD: ${{ secrets.FIREBOLT_STG_PASSWORD }} - SERVICE_ID: ${{ secrets.SERVICE_ID_STG }} - SERVICE_SECRET: ${{ secrets.SERVICE_SECRET_STG }} + CLIENT_ID: ${{ secrets.FIREBOLT_STG_USERNAME }} + CLIENT_SECRET: ${{ secrets.FIREBOLT_STG_PASSWORD }} DATABASE_NAME: ${{ steps.setup.outputs.database_name }} ENGINE_NAME: ${{ steps.setup.outputs.engine_name }} ENGINE_URL: ${{ steps.setup.outputs.engine_url }} diff --git a/.github/workflows/python-integration-tests.yml b/.github/workflows/python-integration-tests.yml index ced13a1..c1e1bc5 100644 --- a/.github/workflows/python-integration-tests.yml +++ b/.github/workflows/python-integration-tests.yml @@ -25,14 +25,6 @@ on: required: true FIREBOLT_STG_PASSWORD: required: true - SERVICE_ID: - required: true - SERVICE_SECRET: - required: true - SERVICE_ID_STG: - required: true - SERVICE_SECRET_STG: - required: true # V2 secrets FIREBOLT_CLIENT_ID_STG_NEW_IDN: required: true From 022798d7a1cc51b0b8467c1d8290ed0d6b3314e2 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Thu, 7 Dec 2023 17:44:22 +0000 Subject: [PATCH 08/10] bump setup and checkout versions --- .github/workflows/code-check.yml | 6 +++--- .github/workflows/integration-tests-v1.yml | 2 +- .github/workflows/integration-tests-v2.yml | 2 +- .github/workflows/nightly-v1.yml | 2 +- .github/workflows/nightly-v2.yml | 2 +- .github/workflows/unit-tests.yml | 10 +++++----- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml index a2f1e46..aec0a11 100644 --- a/.github/workflows/code-check.yml +++ b/.github/workflows/code-check.yml @@ -18,12 +18,12 @@ jobs: uses: actions/checkout@v2 with: ref: ${{ inputs.branch }} - + - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.8 - + - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/integration-tests-v1.yml b/.github/workflows/integration-tests-v1.yml index ae60a16..bd9195e 100644 --- a/.github/workflows/integration-tests-v1.yml +++ b/.github/workflows/integration-tests-v1.yml @@ -35,7 +35,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python 3.7 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.7 diff --git a/.github/workflows/integration-tests-v2.yml b/.github/workflows/integration-tests-v2.yml index 234a8da..31936ca 100644 --- a/.github/workflows/integration-tests-v2.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -35,7 +35,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python 3.7 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.7 diff --git a/.github/workflows/nightly-v1.yml b/.github/workflows/nightly-v1.yml index 9fc0ab9..c0cd27f 100644 --- a/.github/workflows/nightly-v1.yml +++ b/.github/workflows/nightly-v1.yml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python 3.7 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/nightly-v2.yml b/.github/workflows/nightly-v2.yml index fbf066c..c82e81a 100644 --- a/.github/workflows/nightly-v2.yml +++ b/.github/workflows/nightly-v2.yml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python 3.7 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 3186242..efbe9f1 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -23,12 +23,12 @@ jobs: uses: actions/checkout@v2 with: ref: ${{ inputs.branch }} - + - name: Set up Python 3.7 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.7 - + - name: Install dependencies run: | python -m pip install --upgrade pip @@ -37,7 +37,7 @@ jobs: - name: Run unit tests run: | pytest --cov=src/ tests/unit --cov-report=xml - + - name: Upload coverage report uses: actions/upload-artifact@v2 with: @@ -55,7 +55,7 @@ jobs: colour=$(if [ $percentage_whole -ge 80 ]; then echo "green"; else echo "orange"; fi) echo "colour=$colour" >> $GITHUB_OUTPUT echo "covered=$percentage_whole" >> $GITHUB_OUTPUT - + - name: Create Coverage Badge uses: schneegans/dynamic-badges-action@v1.2.0 if: github.event_name == 'push' From d3fdbd028a9fcda739e2c67c11aeb4435c8540f9 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Thu, 7 Dec 2023 17:46:14 +0000 Subject: [PATCH 09/10] remove fossa --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e84116..7524a14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,5 +28,4 @@ jobs: needs: [unit-tests] uses: ./.github/workflows/security-scan.yml secrets: - FOSSA_TOKEN: ${{ secrets.FOSSA_TOKEN }} SONARCLOUD_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} From becebe3e3f4b5850d0f8abac2c0282a70ed738e8 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Mon, 11 Dec 2023 13:37:03 +0000 Subject: [PATCH 10/10] using setup-python v5 --- .github/workflows/code-check.yml | 2 +- .github/workflows/integration-tests-v1.yml | 2 +- .github/workflows/integration-tests-v2.yml | 2 +- .github/workflows/nightly-v1.yml | 2 +- .github/workflows/nightly-v2.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml index aec0a11..1f3401c 100644 --- a/.github/workflows/code-check.yml +++ b/.github/workflows/code-check.yml @@ -20,7 +20,7 @@ jobs: ref: ${{ inputs.branch }} - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 diff --git a/.github/workflows/integration-tests-v1.yml b/.github/workflows/integration-tests-v1.yml index bd9195e..d955d7b 100644 --- a/.github/workflows/integration-tests-v1.yml +++ b/.github/workflows/integration-tests-v1.yml @@ -35,7 +35,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python 3.7 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.7 diff --git a/.github/workflows/integration-tests-v2.yml b/.github/workflows/integration-tests-v2.yml index 31936ca..d816e83 100644 --- a/.github/workflows/integration-tests-v2.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -35,7 +35,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python 3.7 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.7 diff --git a/.github/workflows/nightly-v1.yml b/.github/workflows/nightly-v1.yml index c0cd27f..3f525a8 100644 --- a/.github/workflows/nightly-v1.yml +++ b/.github/workflows/nightly-v1.yml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python 3.7 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/nightly-v2.yml b/.github/workflows/nightly-v2.yml index c82e81a..38d63f7 100644 --- a/.github/workflows/nightly-v2.yml +++ b/.github/workflows/nightly-v2.yml @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@v2 - name: Set up Python 3.7 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index efbe9f1..015fef9 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -25,7 +25,7 @@ jobs: ref: ${{ inputs.branch }} - name: Set up Python 3.7 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.7