Skip to content

Commit d12839f

Browse files
authored
Merge branch 'main' into main
2 parents 06841d0 + ff973cf commit d12839f

File tree

173 files changed

+3134
-487
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

173 files changed

+3134
-487
lines changed

.github/workflows/core-test.yml

+112-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: 🌊 Ocean Core Tests
22

33
on:
4+
push:
5+
branches:
6+
- main
47
pull_request:
58
workflow_dispatch:
69

@@ -31,7 +34,7 @@ jobs:
3134
3235
- name: Unit Test Core
3336
env:
34-
PYTEST_ADDOPTS: --junitxml=junit/unit-test-results-ocean/core.xml
37+
PYTEST_ADDOPTS: --cov --cov-report= --cov-append --junitxml=junit/unit-test-results-ocean/core.xml
3538
run: |
3639
make test
3740
@@ -50,7 +53,7 @@ jobs:
5053
5154
- name: Smoke Test Core
5255
env:
53-
PYTEST_ADDOPTS: --junitxml=junit/smoke-test-results-ocean/core.xml
56+
PYTEST_ADDOPTS: --cov --cov-report= --cov-append --junitxml=junit/smoke-test-results-ocean/core.xml
5457
PORT_CLIENT_ID: ${{ secrets.PORT_CLIENT_ID }}
5558
PORT_CLIENT_SECRET: ${{ secrets.PORT_CLIENT_SECRET }}
5659
PORT_BASE_URL: ${{ secrets.PORT_BASE_URL }}
@@ -61,7 +64,7 @@ jobs:
6164
- name: Cleanup Smoke Test
6265
if: always()
6366
env:
64-
PYTEST_ADDOPTS: --junitxml=junit/smoke-test-results-ocean/core.xml
67+
PYTEST_ADDOPTS: --cov --cov-report= --cov-append --junitxml=junit/smoke-test-results-ocean/core.xml
6568
PORT_CLIENT_ID: ${{ secrets.PORT_CLIENT_ID }}
6669
PORT_CLIENT_SECRET: ${{ secrets.PORT_CLIENT_SECRET }}
6770
PORT_BASE_URL: ${{ secrets.PORT_BASE_URL }}
@@ -77,7 +80,112 @@ jobs:
7780
- name: Test all integrations with current core
7881
run: |
7982
echo "Testing all integrations with local core"
80-
SCRIPT_TO_RUN="PYTEST_ADDOPTS=--junitxml=${PWD}/junit/test-results-core-change/\`pwd | xargs basename\`.xml make test" make execute/all
83+
SCRIPT_TO_RUN="PYTEST_ADDOPTS=\"--cov --cov-report= --cov-append --junitxml=${PWD}/junit/test-results-core-change/\`pwd | xargs basename\`.xml\" make test" make execute/all
84+
85+
- name: Get PR_NUMBER
86+
id: pr-number
87+
run: |
88+
if [ ! -z ${{ inputs.PR_NUMBER }} ]; then
89+
echo "PR_NUMBER=${{ inputs.PR_NUMBER }}" >> $GITHUB_OUTPUT
90+
elif [ ! -z ${{ github.event.pull_request.number }} ]; then
91+
echo "PR_NUMBER=${{ github.event.pull_request.number }}" >> $GITHUB_OUTPUT
92+
else
93+
echo "PR_NUMBER=0" >> $GITHUB_OUTPUT
94+
fi
95+
96+
- name: Produce coverage report
97+
run: |
98+
mkdir -p coverage-merge
99+
i=0
100+
find . -type f -name ".coverage" | while read -r file; do
101+
i=$((i + 1))
102+
cp "$file" "coverage-merge/.coverage.$i"
103+
done
104+
make coverage
105+
106+
- name: Upload coverage report
107+
id: upload-coverage
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: coverage-report
111+
path: htmlcov
112+
113+
- name: Set repo code coverage percentage by the percentage of statements covered in the tests
114+
id: set-stmts-coverage
115+
run: |
116+
stmts=$(jq '.totals.percent_covered | . * 100 | round | . / 100' coverage.json)
117+
echo "STMTS_COVERAGE=$stmts" >> $GITHUB_OUTPUT
118+
119+
- name: Comment PR with code coverage summary
120+
uses: actions/github-script@v7
121+
env:
122+
CODE_COVERAGE_ARTIFACT_URL: ${{ steps.upload-coverage.outputs.artifact-url }}
123+
PR_NUMBER: ${{ steps.pr-number.outputs.PR_NUMBER }}
124+
with:
125+
github-token: ${{ secrets.GITHUB_TOKEN }}
126+
script: |
127+
const output = `#### Code Coverage Artifact 📈: ${{ env.CODE_COVERAGE_ARTIFACT_URL }}
128+
#### Code Coverage Total Percentage: \`${{ steps.set-stmts-coverage.outputs.STMTS_COVERAGE }}%\``;
129+
130+
github.rest.issues.createComment({
131+
issue_number: ${{ env.PR_NUMBER }},
132+
owner: context.repo.owner,
133+
repo: context.repo.repo,
134+
body: output
135+
})
136+
137+
- name: Get current repo coverage percentage from Port
138+
uses: port-labs/port-github-action@v1
139+
id: get-current-coverage
140+
with:
141+
clientId: ${{ secrets.PORT_MAIN_CLIENT_ID }}
142+
clientSecret: ${{ secrets.PORT_MAIN_CLIENT_SECRET }}
143+
baseUrl: https://api.getport.io
144+
operation: GET
145+
identifier: ocean
146+
blueprint: repository
147+
148+
- name: Set current code coverage
149+
id: set-current-coverage
150+
run: echo "CURRENT_COVERAGE=${{ fromJson(steps.get-current-coverage.outputs.entity).properties.coverage_percent }}" >> $GITHUB_OUTPUT
151+
152+
- name: Comment if Coverage Regression
153+
if: ${{ (fromJson(steps.set-stmts-coverage.outputs.STMTS_COVERAGE) < fromJson(steps.set-current-coverage.outputs.CURRENT_COVERAGE)) && (steps.pr-number.outputs.PR_NUMBER != 0) }}
154+
uses: actions/github-script@v7
155+
env:
156+
PR_NUMBER: ${{ steps.pr-number.outputs.PR_NUMBER }}
157+
CURRENT_COVERAGE: ${{ steps.set-current-coverage.outputs.CURRENT_COVERAGE }}
158+
NEW_COVERAGE: ${{ steps.set-stmts-coverage.outputs.STMTS_COVERAGE }}
159+
with:
160+
github-token: ${{ secrets.GITHUB_TOKEN }}
161+
script: |
162+
const output = `🚨 The new code coverage percentage is lower than the current one. Current coverage: \`${{ env.CURRENT_COVERAGE }}\`\n While the new one is: \`${{ env.NEW_COVERAGE }}\``;
163+
164+
github.rest.issues.createComment({
165+
issue_number: ${{ env.PR_NUMBER }},
166+
owner: context.repo.owner,
167+
repo: context.repo.repo,
168+
body: output
169+
})
170+
171+
- name: Fail PR if current code coverage percentage is higher than the new one
172+
if: ${{ (fromJson(steps.set-stmts-coverage.outputs.STMTS_COVERAGE) < fromJson(steps.set-current-coverage.outputs.CURRENT_COVERAGE)) && (vars.CODE_COVERAGE_ENFORCEMENT == 'true') }}
173+
run: exit 1
174+
175+
- name: Update service code coverage percentage in Port
176+
if: ${{ (github.event_name == 'push') }}
177+
uses: port-labs/port-github-action@v1
178+
with:
179+
clientId: ${{ secrets.PORT_MAIN_CLIENT_ID }}
180+
clientSecret: ${{ secrets.PORT_MAIN_CLIENT_SECRET }}
181+
baseUrl: https://api.getport.io
182+
operation: UPSERT
183+
identifier: ocean
184+
blueprint: repository
185+
properties: |-
186+
{
187+
"coverage_percent": "${{ steps.set-stmts-coverage.outputs.STMTS_COVERAGE }}"
188+
}
81189
82190
- name: Publish Test Report
83191
uses: mikepenz/action-junit-report@v5

