Skip to content
Merged
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
115 changes: 91 additions & 24 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,134 @@ on:
branches:
- '*'

concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.run_number || github.event.pull_request.number }}
cancel-in-progress: true

permissions:
contents: read
id-token: write

jobs:
build:
name: Build
runs-on: ubuntu-latest
# @TODO rollback to ubuntu-latest eventually. ATM, `npm run test-browser` fails when using ubuntu-latest (ubuntu-22.04) with "ERROR [launcher]: Cannot start ChromeHeadless"
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up nodejs
uses: actions/setup-node@v2
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
node-version: '16.16.0'
cache: 'npm'

- name: npm CI
- name: npm ci
run: npm ci

- name: npm ts tests
- name: npm test-ts-decls
run: npm run test-ts-decls

- name: npm Check
- name: npm check
run: npm run check

- name: npm Test
- name: npm test
run: npm run test

- name: npm Build
- name: npm build
run: BUILD_BRANCH=$(echo "${GITHUB_REF#refs/heads/}") BUILD_COMMIT=${{ github.sha }} npm run build

- name: Configure AWS credentials (development)
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
uses: aws-actions/configure-aws-credentials@v1
- name: Store assets
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/development' || github.ref == 'refs/heads/main') }}
uses: actions/upload-artifact@v3
with:
role-to-assume: arn:aws:iam::079419646996:role/public-assets
name: assets
path: umd/
retention-days: 1

upload-stage:
name: Upload assets
runs-on: ubuntu-20.04
needs: build
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
strategy:
matrix:
environment:
- stage
- stage-eu
include:
- environment: stage
account_id: "079419646996"
bucket: split-public-stage
- environment: stage-eu
account_id: "901851837056"
bucket: split-public-stage-eu-west-1

steps:
- name: Download assets
uses: actions/download-artifact@v3
with:
name: assets
path: umd

- name: Display structure of assets
run: ls -R
working-directory: umd

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role
aws-region: us-east-1

- name: Upload to S3 (development)
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development' }}
- name: Upload to S3
run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS
env:
BUCKET: split-public-stage
BUCKET: ${{ matrix.bucket }}
SOURCE_DIR: ./umd
DEST_DIR: sdk
ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public

- name: Configure AWS credentials (main)
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
uses: aws-actions/configure-aws-credentials@v1
upload-prod:
name: Upload assets
runs-on: ubuntu-20.04
needs: build
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
strategy:
matrix:
environment:
- prod
- prod-eu
include:
- environment: prod
account_id: "825951051969"
bucket: split-public
- environment: prod-eu
account_id: "842946900133"
bucket: split-public-eu-west-1

steps:
- name: Download assets
uses: actions/download-artifact@v3
with:
name: assets
path: umd

- name: Display structure of assets
run: ls -R
working-directory: umd

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: arn:aws:iam::825951051969:role/public-assets
role-to-assume: arn:aws:iam::${{ matrix.account_id }}:role/gha-public-assets-role
aws-region: us-east-1

- name: Upload to S3 (main)
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
- name: Upload to S3
run: aws s3 sync $SOURCE_DIR s3://$BUCKET/$DEST_DIR $ARGS
env:
BUCKET: split-public
BUCKET: ${{ matrix.bucket }}
SOURCE_DIR: ./umd
DEST_DIR: sdk
ARGS: --acl public-read --follow-symlinks --cache-control max-age=31536000,public
4 changes: 2 additions & 2 deletions .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -22,7 +22,7 @@ jobs:
- name: Set up nodejs
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16.16.0'
cache: 'npm'

- name: npm CI
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-license-year.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:

