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

chore: update sentry latest and config #1

Merged
merged 13 commits into from
Jun 27, 2023
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
29 changes: 29 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: UAT deployment
on:
push:
branches: ['dev']

jobs:
build-and-deploy:
uses: AstraProtocol/github-actions-workflows/.github/workflows/stella-deployment.yml@main
with:
ingressEnabled: "yes"
ingressHost: "defi.dev.astranet.services"
replicas: "1"
servicePort: "3000"
buildArgs: |-
NEXT_PUBLIC_CHAIN_ID=11115
NEXT_PUBLIC_NODE_1=https://rpc.astranaut.dev
NEXT_PUBLIC_NODE_2=https://rpc.astranaut.dev
NEXT_PUBLIC_NODE_3=https://rpc.astranaut.dev
NEXT_PUBLIC_NODE_PRODUCTION=https://rpc.astranaut.dev
NEXT_PUBLIC_HOST=https://defi.astranaut.dev
NEXT_PUBLIC_EXPLORER=http://explorer.astranaut.dev
NEXT_PUBLIC_GTAG=''
NEXT_PUBLIC_FEE=20
NEXT_PUBLIC_TITLE=SolarSwap
NEXT_PUBLIC_WALLET_CONNECT_RELAY=wc-relay.astranaut.dev
NEXT_PUBLIC_SENTRY_DSN=https://204e8402a7684195a50ee186a5fec8d8@sentry.astranet.live/6
NEXT_PUBLIC_SENTRY_ENVIRONMENT=testnet
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
GITHUB_TOKEN=${{ secrets.GH_AUTH_TOKEN }}
21 changes: 11 additions & 10 deletions .github/workflows/integrationTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Integration Tests

on:
pull_request:
branches:
- dev
- main
push:
branches:
- dev
Expand All @@ -21,10 +18,11 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 18.x
registry-url: 'https://npm.pkg.github.com'
scope: '@astraprotocol'
token: ${{ secrets.PAT_ASTRAPROTOCOL }}
token: ${{ secrets.GH_AUTH_TOKEN }}
# token: ${{ secrets.PAT_ASTRAPROTOCOL }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand All @@ -38,12 +36,14 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup npm token
run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.PAT_ASTRAPROTOCOL}}"
run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.GH_AUTH_TOKEN}}"
# run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.PAT_ASTRAPROTOCOL}}"

- name: Cypress install
run: yarn install --frozen-lockfile
env:
NODE_AUTH_TOKEN: ${{ secrets.PAT_ASTRAPROTOCOL }}
NODE_AUTH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}
# NODE_AUTH_TOKEN: ${{ secrets.PAT_ASTRAPROTOCOL }}
- name: make env
uses: canastro/copy-file-action@master
with:
Expand All @@ -53,11 +53,12 @@ jobs:
- uses: cypress-io/github-action@v5.0.7 # use the explicit version number
with:
build: npm run build
start: npm start
record: true
start: npm run start
record: false
wait-on: 'http://localhost:3000'
env:
# pass the Cypress Cloud record key as an environment variable
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# Recommended: pass the GitHub token lets this action correctly
# determine the unique run id necessary to re-run the checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_AUTH_TOKEN }}
10 changes: 6 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: true
matrix:
node: [14]
node: [18]

name: Lint

Expand All @@ -24,10 +24,11 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 18.x
registry-url: 'https://npm.pkg.github.com'
scope: '@astraprotocol'
token: ${{ secrets.PAT_ASTRAPROTOCOL }}
token: ${{ secrets.GH_AUTH_TOKEN }}
# token: ${{ secrets.PAT_ASTRAPROTOCOL }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand All @@ -42,7 +43,8 @@ jobs:
${{ runner.os }}-yarn-

- name: Setup npm token
run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.PAT_ASTRAPROTOCOL}}"
run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.GH_AUTH_TOKEN}}"
# run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.PAT_ASTRAPROTOCOL}}"

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Production deployment
on:
push:
tags:
- '**' #

