Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adrienne / Integrate Hydra authentication #821

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
753bb65
feat: added analytics to smarttrader
adrienne-deriv Sep 24, 2024
de69d69
feat: added auth-client library
adrienne-deriv Sep 24, 2024
be1724f
chore: generate test link
adrienne-deriv Sep 24, 2024
d28a2d8
chore: generate test link
adrienne-deriv Sep 24, 2024
893884d
chore: resolved eslint issues
adrienne-deriv Sep 24, 2024
5dee70e
chore: fixed issue with deriv analytics being part of mocha test
adrienne-deriv Sep 24, 2024
b05de9c
chore: skip tests to generate a test link temporarily
adrienne-deriv Sep 24, 2024
157fa60
chore: skip tests to generate a test link temporarily
adrienne-deriv Sep 24, 2024
fbe651f
chore: finally fixed test cases :)
adrienne-deriv Sep 25, 2024
690317d
chore: reverted prettier formatting
adrienne-deriv Sep 26, 2024
36bfba6
minor: added environment variables for analytics to github actions wo…
adrienne-deriv Sep 26, 2024
5a90f66
chore: used curly braces for secrets and envs in workflow
adrienne-deriv Sep 26, 2024
2601575
chore: used curly braces for secrets and envs in workflow
adrienne-deriv Sep 26, 2024
1105aa0
chore: resolved pr comments
adrienne-deriv Sep 30, 2024
10202f8
adrienne-deriv Oct 3, 2024
4e9ade8
Merge branch 'master' of github.com:deriv-com/smarttrader into setup-…
adrienne-deriv Oct 3, 2024
4286a60
chore: removed unrelated changes to workflow
adrienne-deriv Oct 3, 2024
bad20f6
chore: removed unrelated changes to workflow
adrienne-deriv Oct 3, 2024
b339eda
Merge branch 'setup-hydra-feature' of github.com:adrienne-deriv/smart…
adrienne-deriv Oct 3, 2024
b3df698
chore: add new line to regenerate test link
adrienne-deriv Oct 3, 2024
7c03bb1
chore: add new line to regenerate test link
adrienne-deriv Oct 3, 2024
0deec9e
chore: removed decryption key
adrienne-deriv Oct 3, 2024
4a93343
chore: removed decryption key
adrienne-deriv Oct 3, 2024
03d6000
Merge branch 'setup-hydra-feature' of github.com:adrienne-deriv/smart…
adrienne-deriv Oct 3, 2024
3b5332b
chore: update package-lock and default app id fallback
adrienne-deriv Oct 16, 2024
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
12 changes: 12 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,23 @@ inputs:
description: "Target Environment"
required: true
default: staging
RUDDERSTACK_KEY:
description: "Rudderstack key for initialising analytics"
required: false
GROWTHBOOK_DECRYPTION_KEY:
description: "Growthbook decryption key for initialising analytics"
required: false
GROWTHBOOK_CLIENT_KEY:
description: "Growthbook client key for initialising analytics"
required: false
runs:
using: composite
steps:
- name: Building dist for ${{ inputs.target }}
env:
TARGET_ENV: ${{ inputs.target }}
RUDDERSTACK_KEY: ${{ inputs.RUDDERSTACK_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ inputs.GROWTHBOOK_DECRYPTION_KEY }}
GROWTHBOOK_CLIENT_KEY: ${{ inputs.GROWTHBOOK_CLIENT_KEY }}
run: node_modules/grunt/bin/grunt releaseci --$TARGET_ENV
shell: bash
7 changes: 7 additions & 0 deletions .github/workflows/generate_preview_link.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ concurrency:
jobs:
build_and_deploy_preview_link:
runs-on: Ubuntu-latest
environment: Staging
permissions:
checks: write
pull-requests: write
Expand Down Expand Up @@ -48,11 +49,17 @@ jobs:
uses: "./.github/actions/build"
with:
target: staging
RUDDERSTACK_KEY: ${{ vars.RUDDERSTACK_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GROWTHBOOK_DECRYPTION_KEY }}
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}