jobs:
test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14
v16.16.0
28 changes: 16 additions & 12 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
0.9.2 (December 16, 2022)
- Updated some transitive dependencies for vulnerability fixes.
- Bugfixing - Upgrade @splitsoftware/splitio-commons package to version 1.7.3 which includes a memory leak fix for localhost mode (Related to issue https://github.com/splitio/javascript-commons/issues/181) among other improvements.

0.9.1 (October 14, 2022)
- Bugfixing - Upgrade @splitsoftware/splitio-commons package to version 1.7.2, that handles `Navigator.sendBeacon` API exceptions in the browser, and fallback to regular Fetch/XHR transport in case of error.
- Bugfixing - Upgrade @splitsoftware/splitio-commons package to version 1.7.2, that handles `Navigator.sendBeacon` API exceptions in the browser, and fallback to regular Fetch/XHR transport in case of error.

0.9.0 (October 5, 2022)
- Added a new impressions mode for the SDK called NONE, to be used in factory when there is no desire to capture impressions on an SDK factory to feed Split's analytics engine. Running NONE mode, the SDK will only capture unique keys evaluated for a particular feature flag instead of full blown impressions.
- Updated default value of `scheduler.featuresRefreshRate` config parameter from 30 seconds to 60 seconds.
- Updated @splitsoftware/splitio-commons package to version 1.7.1, that improves the performance of split evaluations (i.e., `getTreatment(s)` method calls) when using the default storage in memory, among other improvements.
- Added a new impressions mode for the SDK called NONE, to be used in factory when there is no desire to capture impressions on an SDK factory to feed Split's analytics engine. Running NONE mode, the SDK will only capture unique keys evaluated for a particular feature flag instead of full blown impressions.
- Updated default value of `scheduler.featuresRefreshRate` config parameter from 30 seconds to 60 seconds.
- Updated @splitsoftware/splitio-commons package to version 1.7.1, that improves the performance of split evaluations (i.e., `getTreatment(s)` method calls) when using the default storage in memory, among other improvements.

0.8.0 (July 22, 2022)
- Added `autoRequire` configuration option to the Google Analytics to Split integration, which takes care of requiring the splitTracker plugin on trackers dynamically created by Google tag managers (See https://help.split.io/hc/en-us/articles/360040838752#set-up-with-gtm-and-gtag.js).
- Updated browser listener to push remaining impressions and events on 'visibilitychange' and 'pagehide' DOM events, instead of 'unload', which is not reliable in modern mobile and desktop Web browsers.
- Updated the synchronization flow to be more reliable in the event of an edge case generating delay in cache purge propagation, keeping the SDK cache properly synced.
- Updated some dependencies for vulnerability fixes.
- Added `autoRequire` configuration option to the Google Analytics to Split integration, which takes care of requiring the splitTracker plugin on trackers dynamically created by Google tag managers (See https://help.split.io/hc/en-us/articles/360040838752#set-up-with-gtm-and-gtag.js).
- Updated browser listener to push remaining impressions and events on 'visibilitychange' and 'pagehide' DOM events, instead of 'unload', which is not reliable in modern mobile and desktop Web browsers.
- Updated the synchronization flow to be more reliable in the event of an edge case generating delay in cache purge propagation, keeping the SDK cache properly synced.
- Updated some dependencies for vulnerability fixes.

0.7.0 (June 29, 2022)
- Added a new config option to control the tasks that listen or poll for updates on feature flags and segments, via the new config sync.enabled . Running online Split will always pull the most recent updates upon initialization, this only affects updates fetching on a running instance. Useful when a consistent session experience is a must or to save resources when updates are not being used.
- Updated telemetry logic to track the anonymous config for user consent flag set to declined or unknown.
- Updated submitters logic, to avoid duplicating the post of impressions to Split cloud when the SDK is destroyed while its periodic post of impressions is running.
- Bugfixing - Updated submitters logic, to avoid dropping impressions and events that are being tracked while POST request is pending.
- Added a new config option to control the tasks that listen or poll for updates on feature flags and segments, via the new config sync.enabled . Running online Split will always pull the most recent updates upon initialization, this only affects updates fetching on a running instance. Useful when a consistent session experience is a must or to save resources when updates are not being used.
- Updated telemetry logic to track the anonymous config for user consent flag set to declined or unknown.
- Updated submitters logic, to avoid duplicating the post of impressions to Split cloud when the SDK is destroyed while its periodic post of impressions is running.
- Bugfixing - Updated submitters logic, to avoid dropping impressions and events that are being tracked while POST request is pending.

0.6.0 (May 24, 2022)
- Added `scheduler.telemetryRefreshRate` property to SDK configuration.
Expand Down
Loading