Skip to content

Commit 04c5fa8

Browse files
authored
Merge branch 'develop' into fix.bufferDpEvents-sdk-2862
2 parents 7a9d55e + 2a01152 commit 04c5fa8

File tree

184 files changed

+6123
-5052
lines changed

Some content is hidden

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

184 files changed

+6123
-5052
lines changed

.github/workflows/create-hotfix-branch.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,19 @@ on:
88
required: true
99

1010
jobs:
11+
validate-actor:
12+
# Only allow creating hotfix branches from the main branch
13+
if: github.ref == 'refs/heads/main'
14+
uses: ./.github/workflows/validate-actor.yml
15+
with:
16+
team_names: 'js-sdk,integrations'
17+
secrets:
18+
PAT: ${{ secrets.PAT }}
19+
1120
create-branch:
1221
name: Create a new hotfix branch
1322
runs-on: [self-hosted, Linux, X64]
14-
if: github.ref == 'refs/heads/main'
23+
needs: validate-actor
1524
steps:
1625
- name: Create branch
1726
uses: peterjgrainger/[email protected]

.github/workflows/deploy-npm.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,12 @@ jobs:
6666
node-version-file: '.nvmrc'
6767
cache: 'npm'
6868

69-
- name: Install dependencies
69+
- name: Setup workspace
7070
env:
7171
HUSKY: 0
7272
REMOTE_MODULES_BASE_PATH: 'https://cdn.rudderlabs.com/v3/modern/plugins'
7373
BUGSNAG_API_KEY: ${{ secrets.RS_PROD_BUGSNAG_API_KEY }}
74+
LOCK_DEPS_VERSION: 'true'
7475
BUGSNAG_RELEASE_STAGE: 'production'
7576
run: |
7677
npm run setup:ci
@@ -79,6 +80,7 @@ jobs:
7980
env:
8081
BUGSNAG_API_KEY: ${{ secrets.RS_PROD_BUGSNAG_API_KEY }}
8182
BUGSNAG_RELEASE_STAGE: 'production'
83+
LOCK_DEPS_VERSION: 'true'
8284
run: |
8385
npm run build:package
8486
npm run build:package:modern
@@ -141,6 +143,16 @@ jobs:
141143
echo "CURRENT_NPM_VERSION_COOKIE_UTILS=${{ env.CURRENT_NPM_VERSION_COOKIE_UTILS }}"
142144
echo "NEW_NPM_VERSION_COOKIE_UTILS=${{ env.NEW_NPM_VERSION_COOKIE_UTILS }}"
143145
146+
- name: Deprecate the legacy SDK NPM package
147+
continue-on-error: true
148+
env:
149+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
150+
NPM_CONFIG_PROVENANCE: true
151+
run: |
152+
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
153+
154+
npm deprecate rudder-sdk-js "This package is deprecated and no longer maintained. Please migrate to the latest package, @rudderstack/analytics-js (https://www.npmjs.com/package/@rudderstack/analytics-js), for the latest features, security updates, and improved performance. For more details, visit the migration guide: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/migration-guide/."
155+
144156
- name: Send message to Slack channel
145157
if: env.CURRENT_NPM_VERSION != env.NEW_NPM_VERSION && env.NEW_NPM_VERSION != 'not found'
146158
id: slack

.github/workflows/deploy-sanity-suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
node-version-file: '.nvmrc'
8282
cache: 'npm'
8383

84-
- name: Install dependencies
84+
- name: Setup workspace
8585
env:
8686
HUSKY: 0
8787
run: |

.github/workflows/deploy.yml

Lines changed: 81 additions & 85 deletions
Large diffs are not rendered by default.

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

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
# Only allow to draft a new release from develop and hotfix branches
1616
if: github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')
1717
uses: ./.github/workflows/validate-actor.yml
18+
with:
19+
team_names: 'js-sdk,integrations'
1820
secrets:
1921
PAT: ${{ secrets.PAT }}
2022

@@ -34,11 +36,11 @@ jobs:
3436
node-version-file: '.nvmrc'
3537
cache: 'npm'
3638