.github/workflows/docker-images-security-scan.yml

+44-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Scan docker images
22
on:
3+
schedule:
4+
- cron: '0 0 * * *' # Every day at midnight
35
workflow_dispatch:
46
inputs:
57
image:
@@ -51,7 +53,7 @@ jobs:
5153
id: set-images
5254
run: |
5355
PROJECTS=$(ls --color=never ./integrations | grep -Ev '_infra')
54-
if [[ "${{ inputs.image }}" != "all" ]]; then
56+
if [[ "${{ inputs.image }}" != "all" && "${{ github.event_name }}" == "workflow_dispatch" ]]; then
5557
PROJECTS="${{ inputs.image }}"
5658
fi
5759
IMAGES_WITH_VERSIONS=()
@@ -126,3 +128,44 @@ jobs:
126128
echo "</details>"
127129
} >> $GITHUB_STEP_SUMMARY
128130
fi
131+
132+
- name: Set output for trivy results
133+
run: |
134+
echo "VULNERABILITIES_COUNT=$(cat trivy-${{ steps.enrich-version.outputs.integration }}.txt | grep -i "total:" | awk '{print $2}')" >> $GITHUB_ENV
135+
echo ${{ env.VULNERABILITIES_COUNT }}
136+
137+
- name: Send slack alert if vulnerabilities found
138+
if: ${{ env.VULNERABILITIES_COUNT != '0' }}
139+
uses: slackapi/[email protected]
140+
with:
141+
webhook-type: incoming-webhook
142+
payload: |
143+
{
144+
"text": "Vulnerabilities found in `${{ steps.enrich-version.outputs.integration }}` image",
145+
"attachments": [
146+
{
147+
"text": "${{ steps.enrich-version.outputs.integration }} image has vulnerabilities",
148+
"fields": [
149+
{
150+
"title": "Image",
151+
"value": "${{ steps.enrich-version.outputs.image_tag }}",
152+
"short": true
153+
},
154+
{
155+
"title": "Vulnerabilities",
156+
"value": "Count: ${{ env.VULNERABILITIES_COUNT }}",
157+
"short": true
158+
},
159+
{
160+
"title": "link",
161+
"value": "https://github.com/port-labs/ocean/actions/runs/${{ github.run_id }}",
162+
"short": true
163+
}
164+
],
165+
166+
"color": "#FF0000"
167+
}
168+
]
169+
}
170+
env:
171+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_RND_ECOSYSTEM_DEPENDABOT_ALERTS_WEBHOOK_URL }}

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
<!-- towncrier release notes start -->
9+
## 0.22.1 (2025-04-02)
10+
11+
### Features
12+
13+
- Added support for team search query in entity mapping
14+
- Enhanced batch_upsert_entities to return tuples with success status.
15+
- Improved null property handling in entity field comparisons.
16+
- Updated upsert logic to use batch upsert consistently.
17+
- Added unit tests for null property handling in entity comparisons.
918