jobs:
build-and-deploy:
uses: AstraProtocol/github-actions-workflows/.github/workflows/stella-deployment.yml@main
with:
ingressEnabled: "yes"
ingressHost: "defi.prod.astranet.services"
replicas: "1"
servicePort: "3000"
buildArgs: |-
NEXT_PUBLIC_CHAIN_ID=11110
NEXT_PUBLIC_NODE_1=https://rpc.astranaut.io
NEXT_PUBLIC_NODE_2=https://rpc.astranaut.io
NEXT_PUBLIC_NODE_3=https://rpc.astranaut.io
NEXT_PUBLIC_NODE_PRODUCTION=https://rpc.astranaut.io
NEXT_PUBLIC_HOST=https://solarswap.io
NEXT_PUBLIC_EXPLORER=http://explorer.astranaut.io
NEXT_PUBLIC_GTAG='G-MK9VVY7GT5'
NEXT_PUBLIC_FEE=20
NEXT_PUBLIC_TITLE=SolarSwap
NEXT_PUBLIC_WALLET_CONNECT_RELAY=wc-relay.astranaut.io
NEXT_PUBLIC_SENTRY_DSN=https://204e8402a7684195a50ee186a5fec8d8@sentry.astranet.live/6
NEXT_PUBLIC_SENTRY_ENVIRONMENT=mainnet
SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
GITHUB_TOKEN=${{ secrets.GH_AUTH_TOKEN }}
10 changes: 6 additions & 4 deletions .github/workflows/testConfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: true
matrix:
node: [14]
node: [18]

name: Config (Jest)

Expand All @@ -26,10 +26,11 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 18.x
registry-url: 'https://npm.pkg.github.com'
scope: '@astraprotocol'
token: ${{ secrets.PAT_ASTRAPROTOCOL }}
token: ${{ secrets.GH_AUTH_TOKEN }}
# token: ${{ secrets.PAT_ASTRAPROTOCOL }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand All @@ -43,7 +44,8 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Setup npm token
run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.PAT_ASTRAPROTOCOL}}"
run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.GH_AUTH_TOKEN}}"
# run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.PAT_ASTRAPROTOCOL}}"

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/unitTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: true
matrix:
node: [14]
node: [18]

name: Unit tests (Jest)

Expand All @@ -24,10 +24,11 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 16.x
node-version: 18.x
registry-url: 'https://npm.pkg.github.com'
scope: '@astraprotocol'
token: ${{ secrets.PAT_ASTRAPROTOCOL }}
token: ${{ secrets.GH_AUTH_TOKEN }}
# token: ${{ secrets.PAT_ASTRAPROTOCOL }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
Expand All @@ -42,7 +43,8 @@ jobs:
${{ runner.os }}-yarn-

- name: Setup npm token
run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.PAT_ASTRAPROTOCOL}}"
run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.GH_AUTH_TOKEN}}"
# run: npm config set '//npm.pkg.github.com/:_authToken' "${{secrets.PAT_ASTRAPROTOCOL}}"

- name: Install dependencies
run: yarn install --frozen-lockfile
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ types
astraprotocol-astra-ui-*.tgz
package-lock.json
package
.next
.next
# Sentry Auth Token
.sentryclirc
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN GITHUB_PACKAGE_TOKEN=${GITHUB_TOKEN} yarn --frozen-lockfile
FROM node:18-alpine AS builder
WORKDIR /app

