From ede79dd613a591a2e4591118633d4760db22027c Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 18:18:45 +0300 Subject: [PATCH 01/47] testing the lint --- .github/workflows/lint.yml | 28 +++++++++++++++++++++++++++- integrations/azure/main.py | 2 ++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3db18ab80..6c157fb56 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,9 +5,34 @@ on: workflow_dispatch: jobs: + detect-changes: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Get list of changed files + id: changed-files + uses: tj-actions/changed-files@v44.5.2 + with: + files: | + integrations/** + + - name: Set matrix + id: set-matrix + run: | + changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) + matrix=$(echo "$changed_folders" | jq -R -s -c 'split("\n")[:-1]') + echo "matrix=$matrix" >> $GITHUB_OUTPUT + lint: - name: Lint + needs: detect-changes runs-on: ubuntu-latest + strategy: + matrix: + folder: ${{ fromJson(needs.detect-changes.outputs.matrix) }} steps: - name: Set up Python 3.11 uses: actions/setup-python@v5 @@ -17,5 +42,6 @@ jobs: uses: actions/checkout@v4 - name: Lint run: | + cd integrations/${{ matrix.folder }} make install/all make lint/all diff --git a/integrations/azure/main.py b/integrations/azure/main.py index 25a74944b..f83c18d69 100644 --- a/integrations/azure/main.py +++ b/integrations/azure/main.py @@ -1,3 +1,5 @@ # noinspection PyUnresolvedReferences # ruff: noqa: F401 from azure_integration import ocean + +# Test From 84182228d8f28634e4f952ecdedaf0f1d560e3ac Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 18:22:37 +0300 Subject: [PATCH 02/47] testing the lint --- .github/workflows/lint.yml | 4 +-- integrations/azure/azure_integration/ocean.py | 25 ++++++++++--------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6c157fb56..0b25830ba 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -43,5 +43,5 @@ jobs: - name: Lint run: | cd integrations/${{ matrix.folder }} - make install/all - make lint/all + make install + make lint diff --git a/integrations/azure/azure_integration/ocean.py b/integrations/azure/azure_integration/ocean.py index a486fc31d..c15911cc0 100644 --- a/integrations/azure/azure_integration/ocean.py +++ b/integrations/azure/azure_integration/ocean.py @@ -1,11 +1,10 @@ import http import typing -from cloudevents.pydantic import CloudEvent import fastapi -from loguru import logger -from starlette import responses - +from azure.core.exceptions import ResourceNotFoundError +from azure.identity.aio import DefaultAzureCredential +from azure.mgmt.subscription.aio import SubscriptionClient from azure_integration.iterators import ( resource_group_iterator, resource_base_kind_iterator, @@ -16,14 +15,6 @@ AzureSpecificKindSelector, AzureCloudResourceSelector, ) -from port_ocean.context.event import event -from port_ocean.context.ocean import ocean -from port_ocean.core.models import Entity -from port_ocean.core.ocean_types import ASYNC_GENERATOR_RESYNC_TYPE -from azure.identity.aio import DefaultAzureCredential -from azure.core.exceptions import ResourceNotFoundError -from azure.mgmt.subscription.aio import SubscriptionClient - from azure_integration.utils import ( ResourceKindsWithSpecialHandling, resource_client_context, @@ -35,6 +26,16 @@ get_resource_configs_with_resource_kind, ) +# test +from cloudevents.pydantic import CloudEvent +from loguru import logger +from starlette import responses + +from port_ocean.context.event import event +from port_ocean.context.ocean import ocean +from port_ocean.core.models import Entity +from port_ocean.core.ocean_types import ASYNC_GENERATOR_RESYNC_TYPE + def _resolve_resync_method_for_resource( kind: str, From 8858efb5253d7c728debc7686873293c82acf214 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 18:31:15 +0300 Subject: [PATCH 03/47] testing the lint --- .github/workflows/{lint.yml => lint-integrations.yml} | 8 +++++++- README.md | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) rename .github/workflows/{lint.yml => lint-integrations.yml} (76%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint-integrations.yml similarity index 76% rename from .github/workflows/lint.yml rename to .github/workflows/lint-integrations.yml index 0b25830ba..6c5e6dbde 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint-integrations.yml @@ -24,6 +24,12 @@ jobs: id: set-matrix run: | changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) + changed_folders=$(echo "$changed_folders" | sed 's/^/.\//integrations\//') + if [ "$other_changes" -ne 0 ]; then + # Add the root directory to the matrix if there are changes outside the integrations folder + changed_folders=$(echo -e "$changed_folders\n.") + fi + matrix=$(echo "$changed_folders" | jq -R -s -c 'split("\n")[:-1]') echo "matrix=$matrix" >> $GITHUB_OUTPUT @@ -42,6 +48,6 @@ jobs: uses: actions/checkout@v4 - name: Lint run: | - cd integrations/${{ matrix.folder }} + cd ${{ matrix.folder }} make install make lint diff --git a/README.md b/README.md index 43f1e16ce..7a84403ca 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ Ocean +teate # Ocean Ocean From dd36623539fa05142f27c546505c5276eda56aa0 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 18:54:53 +0300 Subject: [PATCH 04/47] testing the lint --- .github/workflows/lint-integrations.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint-integrations.yml b/.github/workflows/lint-integrations.yml index 6c5e6dbde..94e21edbc 100644 --- a/.github/workflows/lint-integrations.yml +++ b/.github/workflows/lint-integrations.yml @@ -16,15 +16,11 @@ jobs: - name: Get list of changed files id: changed-files uses: tj-actions/changed-files@v44.5.2 - with: - files: | - integrations/** - - name: Set matrix id: set-matrix run: | - changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) - changed_folders=$(echo "$changed_folders" | sed 's/^/.\//integrations\//') + changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep '^integrations/' | cut -d'/' -f1,2 | sort | uniq) + other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep -v '^integrations/' | wc -l) if [ "$other_changes" -ne 0 ]; then # Add the root directory to the matrix if there are changes outside the integrations folder changed_folders=$(echo -e "$changed_folders\n.") From 5217833a485aef279f2589dfced19c176362012a Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 18:59:21 +0300 Subject: [PATCH 05/47] testing the lint --- .github/workflows/lint-integrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-integrations.yml b/.github/workflows/lint-integrations.yml index 94e21edbc..e88b8e950 100644 --- a/.github/workflows/lint-integrations.yml +++ b/.github/workflows/lint-integrations.yml @@ -19,8 +19,8 @@ jobs: - name: Set matrix id: set-matrix run: | - changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep '^integrations/' | cut -d'/' -f1,2 | sort | uniq) - other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep -v '^integrations/' | wc -l) + changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f1,2 | sort | uniq) + other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^integrations/' | wc -l) if [ "$other_changes" -ne 0 ]; then # Add the root directory to the matrix if there are changes outside the integrations folder changed_folders=$(echo -e "$changed_folders\n.") From 6faac09d1fe6a48a33bf7f17320dee9e82d6fd1b Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 19:06:21 +0300 Subject: [PATCH 06/47] testing the lint --- .github/workflows/lint-integrations.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint-integrations.yml b/.github/workflows/lint-integrations.yml index e88b8e950..5d7253a7d 100644 --- a/.github/workflows/lint-integrations.yml +++ b/.github/workflows/lint-integrations.yml @@ -20,7 +20,8 @@ jobs: id: set-matrix run: | changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f1,2 | sort | uniq) - other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^integrations/' | wc -l) + folders_to_ignore="integrations/|\.github/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" + other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | grep -v '^\.github/' | wc -l) if [ "$other_changes" -ne 0 ]; then # Add the root directory to the matrix if there are changes outside the integrations folder changed_folders=$(echo -e "$changed_folders\n.") From e36538f6c18184437391e67d8ad77176986d2832 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 19:10:15 +0300 Subject: [PATCH 07/47] testing the lint --- .github/workflows/lint-integrations.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-integrations.yml b/.github/workflows/lint-integrations.yml index 5d7253a7d..39d3684c6 100644 --- a/.github/workflows/lint-integrations.yml +++ b/.github/workflows/lint-integrations.yml @@ -19,7 +19,7 @@ jobs: - name: Set matrix id: set-matrix run: | - changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f1,2 | sort | uniq) + changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) folders_to_ignore="integrations/|\.github/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | grep -v '^\.github/' | wc -l) if [ "$other_changes" -ne 0 ]; then @@ -31,6 +31,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: + name: ${{ matrix.folder == '.' && 'ocean core' || matrix.folder }} needs: detect-changes runs-on: ubuntu-latest strategy: @@ -45,6 +46,10 @@ jobs: uses: actions/checkout@v4 - name: Lint run: | - cd ${{ matrix.folder }} + if [ "${{ matrix.folder }}" == "." ]; then + cd . + else + cd integrations/${{ matrix.folder }} + fi make install make lint From 079a988acb8d6487c5a6b1ac877b4b7eeb65b8d5 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 19:16:08 +0300 Subject: [PATCH 08/47] testing the lint --- .../{lint-integrations.yml => lint.yml} | 2 +- Makefile | 20 +-------------- README.md | 1 - integrations/azure/azure_integration/ocean.py | 25 +++++++++---------- integrations/azure/main.py | 2 -- 5 files changed, 14 insertions(+), 36 deletions(-) rename .github/workflows/{lint-integrations.yml => lint.yml} (99%) diff --git a/.github/workflows/lint-integrations.yml b/.github/workflows/lint.yml similarity index 99% rename from .github/workflows/lint-integrations.yml rename to .github/workflows/lint.yml index 39d3684c6..83666d0cb 100644 --- a/.github/workflows/lint-integrations.yml +++ b/.github/workflows/lint.yml @@ -26,7 +26,7 @@ jobs: # Add the root directory to the matrix if there are changes outside the integrations folder changed_folders=$(echo -e "$changed_folders\n.") fi - + matrix=$(echo "$changed_folders" | jq -R -s -c 'split("\n")[:-1]') echo "matrix=$matrix" >> $GITHUB_OUTPUT diff --git a/Makefile b/Makefile index db8b867df..0d80f2c0c 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ define deactivate_virtualenv fi endef -.SILENT: install install/all lint lint/integrations lint/all build run new test clean +.SILENT: install install/all lint build run new test clean # Install dependencies @@ -69,24 +69,6 @@ lint: $(ACTIVATE) && \ $(call run_checks,.) -lint/integrations: - $(ACTIVATE) && \ - exit_code=0; \ - for dir in $(wildcard $(CURDIR)/integrations/*); do \ - count=$$(find $$dir -type f -name '*.py' -not -path "*/venv/*" | wc -l); \ - if [ $$count -ne 0 ]; then \ - echo "Linting $$dir"; \ - cd $$dir; \ - $(MAKE) lint || exit_code=$$?; \ - cd ../..; \ - fi; \ - done; \ - if [ $$exit_code -ne 0 ]; then \ - exit 1; \ - fi - -lint/all: lint lint/integrations - # Development commands build: $(ACTIVATE) && poetry build diff --git a/README.md b/README.md index 7a84403ca..43f1e16ce 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ Ocean -teate # Ocean Ocean diff --git a/integrations/azure/azure_integration/ocean.py b/integrations/azure/azure_integration/ocean.py index c15911cc0..a486fc31d 100644 --- a/integrations/azure/azure_integration/ocean.py +++ b/integrations/azure/azure_integration/ocean.py @@ -1,10 +1,11 @@ import http import typing +from cloudevents.pydantic import CloudEvent import fastapi -from azure.core.exceptions import ResourceNotFoundError -from azure.identity.aio import DefaultAzureCredential -from azure.mgmt.subscription.aio import SubscriptionClient +from loguru import logger +from starlette import responses + from azure_integration.iterators import ( resource_group_iterator, resource_base_kind_iterator, @@ -15,6 +16,14 @@ AzureSpecificKindSelector, AzureCloudResourceSelector, ) +from port_ocean.context.event import event +from port_ocean.context.ocean import ocean +from port_ocean.core.models import Entity +from port_ocean.core.ocean_types import ASYNC_GENERATOR_RESYNC_TYPE +from azure.identity.aio import DefaultAzureCredential +from azure.core.exceptions import ResourceNotFoundError +from azure.mgmt.subscription.aio import SubscriptionClient + from azure_integration.utils import ( ResourceKindsWithSpecialHandling, resource_client_context, @@ -26,16 +35,6 @@ get_resource_configs_with_resource_kind, ) -# test -from cloudevents.pydantic import CloudEvent -from loguru import logger -from starlette import responses - -from port_ocean.context.event import event -from port_ocean.context.ocean import ocean -from port_ocean.core.models import Entity -from port_ocean.core.ocean_types import ASYNC_GENERATOR_RESYNC_TYPE - def _resolve_resync_method_for_resource( kind: str, diff --git a/integrations/azure/main.py b/integrations/azure/main.py index f83c18d69..25a74944b 100644 --- a/integrations/azure/main.py +++ b/integrations/azure/main.py @@ -1,5 +1,3 @@ # noinspection PyUnresolvedReferences # ruff: noqa: F401 from azure_integration import ocean - -# Test From 911bb19e91e6d0d773e830f5d5a5fc7c6712768e Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 19:21:52 +0300 Subject: [PATCH 09/47] testing the lint --- .github/workflows/lint.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 83666d0cb..d7d6596f4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,6 +20,10 @@ jobs: id: set-matrix run: | changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) + if [ -z "$changed_folders" ]; then + changed_folders="[]" + fi + folders_to_ignore="integrations/|\.github/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | grep -v '^\.github/' | wc -l) if [ "$other_changes" -ne 0 ]; then From 35eb646497cca80bb15a1445a97b20f8fb0084c5 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 19:24:53 +0300 Subject: [PATCH 10/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d7d6596f4..45bf7825c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,7 +21,7 @@ jobs: run: | changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) if [ -z "$changed_folders" ]; then - changed_folders="[]" + changed_folders="" fi folders_to_ignore="integrations/|\.github/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" From a6f7351abafd85c0f01a174ade25b447bf222ecc Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:49:21 +0300 Subject: [PATCH 11/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 45bf7825c..d40aa1841 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,7 +31,7 @@ jobs: changed_folders=$(echo -e "$changed_folders\n.") fi - matrix=$(echo "$changed_folders" | jq -R -s -c 'split("\n")[:-1]') + matrix=$(echo "$changed_folders" | jq -R -s -c 'split("\n") | map(select(length > 0))') echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: From a05d011c07e9e2edaa60de976e1cd981e0908763 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:54:08 +0300 Subject: [PATCH 12/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d40aa1841..04d3c12c8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,7 +35,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: - name: ${{ matrix.folder == '.' && 'ocean core' || matrix.folder }} + name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢 ' + matrix.folder }} needs: detect-changes runs-on: ubuntu-latest strategy: From b9b9ef0c90e544ebbed453dc9d076148238446f4 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:54:23 +0300 Subject: [PATCH 13/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 04d3c12c8..5a12d2270 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,7 +35,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: - name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢 ' + matrix.folder }} + name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢$matrix.folder' }} needs: detect-changes runs-on: ubuntu-latest strategy: From ab3b1b6984abbd963cd0cd56c0fe2e145f8e3333 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:54:41 +0300 Subject: [PATCH 14/47] testing the lint --- integrations/argocd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/argocd/README.md b/integrations/argocd/README.md index 9d92e2ad1..cdf95ae0b 100644 --- a/integrations/argocd/README.md +++ b/integrations/argocd/README.md @@ -1,4 +1,4 @@ -# ArgoCD +# ArgoCDt An integration used to import ArgoCD resources into Port. From f3ea8bed8c5e84e3aa795af290faa2e71714ff9a Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:57:59 +0300 Subject: [PATCH 15/47] testing the lint --- .github/workflows/lint.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5a12d2270..add252cf1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,13 +19,14 @@ jobs: - name: Set matrix id: set-matrix run: | - changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) + folders_to_ignore="integrations/*/LICENSE.md|integrations/*/README.md|integrations/*/CONTRIBUTING.md|integrations/*/CHANGELOG.md" + changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | grep -v '^($folders_to_ignore)' | cut -d'/' -f2 | sort | uniq) if [ -z "$changed_folders" ]; then changed_folders="" fi - folders_to_ignore="integrations/|\.github/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" - other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | grep -v '^\.github/' | wc -l) + folders_to_ignore="integrations/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" + other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | wc -l) if [ "$other_changes" -ne 0 ]; then # Add the root directory to the matrix if there are changes outside the integrations folder changed_folders=$(echo -e "$changed_folders\n.") @@ -35,7 +36,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: - name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢$matrix.folder' }} + name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢' +$matrix.folder }} needs: detect-changes runs-on: ubuntu-latest strategy: From 9b86207d78bf558eebc1adb023362abd007d5241 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:58:34 +0300 Subject: [PATCH 16/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index add252cf1..38e59498f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,7 +36,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: - name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢' +$matrix.folder }} + name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢' + $matrix.folder }} needs: detect-changes runs-on: ubuntu-latest strategy: From ef90cda690233401fbb8b0c6109c78868ef274fb Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:58:44 +0300 Subject: [PATCH 17/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 38e59498f..5724d5ab4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,7 +36,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: - name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢' + $matrix.folder }} + name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢' + matrix.folder }} needs: detect-changes runs-on: ubuntu-latest strategy: From fcbd514c3fa5885d9afac5eae67f64bc2360a93a Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 21:00:16 +0300 Subject: [PATCH 18/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5724d5ab4..fe608d6aa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,7 +36,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: - name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢' + matrix.folder }} + name: ${{ matrix.folder == '.' && '🌊 Ocean Core' || format('🚢 {0}', matrix.folder) }} needs: detect-changes runs-on: ubuntu-latest strategy: From ada14426d317488aa10e0d005f14895f7876804c Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 21:01:12 +0300 Subject: [PATCH 19/47] testing the lint --- .github/workflows/lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fe608d6aa..0ad5f6929 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,6 +6,7 @@ on: jobs: detect-changes: + name: Detect changes runs-on: ubuntu-latest outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} From 56061e91f0a4160833ce778615bf518487cef698 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 21:01:14 +0300 Subject: [PATCH 20/47] testing the lint --- integrations/argocd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/argocd/README.md b/integrations/argocd/README.md index cdf95ae0b..9d92e2ad1 100644 --- a/integrations/argocd/README.md +++ b/integrations/argocd/README.md @@ -1,4 +1,4 @@ -# ArgoCDt +# ArgoCD An integration used to import ArgoCD resources into Port. From 8599cb1af90bd9319d2e535edbe5e40e543648e4 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 21:03:34 +0300 Subject: [PATCH 21/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0ad5f6929..92a333d69 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,7 +25,7 @@ jobs: if [ -z "$changed_folders" ]; then changed_folders="" fi - + folders_to_ignore="integrations/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | wc -l) if [ "$other_changes" -ne 0 ]; then From 2ab77ce7356dcac83fad35ae03fb1be15c9e6d83 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 21:03:35 +0300 Subject: [PATCH 22/47] testing the lint --- integrations/argocd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/argocd/README.md b/integrations/argocd/README.md index 9d92e2ad1..cdf95ae0b 100644 --- a/integrations/argocd/README.md +++ b/integrations/argocd/README.md @@ -1,4 +1,4 @@ -# ArgoCD +# ArgoCDt An integration used to import ArgoCD resources into Port. From 8e141c5cef1504787fcf029bd253f5cfd9d648a5 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 21:06:28 +0300 Subject: [PATCH 23/47] testing the lint --- integrations/argocd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/argocd/README.md b/integrations/argocd/README.md index cdf95ae0b..9d92e2ad1 100644 --- a/integrations/argocd/README.md +++ b/integrations/argocd/README.md @@ -1,4 +1,4 @@ -# ArgoCDt +# ArgoCD An integration used to import ArgoCD resources into Port. From c25ff7e0e063aa954775dd14b277998c5420ef7b Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 18:18:45 +0300 Subject: [PATCH 24/47] testing the lint --- .github/workflows/lint.yml | 28 +++++++++++++++++++++++++++- integrations/azure/main.py | 2 ++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5a0d2e6c7..93682aaf7 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,9 +5,34 @@ on: workflow_dispatch: jobs: + detect-changes: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Get list of changed files + id: changed-files + uses: tj-actions/changed-files@v44.5.2 + with: + files: | + integrations/** + + - name: Set matrix + id: set-matrix + run: | + changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) + matrix=$(echo "$changed_folders" | jq -R -s -c 'split("\n")[:-1]') + echo "matrix=$matrix" >> $GITHUB_OUTPUT + lint: - name: Lint + needs: detect-changes runs-on: ubuntu-latest + strategy: + matrix: + folder: ${{ fromJson(needs.detect-changes.outputs.matrix) }} steps: - name: Set up Python 3.11 uses: actions/setup-python@v5 @@ -17,6 +42,7 @@ jobs: uses: actions/checkout@v4 - name: Install Dependencies run: | + cd integrations/${{ matrix.folder }} make install/all - name: Lint run: | diff --git a/integrations/azure/main.py b/integrations/azure/main.py index 25a74944b..f83c18d69 100644 --- a/integrations/azure/main.py +++ b/integrations/azure/main.py @@ -1,3 +1,5 @@ # noinspection PyUnresolvedReferences # ruff: noqa: F401 from azure_integration import ocean + +# Test From fb5b828e1b2686432ef907d42d18272ee07025e3 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 18:22:37 +0300 Subject: [PATCH 25/47] testing the lint --- .github/workflows/lint.yml | 8 +++--- integrations/azure/azure_integration/ocean.py | 25 ++++++++++--------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 93682aaf7..0b25830ba 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -40,10 +40,8 @@ jobs: python-version: '3.11' - name: Checkout Repo uses: actions/checkout@v4 - - name: Install Dependencies - run: | - cd integrations/${{ matrix.folder }} - make install/all - name: Lint run: | - make lint/all + cd integrations/${{ matrix.folder }} + make install + make lint diff --git a/integrations/azure/azure_integration/ocean.py b/integrations/azure/azure_integration/ocean.py index a486fc31d..c15911cc0 100644 --- a/integrations/azure/azure_integration/ocean.py +++ b/integrations/azure/azure_integration/ocean.py @@ -1,11 +1,10 @@ import http import typing -from cloudevents.pydantic import CloudEvent import fastapi -from loguru import logger -from starlette import responses - +from azure.core.exceptions import ResourceNotFoundError +from azure.identity.aio import DefaultAzureCredential +from azure.mgmt.subscription.aio import SubscriptionClient from azure_integration.iterators import ( resource_group_iterator, resource_base_kind_iterator, @@ -16,14 +15,6 @@ AzureSpecificKindSelector, AzureCloudResourceSelector, ) -from port_ocean.context.event import event -from port_ocean.context.ocean import ocean -from port_ocean.core.models import Entity -from port_ocean.core.ocean_types import ASYNC_GENERATOR_RESYNC_TYPE -from azure.identity.aio import DefaultAzureCredential -from azure.core.exceptions import ResourceNotFoundError -from azure.mgmt.subscription.aio import SubscriptionClient - from azure_integration.utils import ( ResourceKindsWithSpecialHandling, resource_client_context, @@ -35,6 +26,16 @@ get_resource_configs_with_resource_kind, ) +# test +from cloudevents.pydantic import CloudEvent +from loguru import logger +from starlette import responses + +from port_ocean.context.event import event +from port_ocean.context.ocean import ocean +from port_ocean.core.models import Entity +from port_ocean.core.ocean_types import ASYNC_GENERATOR_RESYNC_TYPE + def _resolve_resync_method_for_resource( kind: str, From b50a3ec023f3925794ed010fd751decda00e7dbb Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 18:31:15 +0300 Subject: [PATCH 26/47] testing the lint --- .github/workflows/{lint.yml => lint-integrations.yml} | 8 +++++++- README.md | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) rename .github/workflows/{lint.yml => lint-integrations.yml} (76%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint-integrations.yml similarity index 76% rename from .github/workflows/lint.yml rename to .github/workflows/lint-integrations.yml index 0b25830ba..6c5e6dbde 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint-integrations.yml @@ -24,6 +24,12 @@ jobs: id: set-matrix run: | changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) + changed_folders=$(echo "$changed_folders" | sed 's/^/.\//integrations\//') + if [ "$other_changes" -ne 0 ]; then + # Add the root directory to the matrix if there are changes outside the integrations folder + changed_folders=$(echo -e "$changed_folders\n.") + fi + matrix=$(echo "$changed_folders" | jq -R -s -c 'split("\n")[:-1]') echo "matrix=$matrix" >> $GITHUB_OUTPUT @@ -42,6 +48,6 @@ jobs: uses: actions/checkout@v4 - name: Lint run: | - cd integrations/${{ matrix.folder }} + cd ${{ matrix.folder }} make install make lint diff --git a/README.md b/README.md index 43f1e16ce..7a84403ca 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ Ocean +teate # Ocean Ocean From d48c2d5ec398f15289477ac3ea2d2d5d9b1b624f Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 18:54:53 +0300 Subject: [PATCH 27/47] testing the lint --- .github/workflows/lint-integrations.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint-integrations.yml b/.github/workflows/lint-integrations.yml index 6c5e6dbde..94e21edbc 100644 --- a/.github/workflows/lint-integrations.yml +++ b/.github/workflows/lint-integrations.yml @@ -16,15 +16,11 @@ jobs: - name: Get list of changed files id: changed-files uses: tj-actions/changed-files@v44.5.2 - with: - files: | - integrations/** - - name: Set matrix id: set-matrix run: | - changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) - changed_folders=$(echo "$changed_folders" | sed 's/^/.\//integrations\//') + changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep '^integrations/' | cut -d'/' -f1,2 | sort | uniq) + other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep -v '^integrations/' | wc -l) if [ "$other_changes" -ne 0 ]; then # Add the root directory to the matrix if there are changes outside the integrations folder changed_folders=$(echo -e "$changed_folders\n.") From 98cc2cfde2f7e5f14511315579f1d2507b2fc7bc Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 18:59:21 +0300 Subject: [PATCH 28/47] testing the lint --- .github/workflows/lint-integrations.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-integrations.yml b/.github/workflows/lint-integrations.yml index 94e21edbc..e88b8e950 100644 --- a/.github/workflows/lint-integrations.yml +++ b/.github/workflows/lint-integrations.yml @@ -19,8 +19,8 @@ jobs: - name: Set matrix id: set-matrix run: | - changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep '^integrations/' | cut -d'/' -f1,2 | sort | uniq) - other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | grep -v '^integrations/' | wc -l) + changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f1,2 | sort | uniq) + other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^integrations/' | wc -l) if [ "$other_changes" -ne 0 ]; then # Add the root directory to the matrix if there are changes outside the integrations folder changed_folders=$(echo -e "$changed_folders\n.") From 206eaf9fc2a8e03fc7170e3c44f84a3f13893fdb Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 19:06:21 +0300 Subject: [PATCH 29/47] testing the lint --- .github/workflows/lint-integrations.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint-integrations.yml b/.github/workflows/lint-integrations.yml index e88b8e950..5d7253a7d 100644 --- a/.github/workflows/lint-integrations.yml +++ b/.github/workflows/lint-integrations.yml @@ -20,7 +20,8 @@ jobs: id: set-matrix run: | changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f1,2 | sort | uniq) - other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^integrations/' | wc -l) + folders_to_ignore="integrations/|\.github/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" + other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | grep -v '^\.github/' | wc -l) if [ "$other_changes" -ne 0 ]; then # Add the root directory to the matrix if there are changes outside the integrations folder changed_folders=$(echo -e "$changed_folders\n.") From e159ea9b7b667418fe0786eb3088cb45d591c211 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 19:10:15 +0300 Subject: [PATCH 30/47] testing the lint --- .github/workflows/lint-integrations.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-integrations.yml b/.github/workflows/lint-integrations.yml index 5d7253a7d..39d3684c6 100644 --- a/.github/workflows/lint-integrations.yml +++ b/.github/workflows/lint-integrations.yml @@ -19,7 +19,7 @@ jobs: - name: Set matrix id: set-matrix run: | - changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f1,2 | sort | uniq) + changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) folders_to_ignore="integrations/|\.github/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | grep -v '^\.github/' | wc -l) if [ "$other_changes" -ne 0 ]; then @@ -31,6 +31,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: + name: ${{ matrix.folder == '.' && 'ocean core' || matrix.folder }} needs: detect-changes runs-on: ubuntu-latest strategy: @@ -45,6 +46,10 @@ jobs: uses: actions/checkout@v4 - name: Lint run: | - cd ${{ matrix.folder }} + if [ "${{ matrix.folder }}" == "." ]; then + cd . + else + cd integrations/${{ matrix.folder }} + fi make install make lint From f872cf3e0cdfa2eff86608321bde63962b91dc56 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 19:16:08 +0300 Subject: [PATCH 31/47] testing the lint --- .../{lint-integrations.yml => lint.yml} | 2 +- Makefile | 20 +-------------- README.md | 1 - integrations/azure/azure_integration/ocean.py | 25 +++++++++---------- integrations/azure/main.py | 2 -- 5 files changed, 14 insertions(+), 36 deletions(-) rename .github/workflows/{lint-integrations.yml => lint.yml} (99%) diff --git a/.github/workflows/lint-integrations.yml b/.github/workflows/lint.yml similarity index 99% rename from .github/workflows/lint-integrations.yml rename to .github/workflows/lint.yml index 39d3684c6..83666d0cb 100644 --- a/.github/workflows/lint-integrations.yml +++ b/.github/workflows/lint.yml @@ -26,7 +26,7 @@ jobs: # Add the root directory to the matrix if there are changes outside the integrations folder changed_folders=$(echo -e "$changed_folders\n.") fi - + matrix=$(echo "$changed_folders" | jq -R -s -c 'split("\n")[:-1]') echo "matrix=$matrix" >> $GITHUB_OUTPUT diff --git a/Makefile b/Makefile index db8b867df..0d80f2c0c 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ define deactivate_virtualenv fi endef -.SILENT: install install/all lint lint/integrations lint/all build run new test clean +.SILENT: install install/all lint build run new test clean # Install dependencies @@ -69,24 +69,6 @@ lint: $(ACTIVATE) && \ $(call run_checks,.) -lint/integrations: - $(ACTIVATE) && \ - exit_code=0; \ - for dir in $(wildcard $(CURDIR)/integrations/*); do \ - count=$$(find $$dir -type f -name '*.py' -not -path "*/venv/*" | wc -l); \ - if [ $$count -ne 0 ]; then \ - echo "Linting $$dir"; \ - cd $$dir; \ - $(MAKE) lint || exit_code=$$?; \ - cd ../..; \ - fi; \ - done; \ - if [ $$exit_code -ne 0 ]; then \ - exit 1; \ - fi - -lint/all: lint lint/integrations - # Development commands build: $(ACTIVATE) && poetry build diff --git a/README.md b/README.md index 7a84403ca..43f1e16ce 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ Ocean -teate # Ocean Ocean diff --git a/integrations/azure/azure_integration/ocean.py b/integrations/azure/azure_integration/ocean.py index c15911cc0..a486fc31d 100644 --- a/integrations/azure/azure_integration/ocean.py +++ b/integrations/azure/azure_integration/ocean.py @@ -1,10 +1,11 @@ import http import typing +from cloudevents.pydantic import CloudEvent import fastapi -from azure.core.exceptions import ResourceNotFoundError -from azure.identity.aio import DefaultAzureCredential -from azure.mgmt.subscription.aio import SubscriptionClient +from loguru import logger +from starlette import responses + from azure_integration.iterators import ( resource_group_iterator, resource_base_kind_iterator, @@ -15,6 +16,14 @@ AzureSpecificKindSelector, AzureCloudResourceSelector, ) +from port_ocean.context.event import event +from port_ocean.context.ocean import ocean +from port_ocean.core.models import Entity +from port_ocean.core.ocean_types import ASYNC_GENERATOR_RESYNC_TYPE +from azure.identity.aio import DefaultAzureCredential +from azure.core.exceptions import ResourceNotFoundError +from azure.mgmt.subscription.aio import SubscriptionClient + from azure_integration.utils import ( ResourceKindsWithSpecialHandling, resource_client_context, @@ -26,16 +35,6 @@ get_resource_configs_with_resource_kind, ) -# test -from cloudevents.pydantic import CloudEvent -from loguru import logger -from starlette import responses - -from port_ocean.context.event import event -from port_ocean.context.ocean import ocean -from port_ocean.core.models import Entity -from port_ocean.core.ocean_types import ASYNC_GENERATOR_RESYNC_TYPE - def _resolve_resync_method_for_resource( kind: str, diff --git a/integrations/azure/main.py b/integrations/azure/main.py index f83c18d69..25a74944b 100644 --- a/integrations/azure/main.py +++ b/integrations/azure/main.py @@ -1,5 +1,3 @@ # noinspection PyUnresolvedReferences # ruff: noqa: F401 from azure_integration import ocean - -# Test From 158ea1e58eaec53d5b1e0d7d61107c9bbdaf9d37 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 19:21:52 +0300 Subject: [PATCH 32/47] testing the lint --- .github/workflows/lint.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 83666d0cb..d7d6596f4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -20,6 +20,10 @@ jobs: id: set-matrix run: | changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) + if [ -z "$changed_folders" ]; then + changed_folders="[]" + fi + folders_to_ignore="integrations/|\.github/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | grep -v '^\.github/' | wc -l) if [ "$other_changes" -ne 0 ]; then From 1e59cb1f2e2c42548584514765f2d063227429cc Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 19:24:53 +0300 Subject: [PATCH 33/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d7d6596f4..45bf7825c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,7 +21,7 @@ jobs: run: | changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) if [ -z "$changed_folders" ]; then - changed_folders="[]" + changed_folders="" fi folders_to_ignore="integrations/|\.github/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" From b047aecf78d2438b722cfc61562efe4cc6077128 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:49:21 +0300 Subject: [PATCH 34/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 45bf7825c..d40aa1841 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -31,7 +31,7 @@ jobs: changed_folders=$(echo -e "$changed_folders\n.") fi - matrix=$(echo "$changed_folders" | jq -R -s -c 'split("\n")[:-1]') + matrix=$(echo "$changed_folders" | jq -R -s -c 'split("\n") | map(select(length > 0))') echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: From 335ec592e194c715a0d14597072fe0cebf29581e Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:54:08 +0300 Subject: [PATCH 35/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index d40aa1841..04d3c12c8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,7 +35,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: - name: ${{ matrix.folder == '.' && 'ocean core' || matrix.folder }} + name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢 ' + matrix.folder }} needs: detect-changes runs-on: ubuntu-latest strategy: From 92a4ba88bf3a53554568a740b591ab2ccc573cad Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:54:23 +0300 Subject: [PATCH 36/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 04d3c12c8..5a12d2270 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -35,7 +35,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: - name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢 ' + matrix.folder }} + name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢$matrix.folder' }} needs: detect-changes runs-on: ubuntu-latest strategy: From 70e9a524d5284148f62fa3179bbd8b0cbae45d61 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:54:41 +0300 Subject: [PATCH 37/47] testing the lint --- integrations/argocd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/argocd/README.md b/integrations/argocd/README.md index 9d92e2ad1..cdf95ae0b 100644 --- a/integrations/argocd/README.md +++ b/integrations/argocd/README.md @@ -1,4 +1,4 @@ -# ArgoCD +# ArgoCDt An integration used to import ArgoCD resources into Port. From ecb6e1e326f6ffa76a2a0274ccc656ee6caf040e Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:57:59 +0300 Subject: [PATCH 38/47] testing the lint --- .github/workflows/lint.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5a12d2270..add252cf1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -19,13 +19,14 @@ jobs: - name: Set matrix id: set-matrix run: | - changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | cut -d'/' -f2 | sort | uniq) + folders_to_ignore="integrations/*/LICENSE.md|integrations/*/README.md|integrations/*/CONTRIBUTING.md|integrations/*/CHANGELOG.md" + changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep '^integrations/' | grep -v '^($folders_to_ignore)' | cut -d'/' -f2 | sort | uniq) if [ -z "$changed_folders" ]; then changed_folders="" fi - folders_to_ignore="integrations/|\.github/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" - other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | grep -v '^\.github/' | wc -l) + folders_to_ignore="integrations/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" + other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | wc -l) if [ "$other_changes" -ne 0 ]; then # Add the root directory to the matrix if there are changes outside the integrations folder changed_folders=$(echo -e "$changed_folders\n.") @@ -35,7 +36,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: - name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢$matrix.folder' }} + name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢' +$matrix.folder }} needs: detect-changes runs-on: ubuntu-latest strategy: From 7f993781df572f49f45685b71f72f14a60baa8d2 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:58:34 +0300 Subject: [PATCH 39/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index add252cf1..38e59498f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,7 +36,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: - name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢' +$matrix.folder }} + name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢' + $matrix.folder }} needs: detect-changes runs-on: ubuntu-latest strategy: From 4fa825d3fd6931fdf0cce3b07539a10ed82ddb81 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 20:58:44 +0300 Subject: [PATCH 40/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 38e59498f..5724d5ab4 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,7 +36,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: - name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢' + $matrix.folder }} + name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢' + matrix.folder }} needs: detect-changes runs-on: ubuntu-latest strategy: From 050522990ea74365502a0978938f5df5a059b9dc Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 21:00:16 +0300 Subject: [PATCH 41/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5724d5ab4..fe608d6aa 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -36,7 +36,7 @@ jobs: echo "matrix=$matrix" >> $GITHUB_OUTPUT lint: - name: ${{ matrix.folder == '.' && '🌊Ocean Core' || '🚢' + matrix.folder }} + name: ${{ matrix.folder == '.' && '🌊 Ocean Core' || format('🚢 {0}', matrix.folder) }} needs: detect-changes runs-on: ubuntu-latest strategy: From 6059fd0fa01ca10f4828879f65e7c9a840671232 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 21:01:12 +0300 Subject: [PATCH 42/47] testing the lint --- .github/workflows/lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fe608d6aa..0ad5f6929 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,6 +6,7 @@ on: jobs: detect-changes: + name: Detect changes runs-on: ubuntu-latest outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} From 37a0b18b328abbf7ed71b3ada903d6b3eb1c74d7 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 21:01:14 +0300 Subject: [PATCH 43/47] testing the lint --- integrations/argocd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/argocd/README.md b/integrations/argocd/README.md index cdf95ae0b..9d92e2ad1 100644 --- a/integrations/argocd/README.md +++ b/integrations/argocd/README.md @@ -1,4 +1,4 @@ -# ArgoCDt +# ArgoCD An integration used to import ArgoCD resources into Port. From 4fde12743d04aa87e77ba054e137437d6cee8634 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 21:03:34 +0300 Subject: [PATCH 44/47] testing the lint --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0ad5f6929..92a333d69 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -25,7 +25,7 @@ jobs: if [ -z "$changed_folders" ]; then changed_folders="" fi - + folders_to_ignore="integrations/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | wc -l) if [ "$other_changes" -ne 0 ]; then From 8aa28fabc59caf5eabdd37f3da15b62e799367b9 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 21:03:35 +0300 Subject: [PATCH 45/47] testing the lint --- integrations/argocd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/argocd/README.md b/integrations/argocd/README.md index 9d92e2ad1..cdf95ae0b 100644 --- a/integrations/argocd/README.md +++ b/integrations/argocd/README.md @@ -1,4 +1,4 @@ -# ArgoCD +# ArgoCDt An integration used to import ArgoCD resources into Port. From 347a8a434e221d98f3f7182f147d01cac7844475 Mon Sep 17 00:00:00 2001 From: yair Date: Sun, 2 Jun 2024 21:06:28 +0300 Subject: [PATCH 46/47] testing the lint --- integrations/argocd/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integrations/argocd/README.md b/integrations/argocd/README.md index cdf95ae0b..9d92e2ad1 100644 --- a/integrations/argocd/README.md +++ b/integrations/argocd/README.md @@ -1,4 +1,4 @@ -# ArgoCDt +# ArgoCD An integration used to import ArgoCD resources into Port. From 152e9cf70999cb17ff5a043da49f8e1843e50954 Mon Sep 17 00:00:00 2001 From: yair Date: Mon, 3 Jun 2024 14:55:32 +0300 Subject: [PATCH 47/47] lint --- .github/workflows/lint.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 92a333d69..711622e0c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -50,12 +50,11 @@ jobs: python-version: '3.11' - name: Checkout Repo uses: actions/checkout@v4 - - name: Lint + - name: Install dependencies + working-directory: ${{ matrix.folder != '.' && format('integrations/{0}', matrix.folder) || '.' }} run: | - if [ "${{ matrix.folder }}" == "." ]; then - cd . - else - cd integrations/${{ matrix.folder }} - fi make install + - name: Lint + working-directory: ${{ matrix.folder != '.' && format('integrations/{0}', matrix.folder) || '.' }} + run: | make lint