Skip to content

Commit d27910c

Browse files
authored
Merge branch 'segmentio:main' into main
2 parents acaccc8 + 63a977e commit d27910c

File tree

601 files changed

+28546
-7136
lines changed

Some content is hidden

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

601 files changed

+28546
-7136
lines changed

.eslintrc.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ module.exports = {
4545
'@typescript-eslint/require-await': 'off',
4646
'@typescript-eslint/restrict-plus-operands': 'off',
4747
'@typescript-eslint/restrict-template-expressions': 'off',
48-
'@typescript-eslint/unbound-method': 'off'
48+
'@typescript-eslint/unbound-method': 'off',
49+
'@typescript-eslint/no-unsafe-argument': 'warn',
50+
'@typescript-eslint/no-misused-promises': 'warn'
4951
},
5052
overrides: [
5153
{

.github/workflows/ci.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ on:
99
jobs:
1010
test:
1111
name: Unit tests
12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-22.04
1313
timeout-minutes: 30
1414
strategy:
1515
matrix:
16-
node-version: [18.x]
16+
node-version: [22.x]
1717

1818
steps:
1919
# See nx recipe: https://nx.dev/recipes/ci/monorepo-ci-github-actions
@@ -54,11 +54,11 @@ jobs:
5454

5555
lint:
5656
name: Lint
57-
runs-on: ubuntu-20.04
57+
runs-on: ubuntu-22.04
5858
timeout-minutes: 20
5959
strategy:
6060
matrix:
61-
node-version: [18.x]
61+
node-version: [22.x]
6262

6363
steps:
6464
- uses: actions/checkout@v4
@@ -88,11 +88,11 @@ jobs:
8888

8989
validate:
9090
name: Validate
91-
runs-on: ubuntu-20.04
91+
runs-on: ubuntu-22.04
9292
timeout-minutes: 20
9393
strategy:
9494
matrix:
95-
node-version: [18.x]
95+
node-version: [22.x]
9696

9797
steps:
9898
- uses: actions/checkout@v4
@@ -135,11 +135,11 @@ jobs:
135135
# env: # Disable saucelabs - we blew through our quota.
136136
# SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}}
137137
# SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}
138-
runs-on: ubuntu-20.04
138+
runs-on: ubuntu-22.04
139139
timeout-minutes: 20
140140
strategy:
141141
matrix:
142-
node-version: [18.x]
142+
node-version: [22.x]
143143

144144
steps:
145145
- uses: actions/checkout@v4
@@ -171,13 +171,13 @@ jobs:
171171

172172
browser-tests-core:
173173
name: 'Browser tests: actions-core'
174-
runs-on: ubuntu-20.04
174+
runs-on: ubuntu-22.04
175175

176176
timeout-minutes: 10
177177

178178
strategy:
179179
matrix:
180-
node-version: [18.x]
180+
node-version: [22.x]
181181

182182
steps:
183183
- uses: actions/checkout@v2
@@ -192,7 +192,7 @@ jobs:
192192
id: yarn-cache-dir-path
193193
run: echo "::set-output name=dir::$(yarn cache dir)"
194194

195-
- uses: actions/cache@v2
195+
- uses: actions/cache@v3
196196
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
197197
with:
198198
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -214,13 +214,13 @@ jobs:
214214

215215
snyk:
216216
name: Snyk
217-
runs-on: ubuntu-20.04
217+
runs-on: ubuntu-22.04
218218

219219
timeout-minutes: 5
220220

221221
strategy:
222222
matrix:
223-
node-version: [18.x]
223+
node-version: [22.x]
224224

225225
steps:
226226
- uses: actions/checkout@v2
@@ -237,7 +237,7 @@ jobs:
237237
id: yarn-cache-dir-path
238238
run: echo "::set-output name=dir::$(yarn cache dir)"
239239

240-
- uses: actions/cache@v2
240+
- uses: actions/cache@v3
241241
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
242242
with:
243243
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}

.github/workflows/ext.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
env:
1212
HUSKY: 0
1313
NX_DISABLE_DB: true
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
1515

1616
timeout-minutes: 20
1717

1818
strategy:
1919
matrix:
20-
node-version: [18.x]
20+
node-version: [22.x]
2121

2222
steps:
2323
- uses: actions/checkout@v4

.github/workflows/label-prs.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
pr-labeler:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-22.04
1212
permissions:
1313
contents: read
1414
pull-requests: write
@@ -60,3 +60,46 @@ jobs:
6060
});
6161
await Promise.all(requests);
6262
}
63+
64+
- name: Comment for mapping-kit changes
65+
uses: actions/github-script@v7
66+
env:
67+
labelsToAdd: '${{ steps.compute-labels.outputs.add }}'
68+
labelsToRemove: '${{ steps.compute-labels.outputs.remove }}'
69+
with:
70+
script: |
71+
const { labelsToAdd, labelsToRemove, DRY_RUN } = process.env
72+
const shouldAddComment = labelsToAdd.length > 0 && labelsToAdd.split(",").some(x=>x.includes("mappingkit"))
73+
const shouldRemoveComment = labelsToRemove.length > 0 && labelsToRemove.split(",").some(x=>x.includes("mappingkit"))
74+
// Get the list of comments on the PR
75+
const response = await github.rest.issues.listComments({
76+
issue_number: context.issue.number,
77+
owner: context.repo.owner,
78+
repo: context.repo.repo
79+
})
80+
const mappingKitComment = response.data.find(comment => comment.body.includes('mapping-kit go'))
81+
if(shouldAddComment){
82+
if (mappingKitComment) {
83+
console.log('Already commented on this PR')
84+
return
85+
}
86+
// Add comment to the PR
87+
await github.rest.issues.createComment({
88+
issue_number: context.issue.number,
89+
owner: context.repo.owner,
90+
repo: context.repo.repo,
91+
body: `This PR makes changes to mapping-kit. Please ensure that the changes are reflected in the [mapping-kit go](https://github.com/segmentio/mapping-kit) library as well and link the PR in description.`
92+
})
93+
}
94+
if(shouldRemoveComment) {
95+
if (!mappingKitComment) {
96+
console.log('No mapping-kit comment to remove')
97+
return
98+
}
99+
// Remove comment from the PR
100+
await github.rest.issues.deleteComment({
101+
comment_id: mappingKitComment.id,
102+
owner: context.repo.owner,
103+
repo: context.repo.repo
104+
})
105+
}