- name: Build Translations
uses: "./.github/actions/build"
with:
target: translations
RUDDERSTACK_KEY: ${{ vars.RUDDERSTACK_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GROWTHBOOK_DECRYPTION_KEY }}
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}

- name: "Run Tests"
run: npm run test
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release_production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
environment: Production
env:
RELEASE_TYPE: Production
steps:
Expand All @@ -22,6 +23,9 @@ jobs:
uses: "./.github/actions/build"
with:
target: production
RUDDERSTACK_KEY: ${{ vars.RUDDERSTACK_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GROWTHBOOK_DECRYPTION_KEY }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Q] why is this on secrets but client key is on vars?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Rudderstack and Growthbook client keys are public, you can see them on the network requests and window._growthbook instances, but only the decryption keys are private

GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}
- name: Versioning
uses: "./.github/actions/versioning"
with:
Expand All @@ -35,6 +39,7 @@ jobs:
path: dist
publish_cloudflare_production:
name: Publish to Cloudflare Production
environment: Production
runs-on: ubuntu-latest
env:
RELEASE_TYPE: Production
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/release_staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
jobs:
build_and_test:
name: Build and Test
environment: Staging
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -20,10 +21,16 @@ jobs:
uses: "./.github/actions/build"
with:
target: staging
RUDDERSTACK_KEY: ${{ vars.RUDDERSTACK_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GROWTHBOOK_DECRYPTION_KEY }}
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}
- name: Build Translations
uses: "./.github/actions/build"
with:
target: translations
RUDDERSTACK_KEY: ${{ vars.RUDDERSTACK_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GROWTHBOOK_DECRYPTION_KEY }}
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}
- name: Versioning
uses: "./.github/actions/versioning"
with:
Expand All @@ -36,6 +43,7 @@ jobs:
path: dist
publish_cloudflare_staging:
name: Publish to Cloudflare Pages Staging
environment: Staging
runs-on: ubuntu-latest
needs: [build_and_test]
steps:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand All @@ -20,5 +21,8 @@ jobs:
uses: "./.github/actions/build"
with:
target: production
RUDDERSTACK_KEY: ${{ vars.RUDDERSTACK_KEY }}
GROWTHBOOK_DECRYPTION_KEY: ${{ secrets.GROWTHBOOK_DECRYPTION_KEY }}
GROWTHBOOK_CLIENT_KEY: ${{ vars.GROWTHBOOK_CLIENT_KEY }}
- name: "Run Tests"
run: npm run test
12 changes: 9 additions & 3 deletions build/webpack/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@ const getPlugins = (app, grunt) => ([

new webpack.DefinePlugin({
'process.env': {
BUILD_HASH: JSON.stringify(CryptoJS.MD5(Date.now().toString()).toString()),
NODE_ENV : JSON.stringify('production'),
BUILD_HASH : JSON.stringify(CryptoJS.MD5(Date.now().toString()).toString()),
NODE_ENV : JSON.stringify('production'),
GROWTHBOOK_CLIENT_KEY : JSON.stringify(process.env.GROWTHBOOK_CLIENT_KEY),
GROWTHBOOK_DECRYPTION_KEY: JSON.stringify(process.env.GROWTHBOOK_DECRYPTION_KEY),
RUDDERSTACK_KEY : JSON.stringify(process.env.RUDDERSTACK_KEY),
},
}),
]
Expand All @@ -68,7 +71,10 @@ const getPlugins = (app, grunt) => ([
]),
new webpack.DefinePlugin({
'process.env': {
BUILD_HASH: JSON.stringify(CryptoJS.MD5(Date.now().toString()).toString()),
BUILD_HASH : JSON.stringify(CryptoJS.MD5(Date.now().toString()).toString()),
GROWTHBOOK_CLIENT_KEY : JSON.stringify(process.env.GROWTHBOOK_CLIENT_KEY),
GROWTHBOOK_DECRYPTION_KEY: JSON.stringify(process.env.GROWTHBOOK_DECRYPTION_KEY),
RUDDERSTACK_KEY : JSON.stringify(process.env.RUDDERSTACK_KEY),
},
}),
]
Expand Down
Loading
Loading