37-
- name: Install dependencies
39+
- name: Setup workspace
3840
env:
3941
HUSKY: 0
4042
run: |
41-
npm run setup:ci
43+
npm run setup:deps
4244
4345
# In order to make a commit, we need to initialize a user.
4446
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
@@ -110,14 +112,22 @@ jobs:
110112
source_branch: ${{ steps.create-release.outputs.branch_name }}
111113
destination_branch: 'main'
112114
github_token: ${{ secrets.PAT }}
113-
pr_title: 'chore(release): pull ${{ steps.create-release.outputs.branch_name }} into main'
115+
pr_title: 'chore(release): merge ${{ steps.create-release.outputs.branch_name }} into main [${{ github.event.inputs.release_ticket_id }}]'
114116
pr_body: |
115-
:crown: *An automated PR*
117+
:crown: **Automated Release PR**
116118
117-
This PR is created automatically by the GitHub Actions workflow to merge the release branch into the main branch.
119+
This pull request was created automatically by the GitHub Actions workflow. It merges the release branch (`${{ steps.create-release.outputs.branch_name }}`) into the `main` branch.
120+
121+
This ensures that the latest release branch changes are incorporated into the `main` branch for production.
122+
123+
### Details
124+
- **Release Version**: v$NEW_VERSION_VALUE
125+
- **Release Branch**: `${{ steps.create-release.outputs.branch_name }}`
126+
- **Related Ticket**: [${{ github.event.inputs.release_ticket_id }}](https://linear.app/rudderstack/issue/${{ github.event.inputs.release_ticket_id }})
127+
128+
---
129+
Please review and merge when ready. :rocket:
118130
119-
Linear Ticket:
120-
https://linear.app/rudderstack/issue/${{ github.event.inputs.release_ticket_id }}
121131
122132
- name: Delete hotfix release base branch
123133
continue-on-error: true

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

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ jobs:
3131
VERSION=${BRANCH_NAME#hotfix-}
3232
VERSION=${VERSION#release/}
3333
34+
# Extract the ticket ID (case-insensitive match for -SDK-<ticket_number>)
35+
RELEASE_TICKET_ID=$(echo "$BRANCH_NAME" | grep -oE '[sS][dD][kK]-[0-9]+')
36+
37+
echo "release_ticket_id=$RELEASE_TICKET_ID" >> $GITHUB_OUTPUT
38+
3439
# Remove the -SDK-<ticket_number> suffix case insensitively
3540
VERSION=$(echo "$VERSION" | awk '{sub(/-[sS][dD][kK]-[0-9]+$/, ""); print}')
3641
@@ -61,11 +66,11 @@ jobs:
6166
node-version-file: '.nvmrc'
6267
cache: 'npm'
6368

64-
- name: Install dependencies
69+
- name: Setup workspace
6570
env:
6671
HUSKY: 0
6772
run: |
68-
npm run setup:ci
73+
npm run setup:deps
6974
7075
- name: Get the two latest versions
7176
run: |
@@ -79,6 +84,7 @@ jobs:
7984
8085
- name: Create GitHub releases
8186
id: create_release
87+
continue-on-error: true
8288
env:
8389
HUSKY: 0
8490
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -96,16 +102,31 @@ jobs:
96102
git checkout -- .nxignore
97103
98104
- name: Create pull request into develop
105+
if: always()
106+
continue-on-error: true
99107
uses: repo-sync/pull-request@v2
100108
with:
101109
source_branch: 'main'
102110
destination_branch: 'develop'
103111
github_token: ${{ secrets.PAT }}
104-
pr_title: 'chore(release): pull main into develop post release v${{ steps.extract-version.outputs.release_version }}'
105-
pr_body: ':crown: *An automated PR*'
112+
pr_title: 'chore(release): merge main into develop after release v${{ steps.extract-version.outputs.release_version }} [${{ steps.extract-version.outputs.release_ticket_id }}]'
113+
pr_body: |
114+
:crown: **Automated Post-Release PR**
115+
116+
This pull request was created automatically by the GitHub Actions workflow. It merges changes from the `main` branch into the `develop` branch after a release has been completed.
117+
118+
This ensures that the `develop` branch stays up to date with all release-related changes from the `main` branch.
119+
120+
### Details
121+
- **Release Version**: v${{ steps.extract-version.outputs.release_version }}
122+
- **Related Ticket**: [${{ steps.extract-version.outputs.release_ticket_id }}](https://linear.app/rudderstack/issue/${{ steps.extract-version.outputs.release_ticket_id }})
123+
124+
---
125+
Please review and merge it before closing the release ticket. :rocket:
106126
107127
- name: Send message to Slack channel
108128
id: slack
129+
if: always()
109130
continue-on-error: true
110131
uses: slackapi/[email protected]
111132
env:

.github/workflows/rollback.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ jobs:
88
# Only allow to be deployed from tags and main branch
99
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main'
1010
uses: ./.github/workflows/validate-actor.yml
11+
with:
12+
team_names: 'js-sdk,integrations'
1113
secrets:
1214
PAT: ${{ secrets.PAT }}
1315

@@ -29,3 +31,44 @@ jobs:
2931
BUGSNAG_API_KEY: ${{ secrets.RS_PROD_BUGSNAG_API_KEY }}
3032
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
3133
SLACK_RELEASE_CHANNEL_ID: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
34+
35+
# As we rollback to a previous version, we need to invalidate the CDN cache for the previous version's directory
36+
# The above deploy action will invalidate the cache for the core SDK artifacts, so this step is needed for dependencies (plugins and integrations)
37+
invalidate-cdn-cache:
38+
needs: deploy
39+
name: Invalidate CDN cache
40+
runs-on: [self-hosted, Linux, X64]
41+
42+
steps:
43+
- name: Install AWS CLI
44+
uses: unfor19/install-aws-cli-action@master
45+
46+
- name: Configure AWS credentials
47+
uses: aws-actions/configure-aws-credentials@v4
48+
with:
49+
role-to-assume: arn:aws:iam::${{ secrets.AWS_PROD_ACCOUNT_ID }}:role/${{ secrets.AWS_PROD_S3_SYNC_ROLE }}
50+
aws-region: us-east-1
51+
52+
- name: Checkout source code
53+
uses: actions/checkout@v4
54+
with:
55+
ref: ${{ github.sha }}
56+
57+
- name: Get new versions
58+
run: |
59+
current_version_v1=$(jq -r .version packages/analytics-v1.1/package.json)
60+
current_version=$(jq -r .version packages/analytics-js/package.json)
61+
echo "CURRENT_VERSION_V1_VALUE=$current_version_v1" >> $GITHUB_ENV
62+
echo "CURRENT_VERSION_VALUE=$current_version" >> $GITHUB_ENV
63+
64+
- name: Invalidate CloudFront cache for all the SDK artifacts (versioned directory)
65+
run: |
66+
invalidation_id=$(AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_PROD_CF_DISTRIBUTION_ID }} --paths "/${{ env.CURRENT_VERSION_VALUE }}/*" --query "Invalidation.Id" --output text)
67+
68+
aws cloudfront wait invalidation-completed --distribution-id ${{ secrets.AWS_PROD_CF_DISTRIBUTION_ID }} --id "$invalidation_id"
69+
70+
- name: Invalidate CloudFront cache for all the legacy SDK artifacts (versioned directory)
71+
run: |
72+
invalidation_id=$(AWS_MAX_ATTEMPTS=10 aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_PROD_CF_DISTRIBUTION_ID }} --paths "/${{ env.CURRENT_VERSION_V1_VALUE }}/*" --query "Invalidation.Id" --output text)
73+
74+
aws cloudfront wait invalidation-completed --distribution-id ${{ secrets.AWS_PROD_CF_DISTRIBUTION_ID }} --id "$invalidation_id"

.github/workflows/security-code-quality-and-bundle-size-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
node-version-file: '.nvmrc'
5555
cache: 'npm'
5656

57-
- name: Install dependencies
57+
- name: Setup workspace
5858
env:
5959
HUSKY: 0
6060
run: |

.github/workflows/trigger-test-suites.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ jobs:
6868
env:
6969
GH_TOKEN: ${{ secrets.PAT }}
7070
run: |
71+
# Sleep for 15 minutes to allow the sanity test suite to complete first
72+
sleep 15m
73+
7174
gh api \
7275
--method POST \
7376
-H "Accept: application/vnd.github+json" \

.github/workflows/unit-tests-and-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
node-version-file: '.nvmrc'
3030
cache: 'npm'
3131

32-
- name: Install dependencies
32+
- name: Setup workspace
3333
env:
3434
HUSKY: 0
3535
run: |

.github/workflows/update-cache-policy.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)