.github/workflows/publish-canary.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
HUSKY: 0
1212
NX_DISABLE_DB: true
1313
if: startsWith(github.event.head_commit.message, 'Publish') == true
14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
1515

1616
timeout-minutes: 15
1717

1818
strategy:
1919
matrix:
20-
node-version: [18.x]
20+
node-version: [22.x]
2121

2222
steps:
2323
- uses: actions/checkout@v4

.github/workflows/publish.yml

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,19 @@ jobs:
1515
HUSKY: 0
1616
NX_DISABLE_DB: true
1717
if: startsWith(github.event.head_commit.message, 'Publish') == true
18-
runs-on: ubuntu-20.04
18+
runs-on: ubuntu-22.04
1919

2020
timeout-minutes: 15
2121

2222
strategy:
2323
matrix:
24-
node-version: [18.x]
24+
node-version: [22.x]
2525

2626
steps:
2727
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
fetch-tags: true
2831

2932
- name: Use Node.js ${{ matrix.node-version }}
3033
uses: actions/setup-node@v4
@@ -33,6 +36,11 @@ jobs:
3336
registry-url: 'https://registry.npmjs.org'
3437
cache: yarn
3538

39+
- name: Setup git credentials
40+
run: |
41+
git config user.name "github-actions[bot]"
42+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
43+
3644
- name: Install Dependencies
3745
run: yarn install --frozen-lockfile
3846