ARG ASTRA_SENTRY_AUTH_TOKEN
ARG SENTRY_AUTH_TOKEN
ARG NEXT_PUBLIC_CHAIN_ID
ARG NEXT_PUBLIC_NODE_1
ARG NEXT_PUBLIC_NODE_2
Expand All @@ -37,7 +37,7 @@ ARG NEXT_PUBLIC_SENTRY_DSN
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/src ./src
COPY . .
RUN ASTRA_SENTRY_AUTH_TOKEN=${ASTRA_SENTRY_AUTH_TOKEN} \
RUN SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN} \
NEXT_PUBLIC_CHAIN_ID=${NEXT_PUBLIC_CHAIN_ID} \
NEXT_PUBLIC_NODE_1=${NEXT_PUBLIC_NODE_1} \
NEXT_PUBLIC_NODE_2=${NEXT_PUBLIC_NODE_2} \
Expand Down
61 changes: 43 additions & 18 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,28 @@ const withBundleAnalyzer = require('@next/bundle-analyzer')({
const sentryWebpackPluginOptions =
process.env.VERCEL_ENV === 'production'
? {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
silent: false, // Logging when deploying to check if there is any problem
validate: true,
dryRun: !process.env.SENTRY_AUTH_TOKEN,
// Set to env false will skip deploying release on Sentry except Production
// https://github.com/getsentry/sentry-webpack-plugin/blob/master/src/index.js#L522
deploy: {
env: process.env.VERCEL_ENV,
},
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
silent: false, // Logging when deploying to check if there is any problem
// Suppresses source map uploading logs during build
org: "stella",
project: "solarswap-fe",
validate: true,
dryRun: !process.env.SENTRY_AUTH_TOKEN,
// Set to env false will skip deploying release on Sentry except Production
// https://github.com/getsentry/sentry-webpack-plugin/blob/master/src/index.js#L522
deploy: {
env: process.env.VERCEL_ENV,
},
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
}
: {
silent: true, // Suppresses all logs
dryRun: !process.env.SENTRY_AUTH_TOKEN,
silent: true, // Suppresses all logs
dryRun: !process.env.SENTRY_AUTH_TOKEN,
}

/** @type {import('next').NextConfig} */
Expand Down Expand Up @@ -112,4 +115,26 @@ const config = {
},
}

module.exports = withBundleAnalyzer(withSentryConfig(config, sentryWebpackPluginOptions))
module.exports = withBundleAnalyzer(withSentryConfig(config, sentryWebpackPluginOptions, {
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers (increases server load)
tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
}))




9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"test": "jest",
"test:watch": "jest --watch",
"test:config": "jest src/config/__tests__/ --testPathIgnorePatterns",
"integration-test": "start-server-and-test start http://localhost:3000 'cypress run --reporter json'",
"e2e": "cypress run --reporter json",
"integration-test": "start-server-and-test start http://localhost:3000 e2e",
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
"lint:style": "npx stylelint '**/*.{ts,tsx}'",
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx}\"",
Expand Down Expand Up @@ -41,7 +42,7 @@
"@astra-sdk/connector": "^1.1.5",
"@astra-sdk/wallet-connect": "^1.0.4",
"@astra-sdk/walletconnect-connector": "^1.0.3",
"@astraprotocol/astra-ui": "^1.0.30",
"@astraprotocol/astra-ui": "^1.0.39",
"@ethersproject/abi": "^5.5.0",
"@ethersproject/address": "^5.5.0",
"@ethersproject/bignumber": "^5.5.0",
Expand All @@ -55,7 +56,7 @@
"@gelatonetwork/limit-orders-lib": "^4.1.0",
"@next/bundle-analyzer": "^12.0.7",
"@reduxjs/toolkit": "^1.5.0",
"@sentry/nextjs": "^6.17.9",
"@sentry/nextjs": "^7.56.0",
"@solarswap/sdk": "^1.0.7",
"@uniswap/token-lists": "^1.0.0-beta.19",
"@walletconnect/sign-client": "^2.1.4",
Expand Down Expand Up @@ -135,7 +136,7 @@
"prettier": "^2.8.0",
"sass": "^1.56.1",
"source-map-explorer": "^2.5.2",
"start-server-and-test": "^1.15.3",
"start-server-and-test": "^2.0.0",
"stylelint": "^14.5.3",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-recommended": "^7.0.0",
Expand Down
Loading
Loading