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

Sync with origin #2

Merged
merged 33 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b864bf2
Moving review envs to new helm chart (#1323)
nzenchik Nov 2, 2023
795e71c
Upload source maps to Sentry (#1280)
tom2drum Nov 2, 2023
3846c3b
show "Read contract" tab even if WalletConnect is not configured (#1315)
tom2drum Nov 2, 2023
139721e
migrate to ReactQuery v5 (#1321)
tom2drum Nov 2, 2023
c80dcbb
fix screenshots
ArminaAiren Nov 6, 2023
ed440f3
fix screenshots
ArminaAiren Nov 6, 2023
49f9aa3
support local file URI for ENVs with external resources (#1325)
tom2drum Nov 8, 2023
9ebaacb
Address doesn't fit in a column on Transaction details 'State' tab (#…
tom2drum Nov 8, 2023
15cfad3
Overloaded method with different number of arguments can't be invoked…
tom2drum Nov 8, 2023
a8c723c
watchlist and private tags pagination (#1333)
isstuev Nov 8, 2023
1d15676
"Claim funds" button for OP bridge (#1335)
tom2drum Nov 8, 2023
7938a80
Footer: 5 columns layout (#1337)
tom2drum Nov 8, 2023
7eba3e1
[skip ci] fix network explorer links (#1338)
tom2drum Nov 8, 2023
b69d05e
fix contract editor resize if there is only one source file
tom2drum Nov 9, 2023
0a0fd66
ENV for enabling tracing in Sentry
tom2drum Nov 10, 2023
2ee179d
hide last step for "Ready for relay" withdrawal status
tom2drum Nov 10, 2023
994ff1e
[skip ci] add debug for "Label release issues" workflow
tom2drum Nov 10, 2023
1152438
[skip ci] silence WalletConnect and ads errors in Sentry
tom2drum Nov 10, 2023
ac89ff3
NFT media is not displayed (#1340)
tom2drum Nov 14, 2023
ec765ed
OpenTelemetry and minor perf fixes (#1343)
tom2drum Nov 14, 2023
b5363b2
Better labels for graphs (#1348)
tom2drum Nov 14, 2023
fb280ee
USD value for token transfers and more (#1360)
tom2drum Nov 15, 2023
d3f3eaa
external icon in menu (#1357)
tom2drum Nov 15, 2023
496858d
GA: fix inline-script CSP issue (#1358)
tom2drum Nov 15, 2023
1296720
[skip ci] public source maps
tom2drum Nov 16, 2023
0f62d6f
hotfix: display error inside snippet if code editor crashes (#1364)
tom2drum Nov 21, 2023
922f55b
fix performance monitoring in Sentry (#1366)
tom2drum Nov 23, 2023
3289673
[skip ci] adjust sample rate for env
tom2drum Nov 23, 2023
e53d032
fix account paths
ArminaAiren Nov 27, 2023
93fde23
bigint bug fix
ArminaAiren Nov 27, 2023
0dd1019
Merge pull request #1369 from blockscout/fe-1367
isstuev Nov 27, 2023
3d3b251
Merge pull request #1370 from blockscout/fe-1362
isstuev Nov 27, 2023
4275b24
Merge branch 'main' of https://github.com/blockscout/frontend into sy…
pustovalov Nov 29, 2023
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
14 changes: 13 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const RESTRICTED_MODULES = {
paths: [
{ name: 'dayjs', message: 'Please use lib/date/dayjs.ts instead of directly importing dayjs' },
{ name: '@chakra-ui/icons', message: 'Using @chakra-ui/icons is prohibited. Please use regular svg-icon instead (see examples in "icons/" folder)' },
{ name: '@metamask/providers', message: 'Please lazy-load @metamask/providers or use useProvider hook instead' },
{ name: '@metamask/post-message-stream', message: 'Please lazy-load @metamask/post-message-stream or use useProvider hook instead' },
],
};

Expand All @@ -20,6 +22,7 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
'plugin:jest/recommended',
'plugin:playwright/playwright-test',
'plugin:@tanstack/eslint-plugin-query/recommended',
],
plugins: [
'es5',
Expand All @@ -31,6 +34,7 @@ module.exports = {
'eslint-plugin-import-helpers',
'jest',
'eslint-plugin-no-cyrillic-string',
'@tanstack/query',
],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down Expand Up @@ -305,7 +309,15 @@ module.exports = {
},
},
{
files: [ '*.config.ts', 'playwright/**', 'deploy/tools/**', 'middleware.ts', 'nextjs/**' ],
files: [
'*.config.ts',
'*.config.js',
'playwright/**',
'deploy/tools/**',
'middleware.ts',
'nextjs/**',
'instrumentation*.ts',
],
rules: {
// for configs allow to consume env variables from process.env directly
'no-restricted-properties': [ 0 ],
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/label-issues-in-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ jobs:
);

if (releases[0].tagName !== process.env.TAG) {
core.info(`Current latest tag: ${ releases[0].tagName }`);
core.setFailed(`Release with tag ${ process.env.TAG } is not latest one.`);
return;
}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ jobs:
label_name: 'pre-release'
label_description: Tasks in pre-release right now
secrets: inherit

upload_source_maps:
name: Upload source maps to Sentry
uses: './.github/workflows/upload-source-maps.yml'
secrets: inherit
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,9 @@ jobs:
name: Publish Docker image
uses: './.github/workflows/publish-image.yml'
secrets: inherit

upload_source_maps:
name: Upload source maps to Sentry
needs: publish_image
uses: './.github/workflows/upload-source-maps.yml'
secrets: inherit
48 changes: 48 additions & 0 deletions .github/workflows/upload-source-maps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Upload source maps to Sentry
on:
workflow_call:
workflow_dispatch:

env:
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
SENTRY_PROJECT: ${{ vars.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}

jobs:
build_and_upload:
name: Build app with source maps and upload to Sentry
runs-on: ubuntu-latest
if: ${{ github.ref_type == 'tag' }}
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'

- name: Cache node_modules
uses: actions/cache@v3
id: cache-node-modules
with:
path: |
node_modules
key: node_modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}

- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: yarn --frozen-lockfile --ignore-optional

- name: Make production build with source maps
run: yarn build
env:
NODE_ENV: production

- name: Inject Sentry debug ID
run: yarn sentry-cli sourcemaps inject ./.next

- name: Upload source maps to Sentry
run: yarn sentry-cli sourcemaps upload --release=${{ github.ref_name }} --validate ./.next
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/out/
/public/assets/
/public/envs.js
/analyze

# production
/build
Expand Down
2 changes: 2 additions & 0 deletions configs/app/features/sentry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const config: Feature<{
instance: string;
release: string | undefined;
environment: string;
enableTracing: boolean;
}> = (() => {
if (dsn && instance && environment) {
return Object.freeze({
Expand All @@ -30,6 +31,7 @@ const config: Feature<{
instance,
release,
environment,
enableTracing: getEnvValue('NEXT_PUBLIC_SENTRY_ENABLE_TRACING') === 'true',
});
}

Expand Down
6 changes: 4 additions & 2 deletions deploy/helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ releases:
name: regcred
type: kubernetes.io/dockerconfigjson
- name: bs-stack
chart: blockscout-ci-cd/blockscout-stack
chart: blockscout/blockscout-stack
version: 1.2.*
namespace: review-l2-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
labels:
app: review-l2-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
Expand All @@ -78,7 +79,8 @@ releases:
name: regcred
type: kubernetes.io/dockerconfigjson
- name: bs-stack
chart: blockscout-ci-cd/blockscout-stack
chart: blockscout/blockscout-stack
version: 1.2.*
namespace: review-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
labels:
app: review-{{ requiredEnv "GITHUB_REF_NAME_SLUG" }}
Expand Down
35 changes: 25 additions & 10 deletions deploy/scripts/download_assets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,20 @@ get_target_filename() {
local name_suffix="${name_prefix%_URL}"
local name_lc="$(echo "$name_suffix" | tr '[:upper:]' '[:lower:]')"

# Remove query parameters from the URL and get the filename
local filename=$(basename "${url%%\?*}")

# Extract the extension from the filename
local extension="${filename##*.}"
# Check if the URL starts with "file://"
if [[ "$url" == file://* ]]; then
# Extract the local file path
local file_path="${url#file://}"
# Get the filename from the local file path
local filename=$(basename "$file_path")
# Extract the extension from the filename
local extension="${filename##*.}"
else
# Remove query parameters from the URL and get the filename
local filename=$(basename "${url%%\?*}")
# Extract the extension from the filename
local extension="${filename##*.}"
fi

# Convert the extension to lowercase
extension=$(echo "$extension" | tr '[:upper:]' '[:lower:]')
Expand All @@ -59,19 +68,25 @@ download_and_save_asset() {

# Check if the environment variable is set
if [ -z "${!env_var}" ]; then
echo " [.] Environment variable $env_var is not set. Skipping download."
echo " [.] $env_var: Variable is not set. Skipping download."
return 1
fi

# Download the asset using curl
curl -s -o "$destination" "$url"
# Check if the URL starts with "file://"
if [[ "$url" == file://* ]]; then
# Copy the local file to the destination
cp "${url#file://}" "$destination"
else
# Download the asset using curl
curl -s -o "$destination" "$url"
fi

# Check if the download was successful
if [ $? -eq 0 ]; then
echo " [+] Downloaded $env_var to $destination successfully."
echo " [+] $env_var: Successfully saved file from $url to $destination."
return 0
else
echo " [-] Failed to download $env_var from $url."
echo " [-] $env_var: Failed to save file from $url."
return 1
fi
}
Expand Down
6 changes: 6 additions & 0 deletions deploy/tools/envs-validator/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ const sentrySchema = yup
then: (schema) => schema.test(urlTest),
otherwise: (schema) => schema.max(-1, 'SENTRY_CSP_REPORT_URI cannot not be used without NEXT_PUBLIC_SENTRY_DSN'),
}),
NEXT_PUBLIC_SENTRY_ENABLE_TRACING: yup
.boolean()
.when('NEXT_PUBLIC_SENTRY_DSN', {
is: (value: string) => Boolean(value),
then: (schema) => schema,
}),
NEXT_PUBLIC_APP_INSTANCE: yup
.string()
.when('NEXT_PUBLIC_SENTRY_DSN', {
Expand Down
5 changes: 5 additions & 0 deletions deploy/tools/envs-validator/test/.env.sentry
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
NEXT_PUBLIC_SENTRY_DSN=https://sentry.io
SENTRY_CSP_REPORT_URI=https://sentry.io
NEXT_PUBLIC_SENTRY_ENABLE_TRACING=true
NEXT_PUBLIC_APP_ENV=production
NEXT_PUBLIC_APP_INSTANCE=duck
Loading