Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/deploy-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ jobs:
trigger_source: ${{ needs.get-deploy-inputs.outputs.trigger_source }}
secrets:
RS_PROD_BUGSNAG_API_KEY: ${{ secrets.RS_PROD_BUGSNAG_API_KEY }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_RELEASE_CHANNEL_ID: ${{ secrets.SLACK_RELEASE_CHANNEL_ID_NON_PROD }}

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/deploy-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ on:
secrets:
RS_PROD_BUGSNAG_API_KEY:
required: true
NPM_TOKEN:
required: true
SLACK_BOT_TOKEN:
required: true
SLACK_RELEASE_CHANNEL_ID:
Expand Down Expand Up @@ -156,12 +158,14 @@ jobs:
- name: Publish package to NPM
env:
HUSKY: 0
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
run: |
# Remove unnecessary fields from package.json before publishing
./scripts/make-package-json-publish-ready.sh

npx nx release publish --base=${{ env.last_monorepo_version }} --head=${{ env.current_monorepo_version }} ${{ inputs.environment == 'beta' && '--tag=beta' || '' }}
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npx nx release publish --verbose --base=${{ env.last_monorepo_version }} --head=${{ env.current_monorepo_version }} ${{ inputs.environment == 'beta' && '--tag=beta' || '' }}

# Reset the changes made to package.json
git reset --hard
Expand Down Expand Up @@ -202,8 +206,10 @@ jobs:
- name: Deprecate the legacy SDK NPM package
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
run: |
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}

npm deprecate rudder-sdk-js "This package is deprecated and no longer maintained. While your events are still being tracked and delivered, we strongly recommend you to 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/."

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ jobs:
monorepo_release_version: ${{ needs.get-release-inputs.outputs.release_version }}
release_ticket_id: ${{ needs.get-release-inputs.outputs.release_ticket_id }}
secrets:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
RS_PROD_BUGSNAG_API_KEY: ${{ secrets.RS_PROD_BUGSNAG_API_KEY }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
SLACK_RELEASE_CHANNEL_ID: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
2 changes: 2 additions & 0 deletions .github/workflows/rollback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,14 @@ jobs:
- name: Deprecate the rolled back NPM version
continue-on-error: true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
run: |
VERSION_TO_DEPRECATE="${{ env.CURRENT_VERSION_VALUE }}"
echo "Deprecating NPM version: $VERSION_TO_DEPRECATE"

# Deprecate the specified version with a message
npm set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm deprecate "@rudderstack/analytics-js@$VERSION_TO_DEPRECATE" "We've identified issues with this version of the package. Please switch to v${{ env.ROLLBACK_VERSION_VALUE }} or the latest version if available."
Comment thread
saikumarrs marked this conversation as resolved.

# Note: The legacy SDK is not deprecated as it is deprecated by default with every release.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ describe('XhrQueue', () => {
attemptNumber: 1,
lastAttemptedAt: expect.any(Number),
firstAttemptedAt: expect.any(Number),
reclaimed: undefined,
id: 'sample_uuid',
time: 1 + 1000 * 2 ** 1, // this is the delay calculation in RetryQueue
type: 'Single',
Expand Down Expand Up @@ -391,6 +392,7 @@ describe('XhrQueue', () => {
event: mergeDeepRight(event, { sentAt: 'sample_timestamp' }),
},
attemptNumber: 1,
reclaimed: undefined,
lastAttemptedAt: expect.any(Number),
firstAttemptedAt: expect.any(Number),
id: 'sample_uuid',
Expand Down Expand Up @@ -498,6 +500,7 @@ describe('XhrQueue', () => {
event: mergeDeepRight(event, { sentAt: 'sample_timestamp' }),
},
attemptNumber: 1,
reclaimed: undefined,
lastAttemptedAt: expect.any(Number),
firstAttemptedAt: expect.any(Number),
id: 'sample_uuid',
Expand Down
4 changes: 3 additions & 1 deletion packages/analytics-js-plugins/src/xhrQueue/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
isErrRetryable,
isUndefined,
LOCAL_STORAGE,
MEMORY_STORAGE,
toBase64,
validateEventPayloadSize,
} from '../shared-chunks/common';
Expand Down Expand Up @@ -124,7 +125,8 @@ const XhrQueue = (): ExtensionPlugin => ({
});
},
storeManager,
LOCAL_STORAGE,
// If local storage is available, use it, else use memory storage
state.capabilities.storage.isLocalStorageAvailable.value ? LOCAL_STORAGE : MEMORY_STORAGE,
logger,
(itemData: XHRQueueItemData[]): number => {
const currentTime = getCurrentTimeFormatted();
Expand Down
Loading