1019
## 0.22.0 (2025-03-17)
1120

Makefile

+6
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,9 @@ smoke/start-mock-api:
163163

164164
smoke/stop-mock-api:
165165
ps aux | grep fake_port_api | egrep -v grep | awk '{print $$2};' | xargs kill -9
166+
167+
coverage:
168+
$(ACTIVATE) && \
169+
coverage combine coverage-merge && \
170+
coverage html && \
171+
coverage json

integrations/amplication/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 0.1.10 (2025-04-03)
2+
3+
4+
### Improvements
5+
6+
- Bumped ocean version to ^0.22.1
7+
8+
19
## 0.1.9 (2025-03-24)
210

311

integrations/amplication/poetry.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integrations/amplication/pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[tool.poetry]
22
name = "amplication"
3-
version = "0.1.9"
3+
version = "0.1.10"
44
description = "Allowing Amplication users to integrate with Port"
55
authors = ["Itai Nathaniel <[email protected]>"]
66

77
[tool.poetry.dependencies]
88
python = "^3.12"
9-
port_ocean = {version = "^0.22.0", extras = ["cli"]}
9+
port_ocean = {version = "^0.22.1", extras = ["cli"]}
1010

1111
[tool.poetry.group.dev.dependencies]
1212
# Uncomment this if you want to debug the ocean core together with your integration

integrations/argocd/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
<!-- towncrier release notes start -->
99

10+
## 0.1.150 (2025-04-03)
11+
12+
13+
### Improvements
14+
15+
- Bumped ocean version to ^0.22.1
16+
17+
1018
## 0.1.149 (2025-03-24)
1119

1220

integrations/argocd/poetry.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integrations/argocd/pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[tool.poetry]
22
name = "argocd"
3-
version = "0.1.149"
3+
version = "0.1.150"
44
description = "Argo CD integration powered by Ocean"
55
authors = ["Isaac Coffie <[email protected]>"]
66

77
[tool.poetry.dependencies]
88
python = "^3.12"
9-
port_ocean = {version = "^0.22.0", extras = ["cli"]}
9+
port_ocean = {version = "^0.22.1", extras = ["cli"]}
1010

1111
[tool.poetry.group.dev.dependencies]
1212
# Uncomment this if you want to debug the ocean core together with your integration

integrations/aws/CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
<!-- towncrier release notes start -->
99

10+
## 0.2.114 (2025-04-03)
11+
12+
13+
### Improvements
14+
15+
- Bumped ocean version to ^0.22.1
16+
17+
1018
## 0.2.113 (2025-03-24)
1119

1220

integrations/aws/poetry.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integrations/aws/pyproject.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[tool.poetry]
22
name = "aws"
3-
version = "0.2.113"
3+
version = "0.2.114"
44
description = "This integration will map all your resources in all the available accounts to your Port entities"
55
authors = ["Shalev Avhar <[email protected]>", "Erik Zaadi <[email protected]>"]
66

77
[tool.poetry.dependencies]
88
python = "^3.12"
9-
port_ocean = {version = "^0.22.0", extras = ["cli"]}
9+
port_ocean = {version = "^0.22.1", extras = ["cli"]}
1010
python-dotenv = "^1.0.1"
1111
aioboto3 = "^12.4.0"
1212
boto3-stubs = {version = "1.34.76", extras = ["acm", "apigateway", "appconfig", "athena", "cloudcontrol", "cloudformation", "cloudwatch", "dynamodb", "ec2", "ec2-instance-connect", "ecr", "ecs", "elasticache", "elb", "elbv2", "events", "iam", "lambda", "logs", "organizations", "rds", "route53", "s3", "sagemaker", "secretsmanager", "sns", "sqs", "ssm", "sts"]}

0 commit comments

Comments
 (0)