Skip to content

Commit

Permalink
chore: merged develop
Browse files Browse the repository at this point in the history
  • Loading branch information
aanshi07 committed Aug 6, 2024
2 parents 6ae2a35 + 15acf40 commit 154d721
Show file tree
Hide file tree
Showing 106 changed files with 1,703 additions and 789 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/deploy-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}

- name: Get new version number
run: |
Expand Down Expand Up @@ -154,7 +155,7 @@ jobs:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
{
"text": "*New Release: ${{ env.PROJECT_NAME }} - <${{ env.NPM_PACKAGE_URL }}|${{ env.CURRENT_VERSION_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D>",
"text": "*New Release: ${{ env.PROJECT_NAME }} - <${{ env.NPM_PACKAGE_URL }}|${{ env.CURRENT_VERSION_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S07CCQ05F2T>",
"blocks": [
{
"type": "header",
Expand All @@ -170,7 +171,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<${{ env.NPM_PACKAGE_URL }}|v${{ env.CURRENT_VERSION_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D>"
"text": "*<${{ env.NPM_PACKAGE_URL }}|v${{ env.CURRENT_VERSION_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S07CCQ05F2T> <!subteam^S07CCQ05F2T>"
},
"accessory": {
"type": "image",
Expand Down Expand Up @@ -204,7 +205,7 @@ jobs:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
{
"text": "*New Release: ${{ env.PROJECT_NAME }} - <${{ env.NPM_PACKAGE_URL }}|${{ env.CURRENT_VERSION_SW_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D>",
"text": "*New Release: ${{ env.PROJECT_NAME }} - <${{ env.NPM_PACKAGE_URL }}|${{ env.CURRENT_VERSION_SW_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S07CCQ05F2T>",
"blocks": [
{
"type": "header",
Expand All @@ -220,7 +221,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<${{ env.NPM_PACKAGE_URL }}|v${{ env.CURRENT_VERSION_SW_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D>"
"text": "*<${{ env.NPM_PACKAGE_URL }}|v${{ env.CURRENT_VERSION_SW_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S07CCQ05F2T>"
},
"accessory": {
"type": "image",
Expand Down Expand Up @@ -254,7 +255,7 @@ jobs:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
{
"text": "*New Release: ${{ env.PROJECT_NAME }} - <${{ env.NPM_PACKAGE_URL }}|${{ env.CURRENT_VERSION_COOKIE_UTILS_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D>",
"text": "*New Release: ${{ env.PROJECT_NAME }} - <${{ env.NPM_PACKAGE_URL }}|${{ env.CURRENT_VERSION_COOKIE_UTILS_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S07CCQ05F2T>",
"blocks": [
{
"type": "header",
Expand All @@ -270,7 +271,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<${{ env.NPM_PACKAGE_URL }}|v${{ env.CURRENT_VERSION_COOKIE_UTILS_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D>"
"text": "*<${{ env.NPM_PACKAGE_URL }}|v${{ env.CURRENT_VERSION_COOKIE_UTILS_VALUE }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S07CCQ05F2T>"
},
"accessory": {
"type": "image",
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/deploy-sanity-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}

- name: Configure deployment options
id: deployment-options
Expand Down Expand Up @@ -151,7 +153,7 @@ jobs:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
{
"text": "*New Deployment: ${{ env.PROJECT_NAME }} - <${{ env.CDN_URL }}|${{ env.LINK_TEXT }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D>",
"text": "*New Deployment: ${{ env.PROJECT_NAME }} - <${{ env.CDN_URL }}|${{ env.LINK_TEXT }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S07CCQ05F2T>",
"blocks": [
{
"type": "header",
Expand All @@ -167,7 +169,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<${{ env.CDN_URL }}|${{ env.LINK_TEXT }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D>"
"text": "*<${{ env.CDN_URL }}|${{ env.LINK_TEXT }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S07CCQ05F2T>"
},
"accessory": {
"type": "image",
Expand Down
20 changes: 18 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ on:
type: string
required: false
default: ''
use_pr_head_sha:
type: string
default: 'false'
secrets:
AWS_ACCOUNT_ID:
required: true
Expand Down Expand Up @@ -63,8 +66,21 @@ jobs:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_S3_SYNC_ROLE }}
aws-region: us-east-1

- name: Determine checkout SHA
id: getSHA
run: |
if ${{ inputs.use_pr_head_sha }} == 'true'; then
sha=$(echo ${{ github.event.pull_request.head.sha }})
else
sha=$(echo ${{ github.sha }})
fi
echo "Checkout SHA: $sha"
echo "SHA=$sha" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ steps.getSHA.outputs.SHA }}

- name: Get new version number
run: |
Expand Down Expand Up @@ -183,7 +199,7 @@ jobs:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
{
"text": "*New Release: ${{ env.PROJECT_NAME }} - <${{ env.CDN_URL }}|${{ env.LINK_TEXT }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D>",
"text": "*New Release: ${{ env.PROJECT_NAME }} - <${{ env.CDN_URL }}|${{ env.LINK_TEXT }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S07CCQ05F2T>",
"blocks": [
{
"type": "header",
Expand All @@ -199,7 +215,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<${{ env.CDN_URL }}|${{ env.LINK_TEXT }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D>"
"text": "*<${{ env.CDN_URL }}|${{ env.LINK_TEXT }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S07CCQ05F2T>"
},
"accessory": {
"type": "image",
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/draft-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Draft a new release

on:
workflow_dispatch:
inputs:
release_ticket_id:
description: Release ticket ID (Ex:- SDK-1234)
required: true

env:
NODE_OPTIONS: '--no-warnings'
Expand Down Expand Up @@ -54,7 +58,7 @@ jobs:
new_version=$(jq -r .version package.json)
git reset --hard
branch_name="${release_type}/${new_version}"
branch_name="${release_type}/${new_version}-${{ github.event.inputs.release_ticket_id }}"
echo "Source branch for new release is $source_branch_name"
echo "Current version is $current_version"
Expand All @@ -74,6 +78,7 @@ jobs:
id: finish-release
env:
HUSKY: 0
BASE_BRANCH: ${{ steps.create-release.outputs.branch_name }}
run: |
echo "Current version: $CURRENT_VERSION_VALUE"
echo "New version: $NEW_VERSION_VALUE"
Expand All @@ -83,6 +88,7 @@ jobs:
./scripts/generate-last-release-changelog.sh
npm run bump-version:monorepo
npx replace $CURRENT_VERSION_VALUE $NEW_VERSION_VALUE sonar-project.properties
npm install
npm run clean
git add .
git commit -m "chore(monorepo): sync versions and generate release logs" -n
Expand All @@ -98,7 +104,13 @@ jobs:
destination_branch: 'main'
github_token: ${{ secrets.PAT }}
pr_title: 'chore(release): pull ${{ steps.create-release.outputs.branch_name }} into main'
pr_body: ':crown: *An automated PR*'
pr_body: |
:crown: *An automated PR*
This PR is created automatically by the GitHub Actions workflow to merge the release branch into the main branch.
Linear Ticket:
https://linear.app/rudderstack/issue/${{ github.event.inputs.release_ticket_id }}
- name: Delete hotfix release base branch
continue-on-error: true
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/publish-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,17 @@ jobs:
BRANCH_NAME="${BRANCH_NAME_REF}"
VERSION=${BRANCH_NAME#hotfix-}
VERSION=${VERSION#release/}
# Remove the -SDK-<ticket_number> suffix case insensitively
VERSION=$(echo "$VERSION" | awk '{sub(/-[sS][dD][kK]-[0-9]+$/, ""); print}')
echo "release_version=$VERSION" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}

# In order to make a commit, we need to initialize a user.
# You may choose to write something less generic here if you want, it doesn't matter functionality wise.
Expand Down Expand Up @@ -112,7 +117,7 @@ jobs:
channel-id: ${{ secrets.SLACK_RELEASE_CHANNEL_ID }}
payload: |
{
"text": "*New Release: ${{ env.PROJECT_NAME }} - <${{ env.TAG_COMPARE_URL }}${{ env.last_monorepo_version }}...v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D>",
"text": "*New Release: ${{ env.PROJECT_NAME }} - <${{ env.TAG_COMPARE_URL }}${{ env.last_monorepo_version }}...v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S07CCQ05F2T>",
"blocks": [
{
"type": "header",
Expand All @@ -128,7 +133,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*<${{ env.TAG_COMPARE_URL }}${{ env.last_monorepo_version }}...v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D>"
"text": "*<${{ env.TAG_COMPARE_URL }}${{ env.last_monorepo_version }}...v${{ steps.extract-version.outputs.release_version }}|v${{ steps.extract-version.outputs.release_version }}>*\n${{ env.DATE }}\nCC: <!subteam^S0555JBV36D> <!subteam^S07CCQ05F2T>"
},
"accessory": {
"type": "image",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Node
uses: actions/setup-node@v4
Expand Down Expand Up @@ -43,6 +45,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Node
uses: actions/setup-node@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unit-tests-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup Node
uses: actions/setup-node@v4
Expand Down
3 changes: 2 additions & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
* @rudderlabs/js-sdk
/packages/analytics-js-integrations/ @ItsSudip @shrouti1507 @sandeepdsvs @koladilip @mihir-4116
/packages/analytics-js-integrations/ @rudderlabs/js-sdk-dm-intg-eng
/packages/analytics-js-common/src/constants/integrations @rudderlabs/js-sdk-dm-intg-eng
32 changes: 1 addition & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,7 @@ The JavaScript SDK lets you track customer event data from your website and send

### Using CDN

To integrate the JavaScript SDK with your website, place the following code snippet in the `<head>` section of your website.

```javascript
<script type="text/javascript">
!function(){"use strict";window.RudderSnippetVersion="3.0.10";var e="rudderanalytics";window[e]||(window[e]=[])
;var t=window[e];if(Array.isArray(t)){if(true===t.snippetExecuted&&window.console&&console.error){
console.error("RudderStack JavaScript SDK snippet included more than once.")}else{t.snippetExecuted=true,
window.rudderAnalyticsBuildType="legacy";var sdkBaseUrl="https://cdn.rudderlabs.com/v3";var sdkName="rsa.min.js"
;var r="async"
;var n=["setDefaultInstanceKey","load","ready","page","track","identify","alias","group","reset","setAnonymousId","startSession","endSession","consent"]
;for(var i=0;i<n.length;i++){var d=n[i];t[d]=function(r){return function(){var n
;Array.isArray(window[e])?t.push([r].concat(Array.prototype.slice.call(arguments))):null===(n=window[e][r])||void 0===n||n.apply(window[e],arguments)
}}(d)}try{new Function('return import("")'),window.rudderAnalyticsBuildType="modern"}catch(c){}
var o=document.head||document.getElementsByTagName("head")[0]
;var a=document.body||document.getElementsByTagName("body")[0];window.rudderAnalyticsAddScript=function(e,t,n){
var i=document.createElement("script");i.src=e,i.setAttribute("data-loader","RS_JS_SDK"),t&&n&&i.setAttribute(t,n),
"async"===r?i.async=true:"defer"===r&&(i.defer=true),o?o.insertBefore(i,o.firstChild):a.insertBefore(i,a.firstChild)},
window.rudderAnalyticsMount=function(){
"undefined"==typeof globalThis&&(Object.defineProperty(Object.prototype,"__globalThis_magic__",{get:function get(){
return this},configurable:true}),__globalThis_magic__.globalThis=__globalThis_magic__,
delete Object.prototype.__globalThis_magic__),
window.rudderAnalyticsAddScript("".concat(sdkBaseUrl,"/").concat(window.rudderAnalyticsBuildType,"/").concat(sdkName),"data-rsa-write-key",<WRITE_KEY>)
},
"undefined"==typeof Promise||"undefined"==typeof globalThis?window.rudderAnalyticsAddScript("https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Symbol%2CPromise&callback=rudderAnalyticsMount"):window.rudderAnalyticsMount()
;t.load(<WRITE_KEY>,<DATA_PLANE_URL>,{})}}}();
</script>
```

<br>

> The above snippet lets you integrate the SDK with your website and load it asynchronously to avoid impacting the performance of your webpages.
See [CDN installation](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/quickstart/#using-cdn) for detailed steps.

To load SDK script on to your page synchronously, see the [**JavaScript SDK documentation**](https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/installation/#synchronous-loading).

Expand Down
22 changes: 11 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 154d721

Please sign in to comment.