Skip to content

Commit

Permalink
Merge branch 'main' into clickup-integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
oiadebayo authored Sep 26, 2024
2 parents 6ec6ed6 + 174af67 commit 0ec2807
Show file tree
Hide file tree
Showing 112 changed files with 1,318 additions and 617 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/apply-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
./scripts/bump-all.sh ^${{ steps.version.outputs.version }}
./scripts/bump-all.sh ${{ steps.version.outputs.version }}
- name: Open pull request
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
contents: read
needs: [prepare-matrix]
strategy:
max-parallel: 5
matrix:
integration: ${{fromJson(needs.prepare-matrix.outputs.matrix)}}
steps:
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/core-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: 🌊 Ocean Core Tests

on:
pull_request:
workflow_dispatch:

jobs:
detect-changes:
uses: ./.github/workflows/detect-changes-matrix.yml
test:
name: 🌊 Ocean Core Tests
needs: detect-changes
runs-on: ubuntu-latest
if: ${{ needs.detect-changes.outputs.core == 'true' }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'

- name: Install dependencies
run: |
make install
- name: Build core for smoke test
run: |
make build
- name: Run fake integration for core test
env:
PORT_CLIENT_ID: ${{ secrets.PORT_CLIENT_ID }}
PORT_CLIENT_SECRET: ${{ secrets.PORT_CLIENT_SECRET }}
PORT_BASE_URL: ${{ secrets.PORT_BASE_URL }}
SMOKE_TEST_SUFFIX: ${{ github.run_id }}
run: |
./scripts/run-smoke-test.sh
- name: Unit and Smoke Test Core
env:
PYTEST_ADDOPTS: --junitxml=junit/test-results-ocean/core.xml
PORT_CLIENT_ID: ${{ secrets.PORT_CLIENT_ID }}
PORT_CLIENT_SECRET: ${{ secrets.PORT_CLIENT_SECRET }}
PORT_BASE_URL: ${{ secrets.PORT_BASE_URL }}
SMOKE_TEST_SUFFIX: ${{ github.run_id }}
run: |
make test
- name: Install current core for all integrations
run: |
echo "Installing local core for all integrations"
SCRIPT_TO_RUN='make install/local-core' make execute/all
- name: Test all integrations with current core
run: |
echo "Testing all integrations with local core"
SCRIPT_TO_RUN="PYTEST_ADDOPTS=--junitxml=${PWD}/junit/test-results-core-change/\`pwd | xargs basename\`.xml make test" make execute/all
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: ${{ always() }}
with:
report_paths: '**/junit/test-results-**/*.xml'
include_passed: true
require_tests: true
fail_on_failure: true
1 change: 1 addition & 0 deletions .github/workflows/create-new-sonarcloud-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
runs-on: ubuntu-latest
name: Create new project for integrations
strategy:
max-parallel: 5
matrix: ${{ fromJson(needs.pre-run.outputs.changed_integrations) }}
steps:
- name: Create integration variable
Expand Down
58 changes: 36 additions & 22 deletions .github/workflows/detect-changes-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,53 @@ on:
outputs:
matrix:
value: ${{ jobs.detect-changes.outputs.matrix }}
description: "Matrix of changed integrations / Ocean Core per git commit changes"
integrations:
description: "Matrix of changed integrations per git commit changes"
value: ${{ jobs.detect-changes.outputs.integrations }}
core:
value: ${{ jobs.detect-changes.outputs.core }}
description: "Determine if any core changes per git commit changes"

jobs:
detect-changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
matrix: ${{ steps.set-all-matrix.outputs.matrix }}
integrations: ${{ steps.set-all-matrix.outputs.integrations }}
core: ${{ steps.set-all-matrix.outputs.core }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Get list of changed files
id: changed-files
uses: tj-actions/[email protected]
- name: Set matrix
id: set-matrix
run: |
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)' \
| egrep -v '_infra' \
| cut -d'/' -f2 | sort | uniq)
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
# Add the root directory to the matrix if there are changes outside the integrations folder
changed_folders=$(echo -e "$changed_folders\n.")
fi
uses: tj-actions/[email protected]
with:
dir_names: true
json: true
dir_names_max_depth: 2
escape_json: false
files_yaml: |
core:
- '!integrations/**'
- '!scripts/*'
- '!scripts/*'
- '!./*.md'
integrations:
- 'integrations/**'
- '!integrations/**/*.md'
matrix=$(echo "$changed_folders" | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "matrix=$matrix" >> $GITHUB_OUTPUT
- name: Set integrations and all matrix
id: set-all-matrix
run: |
INTEGRATIONS=$(node -e 'integrations=${{ steps.changed-files.outputs.integrations_all_changed_files }};console.log(JSON.stringify(integrations.map(integration => integration.split("/")[1])))')
HAS_CORE=${{ steps.changed-files.outputs.core_all_changed_files != '[]' }}
echo "Core changes : ${HAS_CORE}"
MATRIX=$(node -e "integrations=${INTEGRATIONS}; hasCore=${HAS_CORE}; console.log(JSON.stringify(hasCore ? integrations.concat(['.']) : integrations))")
echo "Integration changes : ${INTEGRATIONS}"
echo "All changes : ${MATRIX}"
echo "core=${HAS_CORE}" >> $GITHUB_OUTPUT
echo "integrations=${INTEGRATIONS}" >> $GITHUB_OUTPUT
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT
51 changes: 51 additions & 0 deletions .github/workflows/integrations-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Integrations Test

on:
pull_request:
workflow_dispatch:

jobs:
detect-changes:
uses: ./.github/workflows/detect-changes-matrix.yml
test:
name: ${{ format('🚢 {0}', matrix.folder) }}
needs: detect-changes
runs-on: ubuntu-latest
if: ${{ needs.detect-changes.outputs.integrations != '[]' }}
strategy:
max-parallel: 5
matrix:
folder: ${{ fromJson(needs.detect-changes.outputs.integrations) }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'

- name: Install dependencies
working-directory: ${{ format('integrations/{0}', matrix.folder) }}
run: |
make install
- name: Test
working-directory: ${{ format('integrations/{0}', matrix.folder) }}
env:
PYTEST_ADDOPTS: --junitxml=junit/test-results-${{ format('integrations/{0}', matrix.folder) }}.xml
run: |
make test
- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: ${{ always() }}
with:
report_paths: '**/junit/test-results-**/*.xml'
include_passed: true
require_tests: true
fail_on_failure: true
5 changes: 5 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,27 @@ jobs:
needs: detect-changes
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
folder: ${{ fromJson(needs.detect-changes.outputs.matrix) }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'poetry'

- name: Install dependencies
working-directory: ${{ matrix.folder != '.' && format('integrations/{0}', matrix.folder) || '.' }}
run: |
make install
- name: Lint
working-directory: ${{ matrix.folder != '.' && format('integrations/{0}', matrix.folder) || '.' }}
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
needs: [prepare-matrix]
strategy:
# limit the number of parallel jobs to avoid hitting the ghcr.io rate limit
max-parallel: 15
max-parallel: 5
matrix:
integration: ${{fromJson(needs.prepare-matrix.outputs.matrix)}}
steps:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sonarcloud-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
needs: pre-run
if: ${{ needs.pre-run.outputs.count_changed_integrations > 0 }}
strategy:
max-parallel: 5
matrix: ${{ fromJson(needs.pre-run.outputs.changed_integrations) }}
runs-on: ubuntu-latest
steps:
Expand Down
92 changes: 0 additions & 92 deletions .github/workflows/test.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

## 0.10.12 (2024-09-19)

### Bug Fixes

- Fixed updating state of resync when the resync is being cancelled by a new resync event

## 0.10.11 (2024-09-17)

### Improvements
Expand Down
8 changes: 8 additions & 0 deletions integrations/argocd/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- towncrier release notes start -->

## 0.1.88 (2024-09-22)


### Improvements

- Bumped ocean version to ^0.10.12


## 0.1.87 (2024-09-17)


Expand Down
Loading

0 comments on commit 0ec2807

Please sign in to comment.