Skip to content

Commit bd51347

Browse files
Merge branch 'develop' into feat.singular.non.mobile.platforms
2 parents 6102070 + d381dac commit bd51347

File tree

630 files changed

+69400
-23028
lines changed

Some content is hidden

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

630 files changed

+69400
-23028
lines changed

.eslintignore

+5
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ src/v0/destinations/personalize/scripts/
2121
test/integrations/destinations/testTypes.d.ts
2222
*.config*.js
2323
scripts/skipPrepareScript.js
24+
*.yaml
25+
*.yml
26+
.eslintignore
27+
.prettierignore
28+
*.json

.eslintrc.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"parserOptions": {
2020
"ecmaVersion": 12,
2121
"sourceType": "module",
22-
"project": "./tsconfig.json"
22+
"project": "./tsconfig.json",
23+
"extraFileExtensions": [".yaml"]
2324
},
2425
"rules": {
2526
"unicorn/filename-case": [

.github/workflows/build-pr-artifacts.yml

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
- reopened
88
- synchronize
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
12+
cancel-in-progress: true
13+
1014
jobs:
1115
generate-tag-names:
1216
runs-on: ubuntu-latest

.github/workflows/build-push-docker-image.yml

+71-12
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ on:
2323
type: string
2424
build_type:
2525
type: string
26+
use_merge_sha:
27+
type: boolean
28+
default: false
29+
skip_tests:
30+
type: boolean
31+
default: false
32+
description: if this option is true, we would skip tests while building docker image
33+
workflow_url:
34+
type: string
2635
secrets:
2736
DOCKERHUB_PROD_TOKEN:
2837
required: true
@@ -31,27 +40,74 @@ env:
3140
DOCKERHUB_USERNAME: rudderlabs
3241

3342
jobs:
43+
get_sha:
44+
runs-on: ubuntu-latest
45+
name: Get SHA information
46+
outputs:
47+
sha: ${{steps.getSHA.outputs.SHA}}
48+
steps:
49+
- name: Checkout SHA
50+
id: getSHA
51+
run: |
52+
if ${{inputs.use_merge_sha}} == true; then
53+
sha=$(echo ${{github.sha}})
54+
else
55+
sha=$(echo ${{ github.event.pull_request.head.sha }})
56+
fi
57+
echo "SHA: $sha"
58+
echo "SHA=$sha" >> $GITHUB_OUTPUT
59+
60+
get_changed_files:
61+
runs-on: ubuntu-latest
62+
name: Get Changed files
63+
outputs:
64+
should_execute_tests: ${{ steps.processing.outputs.should_execute_tests }}
65+
steps:
66+
- name: Checkout
67+
uses: actions/[email protected]
68+
with:
69+
fetch-depth: 1
70+
- id: files
71+
uses: Ana06/[email protected]
72+
with:
73+
token: ${{ secrets.GITHUB_TOKEN }}
74+
format: 'json'
75+
- id: processing
76+
run: |
77+
readarray -t modified_files <<<"$(jq -r '.[]' <<<'${{ steps.files.outputs.modified }}')"
78+
echo "Modified files: $modified_files"
79+
found=false
80+
for modified_file in "${modified_files[@]}"; do
81+
if [[ "$modified_file" == "Dockerfile" || "$modified_file" == "docker-compose.yml" || "$modified_file" == "Dockerfile" || "$modified_file" == "Dockerfile-ut-func" ]]; then
82+
found=true
83+
break
84+
fi
85+
done
86+
echo "Match Found: $found"
87+
echo "::set-output name=should_execute_tests::$found"
88+
3489
build-transformer-image-arm64:
3590
name: Build Transformer Docker Image ARM64
3691
runs-on: [self-hosted, Linux, ARM64]
92+
needs: [get_sha, get_changed_files]
3793
steps:
3894
- name: Checkout
3995
uses: actions/[email protected]
4096
with:
41-
ref: ${{ github.event.pull_request.head.sha }}
97+
ref: ${{ needs.get_sha.outputs.sha }}
4298
fetch-depth: 1
4399

44100
- name: Setup Docker Buildx
45-
uses: docker/setup-buildx-action@v3.0.0
101+
uses: docker/setup-buildx-action@v3.6.1
46102

47103
- name: Login to DockerHub
48-
uses: docker/login-action@v2.1.0
104+
uses: docker/login-action@v3.3.0
49105
with:
50106
username: ${{ env.DOCKERHUB_USERNAME }}
51107
password: ${{ secrets.DOCKERHUB_PROD_TOKEN }}
52108

53109
- name: Build Docker Image
54-
uses: docker/build-push-action@v5.1.0
110+
uses: docker/build-push-action@v6.7.0
55111
with:
56112
context: .
57113
file: ${{ inputs.dockerfile }}
@@ -62,12 +118,13 @@ jobs:
62118
# cache-to: type=gha,mode=max
63119

64120
- name: Run Tests
121+
if: ${{ inputs.skip_tests != true || needs.get_changed_files.outputs.should_execute_tests == true }}
65122
run: |
66123
docker run ${{ inputs.build_tag }} npm run test:js:ci
67124
docker run ${{ inputs.build_tag }} npm run test:ts:ci
68125
69126
- name: Build and Push Multi-platform Images
70-
uses: docker/build-push-action@v5.1.0
127+
uses: docker/build-push-action@v6.7.0
71128
with:
72129
context: .
73130
file: ${{ inputs.dockerfile }}
@@ -85,24 +142,25 @@ jobs:
85142
build-transformer-image-amd64:
86143
name: Build Transformer Docker Image AMD64
87144
runs-on: [self-hosted, Linux, X64]
145+
needs: [get_sha, get_changed_files]
88146
steps:
89147
- name: Checkout
90148
uses: actions/[email protected]
91149
with:
92-
ref: ${{ github.event.pull_request.head.sha }}
150+
ref: ${{ needs.get_sha.outputs.sha }}
93151
fetch-depth: 1
94152

95153
- name: Setup Docker Buildx
96-
uses: docker/setup-buildx-action@v3.0.0
154+
uses: docker/setup-buildx-action@v3.6.1
97155

98156
- name: Login to DockerHub
99-
uses: docker/login-action@v2.1.0
157+
uses: docker/login-action@v3.3.0
100158
with:
101159
username: ${{ env.DOCKERHUB_USERNAME }}
102160
password: ${{ secrets.DOCKERHUB_PROD_TOKEN }}
103161

104162
- name: Build Docker Image
105-
uses: docker/build-push-action@v5.1.0
163+
uses: docker/build-push-action@v6.7.0
106164
with:
107165
context: .
108166
file: ${{ inputs.dockerfile }}
@@ -113,12 +171,13 @@ jobs:
113171
# cache-to: type=gha,mode=max
114172

115173
- name: Run Tests
174+
if: ${{ inputs.skip_tests != true || needs.get_changed_files.outputs.should_execute_tests == true }}
116175
run: |
117176
docker run ${{ inputs.build_tag }} npm run test:js:ci
118177
docker run ${{ inputs.build_tag }} npm run test:ts:ci
119178
120179
- name: Build and Push Multi-platform Images
121-
uses: docker/build-push-action@v5.1.0
180+
uses: docker/build-push-action@v6.7.0
122181
with:
123182
context: .
124183
file: ${{ inputs.dockerfile }}
@@ -140,10 +199,10 @@ jobs:
140199

141200
steps:
142201
- name: Set up Docker Buildx
143-
uses: docker/setup-buildx-action@v3.0.0
202+
uses: docker/setup-buildx-action@v3.6.1
144203

145204
- name: Login to DockerHub
146-
uses: docker/login-action@v2.1.0
205+
uses: docker/login-action@v3.3.0
147206
with:
148207
username: ${{ env.DOCKERHUB_USERNAME }}
149208
password: ${{ secrets.DOCKERHUB_PROD_TOKEN }}

.github/workflows/check-pr-title.yml

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
- reopened
99
- synchronize
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
13+
cancel-in-progress: true
14+
1115
jobs:
1216
check-pr-title:
1317
name: Check PR Title

.github/workflows/commitlint.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: Commitlint
22

33
on: [push]
44

5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
7+
cancel-in-progress: true
8+
59
jobs:
610
commitlint:
711
runs-on: ubuntu-latest
@@ -12,7 +16,7 @@ jobs:
1216
fetch-depth: 0
1317

1418
- name: Setup Node
15-
uses: actions/[email protected].1
19+
uses: actions/[email protected].3
1620
with:
1721
node-version-file: '.nvmrc'
1822
cache: 'npm'

.github/workflows/component-test-report.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
- reopened
88
- synchronize
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
12+
cancel-in-progress: true
13+
1014
permissions:
1115
id-token: write # allows the JWT to be requested from GitHub's OIDC provider
1216
contents: read # This is required for actions/checkout
@@ -28,7 +32,7 @@ jobs:
2832
fetch-depth: 1
2933

3034
- name: Setup Node
31-
uses: actions/[email protected].2
35+
uses: actions/[email protected].3
3236
with:
3337
node-version-file: '.nvmrc'
3438
cache: 'npm'

.github/workflows/draft-new-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fetch-depth: 0
1717

1818
- name: Setup Node
19-
uses: actions/[email protected].2
19+
uses: actions/[email protected].3
2020
with:
2121
node-version-file: '.nvmrc'
2222
cache: 'npm'

.github/workflows/dt-test-and-report-code-coverage.yml

+31-3
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,35 @@ on:
88
pull_request:
99
types: ['opened', 'reopened', 'synchronize']
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
13+
cancel-in-progress: true
14+
1115
jobs:
16+
get_workflow_url:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- id: get_url
20+
run: |
21+
curl -s https://api.github.com/repos/${{ github.repository }}/actions/workflows/${{ github.workflow }}/runs/${{ github.run_id }} | jq -r .html_url >> workflow_url.txt
22+
echo "::set-output name=workflow_url::$(cat workflow_url.txt)"
23+
outputs:
24+
url: ${{ steps.get_url.outputs.workflow_url }}
25+
1226
coverage:
1327
name: Code Coverage
1428
runs-on: ubuntu-latest
15-
29+
needs: [get_workflow_url]
30+
outputs:
31+
tests_run_outcome: ${{steps.run_tests.outcome}}
1632
steps:
1733
- name: Checkout
1834
uses: actions/[email protected]
1935
with:
2036
fetch-depth: 1
2137

2238
- name: Setup Node
23-
uses: actions/[email protected].2
39+
uses: actions/[email protected].3
2440
with:
2541
node-version-file: '.nvmrc'
2642
cache: 'npm'
@@ -29,6 +45,8 @@ jobs:
2945
run: npm ci
3046

3147
- name: Run Tests
48+
id: run_tests
49+
continue-on-error: true
3250
run: |
3351
# Supress logging in tests
3452
LOG_LEVEL=100 npm run test:js:ci
@@ -62,7 +80,17 @@ jobs:
6280
6381
- name: SonarCloud Scan
6482
if: always()
65-
uses: SonarSource/sonarcloud-github-action@v2.1.1
83+
uses: SonarSource/sonarcloud-github-action@v3.0.0
6684
env:
6785
GITHUB_TOKEN: ${{ secrets.PAT }}
6886
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
87+
88+
notify:
89+
name: slack notification on failure
90+
needs: [get_workflow_url, coverage]
91+
if: needs.coverage.outputs.tests_run_outcome == 'failure' || failure()
92+
uses: ./.github/workflows/slack-notify.yml
93+
with:
94+
workflow_url: ${{ needs.get_workflow_url.outputs.url }}
95+
should_notify: ${{startsWith(github.event.pull_request.head.ref, 'hotfix-release/')}}
96+
secrets: inherit

.github/workflows/prepare-for-dev-deploy.yml

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
branches:
1111
- develop
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
report-coverage:
1519
name: Report Code Coverage
@@ -56,6 +60,7 @@ jobs:
5660
dockerfile: Dockerfile
5761
load_target: development
5862
push_target: production
63+
use_merge_sha: true
5964
secrets:
6065
DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }}
6166

.github/workflows/prepare-for-prod-dt-deploy.yml

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
branches:
1111
- main
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
report-coverage:
1519
name: Report Code Coverage
@@ -53,6 +57,8 @@ jobs:
5357
load_target: development
5458
push_target: production
5559
build_type: dt
60+
use_merge_sha: true
61+
skip_tests: ${{startsWith(github.event.pull_request.head.ref, 'hotfix-release/')}}
5662
secrets:
5763
DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }}
5864

.github/workflows/prepare-for-prod-ut-deploy.yml

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
branches:
1111
- main
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
report-coverage:
1519
name: Report Code Coverage
@@ -56,6 +60,8 @@ jobs:
5660
load_target: development
5761
push_target: production
5862
build_type: ut
63+
use_merge_sha: true
64+
skip_tests: ${{startsWith(github.event.pull_request.head.ref, 'hotfix-release/')}}
5965
secrets:
6066
DOCKERHUB_PROD_TOKEN: ${{ secrets.DOCKERHUB_PROD_TOKEN }}
6167

0 commit comments

Comments
 (0)