@@ -52,22 +60,6 @@ jobs:
5260
run: |
5361
yarn lerna publish from-package --yes --loglevel=verbose --dist-tag latest
5462
55-
release:
56-
needs: build-and-publish # comment when testing locally with https://github.com/nektos/act
57-
58-
runs-on: ubuntu-20.04
59-
timeout-minutes: 15
60-
steps:
61-
- uses: actions/checkout@v4
62-
with:
63-
fetch-depth: 0 # Shallow clones should be disabled to ensure the commit history for the repository is available to the action
64-
fetch-tags: true
65-
66-
- name: Setup git credentials
67-
run: |
68-
git config user.name "github-actions[bot]"
69-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
70-
7163
- name: Generate Tags
7264
id: get-release-tag
7365
run: ./scripts/generate-release-tags.sh
@@ -79,24 +71,7 @@ jobs:
7971
RELEASE_TAG: ${{ steps.get-release-tag.outputs.release-tag }}
8072
with:
8173
script: |
74+
const cloudManifest = require('./packages/destination-actions/dist/destinations/index.js').manifest
75+
const browserManifest = require('./packages/destinations-manifest/dist/index.js').manifest
8276
const script = require('./scripts/github-action/create-github-release.js')
83-
await script({github, context, core, exec})
84-
85-
# When hotfix is merged back to main, we tag all the packages that were changed in the hotfix commit.
86-
tag-hotfix:
87-
if: startsWith(github.event.head_commit.message, 'Hotfix:') == true && github.ref == 'refs/heads/main'
88-
runs-on: ubuntu-latest
89-
steps:
90-
- name: Checkout
91-
uses: actions/checkout@v4
92-
with:
93-
fetch-depth: 0
94-
95-
- name: Configure git
96-
run: |
97-
git config user.name "github-actions[bot]"
98-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
99-
100-
- name: Generate Package Specific Tags
101-
id: get-release-tag
102-
run: ./scripts/generate-package-tags.sh
77+
await script({github, context, core, exec, cloudManifest, browserManifest})

.github/workflows/required-field-check.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66

77
jobs:
88
required-field-check:
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-22.04
1010

1111
timeout-minutes: 5
1212

@@ -46,14 +46,23 @@ jobs:
4646
id: required-fields-curr-branch
4747
if: steps.get_files.outputs.no_files_changed != 'true'
4848
run: |
49+
set -e
4950
REQUIRED_FIELDS_CURR_BRANCH=$(./bin/run list-required-fields -p ${{ steps.get_files.outputs.files }} | jq -c .)
5051
echo "REQUIRED_FIELDS_CURR_BRANCH=$REQUIRED_FIELDS_CURR_BRANCH" >> $GITHUB_ENV
5152
5253
- name: Check for required fields on main branch
5354
id: required-fields-main-branch
5455
if: steps.get_files.outputs.no_files_changed != 'true'
5556
run: |
57+
set -e
5658
git checkout main
59+
# Run install again on main branch to ensure all dependencies are installed
60+
# and the lockfile is up to date
61+
# This is important because the main branch may have different dependencies
62+
# than the current branch, and we want to ensure that the required fields are
63+
# checked against the correct version of the dependencies
64+
yarn install --frozen-lockfile --silent
65+
# Run the list-required-fields command on the main branch to get the required fields
5766
REQUIRED_FIELDS_MAIN_BRANCH=$(./bin/run list-required-fields -p ${{ steps.get_files.outputs.files }} | jq -c .)
5867
echo "REQUIRED_FIELDS_MAIN_BRANCH=$REQUIRED_FIELDS_MAIN_BRANCH" >> $GITHUB_ENV
5968
@@ -88,7 +97,7 @@ jobs:
8897
}
8998
}
9099
} else {
91-
100+
92101
// If key is not present in requiredFieldsOnMain, then all fields are added recently
93102
const getActionKeys = Object.keys(requiredFieldsOnBranch[key])
94103
for(const actionKey of getActionKeys) {
@@ -109,7 +118,7 @@ jobs:
109118
owner: context.repo.owner,
110119
repo: context.repo.repo
111120
})
112-
const diffComment = comments.data.find(comment => comment.body.includes('<!--REQUIRED_FIELD_DIFF-->'))
121+
const diffComment = comments.data.find(comment => comment.body.includes('<!--REQUIRED_FIELD_DIFF-->'))
113122
114123
const comment = fs.readFileSync("./.github/REQUIRED_FIELD_WARNING_TEMPLATE.md", "utf8")
115124
const commentBody = comment.replace('{{FIELDS_ADDED}}', fieldsAdded.join('\n'))

.github/workflows/version-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
build-and-version-packages:
2121
strategy:
2222
matrix:
23-
node-version: [18.x]
23+
node-version: [22.x]
2424
env:
2525
HUSKY: 0
2626
NX_DISABLE_DB: true

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
18.12.1
1+
22.13.1

0 commit comments

Comments
 (0)