diff --git a/.gitignore b/.gitignore index 96190fb5f9..ca6e11d3da 100644 --- a/.gitignore +++ b/.gitignore @@ -157,4 +157,5 @@ cython_debug/ !.idea/watcherTasks.xml # VSCode -.vscode/ +.vscode/* +!.vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000..be67b096dd --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,74 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Run snyk integration", + "type": "debugpy", + "request": "launch", + "cwd": "${workspaceFolder}/integrations/snyk", + "program": "${workspaceFolder}/integrations/snyk/debug.py", + "console": "integratedTerminal", + "justMyCode": true, + "envFile": "${workspaceFolder}/integrations/snyk/.env" + }, + { + "name": "Run pagerduty integration", + "type": "debugpy", + "request": "launch", + "cwd": "${workspaceFolder}/integrations/pagerduty", + "program": "${workspaceFolder}/integrations/pagerduty/debug.py", + "console": "integratedTerminal", + "justMyCode": true, + "envFile": "${workspaceFolder}/integrations/pagerduty/.env" + }, + { + "name": "Run gitlab integration", + "type": "debugpy", + "request": "launch", + "cwd": "${workspaceFolder}/integrations/gitlab", + "program": "${workspaceFolder}/integrations/gitlab/debug.py", + "console": "integratedTerminal", + "envFile": "${workspaceFolder}/integrations/gitlab/.env" + }, + { + "name": "Run argocd integration", + "type": "debugpy", + "request": "launch", + "cwd": "${workspaceFolder}/integrations/argocd", + "program": "${workspaceFolder}/integrations/argocd/debug.py", + "console": "integratedTerminal", + "justMyCode": true, + "envFile": "${workspaceFolder}/integrations/argocd/.env" + }, + { + "name": "Run azure-devops integration", + "type": "debugpy", + "request": "launch", + "cwd": "${workspaceFolder}/integrations/azure-devops", + "program": "${workspaceFolder}/integrations/azure-devops/debug.py", + "console": "integratedTerminal", + "justMyCode": true, + "envFile": "${workspaceFolder}/integrations/azure-devops/.env" + }, + { + "name": "Run GCP integration", + "type": "debugpy", + "request": "launch", + "cwd": "${workspaceFolder}/integrations/gcp", + "program": "${workspaceFolder}/integrations/gcp/debug.py", + "console": "integratedTerminal", + "justMyCode": false, + "envFile": "${workspaceFolder}/integrations/gcp/.env" + }, + { + "name": "Run AWS integration", + "type": "debugpy", + "request": "launch", + "cwd": "${workspaceFolder}/integrations/aws", + "program": "${workspaceFolder}/integrations/aws/debug.py", + "console": "integratedTerminal", + "justMyCode": false, + "envFile": "${workspaceFolder}/integrations/aws/.env" + } + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md index 091d98887b..c1396bffb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm +## 0.5.26 (2024-06-04) + + +### Bug Fixes + +- Fixed an issue causing integrations with no configuration to fail during the initialization process + + ## 0.5.25 (2024-06-03) diff --git a/integrations/argocd/.env.example b/integrations/argocd/.env.example new file mode 100644 index 0000000000..c891424346 --- /dev/null +++ b/integrations/argocd/.env.example @@ -0,0 +1,3 @@ +APPLICATION__LOG_LEVEL="DEBUG", +PORT_CLIENT_ID="", +PORT_CLIENT_SECRET="", \ No newline at end of file diff --git a/integrations/aws/.env.example b/integrations/aws/.env.example new file mode 100644 index 0000000000..0cc24de539 --- /dev/null +++ b/integrations/aws/.env.example @@ -0,0 +1,8 @@ +OCEAN__PORT__CLIENT_ID="" +OCEAN__PORT__CLIENT_SECRET="" +OCEAN__INTEGRATION__CONFIG__LIVE_EVENTS_API_KEY="1234" +OCEAN__INTEGRATION__CONFIG__ORGANIZATION_ROLE_ARN="arn:aws:iam:::role/" +OCEAN__INTEGRATION__CONFIG__ACCOUNT_READ_ROLE_NAME="" +OCEAN__EVENT_LISTENER={"type": "POLLING"} +OCEAN__INTEGRATION__IDENTIFIER="my-aws-integration" +OCEAN__INTEGRATION__TYPE="aws" \ No newline at end of file diff --git a/integrations/azure-devops/.env.example b/integrations/azure-devops/.env.example new file mode 100644 index 0000000000..8bd596d652 --- /dev/null +++ b/integrations/azure-devops/.env.example @@ -0,0 +1,6 @@ +OCEAN__INTEGRATION__CONFIG__ORGANIZATION_URL="https://dev.azure.com/", +OCEAN__INTEGRATION__CONFIG__PERSONAL_ACCESS_TOKEN="", +OCEAN__PORT__CLIENT_ID="", +OCEAN__PORT__CLIENT_SECRET="", +OCEAN__INTEGRATION__CONFIG__APP_HOST="", +APPLICATION__LOG_LEVEL="DEBUG", \ No newline at end of file diff --git a/integrations/gcp/.env.example b/integrations/gcp/.env.example new file mode 100644 index 0000000000..7ab4be19ae --- /dev/null +++ b/integrations/gcp/.env.example @@ -0,0 +1,5 @@ +OCEAN__PORT__CLIENT_ID = "" +OCEAN__PORT__CLIENT_SECRET = "" +OCEAN__PORT__BASE_URL = "http://localhost:3000" +OCEAN__EVENT_LISTENER = {"type": "POLLING"} +OCEAN__INTEGRATION = {"identifier": "my-gcp-integration", "type": "gcp", "config": {}} \ No newline at end of file diff --git a/integrations/gitlab/.env.example b/integrations/gitlab/.env.example new file mode 100644 index 0000000000..e5a0eec951 --- /dev/null +++ b/integrations/gitlab/.env.example @@ -0,0 +1,7 @@ +OCEAN__PORT__CLIENT_ID="", +OCEAN__PORT__CLIENT_SECRET="", +OCEAN__PORT__BASE_URL="http://localhost:3000", +OCEAN__INTEGRATION__CONFIG__TOKEN_MAPPING="{\"\": [\"getport-labs/**\"], \"\": [\"getport-labs/**\"]}", +OCEAN__INTEGRATION__CONFIG__APP_HOST="", +OCEAN__INTEGRATION__IDENTIFIER="gitlab", +OCEAN__INTEGRATION__CONFIG__TOKEN_GROUP_HOOKS_OVERRIDE_MAPPING="{\"\":[\"getport-labs/tal-group\"]}" \ No newline at end of file diff --git a/port_ocean/config/settings.py b/port_ocean/config/settings.py index 71ab46cbff..27b3ae796e 100644 --- a/port_ocean/config/settings.py +++ b/port_ocean/config/settings.py @@ -44,10 +44,10 @@ class PortSettings(BaseOceanModel, extra=Extra.allow): class IntegrationSettings(BaseOceanModel, extra=Extra.allow): identifier: str type: str - config: dict[str, Any] | BaseModel + config: dict[str, Any] | BaseModel = Field(default_factory=dict) @root_validator(pre=True) - def a(cls, values: dict[str, Any]) -> dict[str, Any]: + def root_validator(cls, values: dict[str, Any]) -> dict[str, Any]: integ_type = values.get("type") if not integ_type: @@ -68,4 +68,5 @@ class IntegrationConfiguration(BaseOceanSettings, extra=Extra.allow): send_raw_data_examples: bool = True port: PortSettings event_listener: EventListenerSettingsType - integration: IntegrationSettings + # If an identifier or type is not provided, it will be generated based on the integration name + integration: IntegrationSettings = IntegrationSettings(type="", identifier="") diff --git a/pyproject.toml b/pyproject.toml index f70c3f7860..a3a44ed071 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "port-ocean" -version = "0.5.25" +version = "0.5.26" description = "Port Ocean is a CLI tool for managing your Port projects." readme = "README.md" homepage = "https://app.getport.io"