Skip to content

Extract code owner-required changes for workflow files #807

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

Merged
merged 11 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from 9 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
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ REACT_APP_MOCK_BITCOIN_CLIENT=true

REACT_APP_WALLET_CONNECT_PROJECT_ID=$WALLET_CONNECT_PROJECT_ID

REACT_APP_TBTC_SUBGRAPH_API=$TBTC_SUBGRAPH_API
REACT_APP_TBTC_SUBGRAPH_API_KEY=$TBTC_SUBGRAPH_API_KEY

REACT_APP_TACO_DOMAIN=dashboard
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ REACT_APP_MOCK_BITCOIN_CLIENT=false

REACT_APP_WALLET_CONNECT_PROJECT_ID=$WALLET_CONNECT_PROJECT_ID

REACT_APP_TBTC_SUBGRAPH_API=$TBTC_SUBGRAPH_API
REACT_APP_TBTC_SUBGRAPH_API_KEY=$TBTC_SUBGRAPH_API_KEY

REACT_APP_TACO_DOMAIN=mainnet
16 changes: 8 additions & 8 deletions .github/workflows/dashboard-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ jobs:
env:
PUBLIC_URL: /${{ github.head_ref }}
CHAIN_ID: 11155111
ETH_HOSTNAME_HTTP: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
ETH_HOSTNAME_WS: ${{ secrets.SEPOLIA_ETH_HOSTNAME_WS }}
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
NODE_OPTIONS: --max_old_space_size=4096
ELECTRUM_PROTOCOL: ${{ secrets.TESTNET_ELECTRUMX_PROTOCOL }}
ELECTRUM_HOST: ${{ secrets.TESTNET_ELECTRUMX_HOST }}
ELECTRUM_PORT: ${{ secrets.TESTNET_ELECTRUMX_PORT }}
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
TBTC_SUBGRAPH_API_KEY: ${{ secrets.TBTC_SUBGRAPH_API_KEY }}

# FIXME: Tests are missing, will this step be needed?
# - name: Test
Expand Down Expand Up @@ -121,14 +121,14 @@ jobs:
gcpBucketPath: ${{ github.head_ref }}
preview: true
secrets:
ethUrlHttp: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
ethUrlWS: ${{ secrets.SEPOLIA_ETH_HOSTNAME_WS }}
alchemyApiKey: ${{ secrets.ALCHEMY_API_KEY }}
gcpServiceKey: ${{ secrets.KEEP_TEST_CI_UPLOAD_DAPP_JSON_KEY_BASE64 }}
electrumProtocol: ${{ secrets.TESTNET_ELECTRUMX_PROTOCOL }}
electrumHost: ${{ secrets.TESTNET_ELECTRUMX_HOST }}
electrumPort: ${{ secrets.TESTNET_ELECTRUMX_PORT }}
sentryDsn: ${{ secrets.TESTNET_SENTRY_DSN }}
walletConnectProjectId: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
tbtcSubgraphApiKey: ${{ secrets.TBTC_SUBGRAPH_API_KEY }}

# This job will be triggered via the `workflow_dispatch` event, as part of the
# CI flow, which gets triggered manually after changes in the contracts,
Expand All @@ -152,14 +152,14 @@ jobs:
gcpBucketName: dashboard.test.threshold.network
preview: false
secrets:
ethUrlHttp: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
ethUrlWS: ${{ secrets.SEPOLIA_ETH_HOSTNAME_WS }}
alchemyApiKey: ${{ secrets.ALCHEMY_API_KEY }}
gcpServiceKey: ${{ secrets.KEEP_TEST_CI_UPLOAD_DAPP_JSON_KEY_BASE64 }}
electrumProtocol: ${{ secrets.TESTNET_ELECTRUMX_PROTOCOL }}
electrumHost: ${{ secrets.TESTNET_ELECTRUMX_HOST }}
electrumPort: ${{ secrets.TESTNET_ELECTRUMX_PORT }}
sentryDsn: ${{ secrets.TESTNET_SENTRY_DSN }}
walletConnectProjectId: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
tbtcSubgraphApiKey: ${{ secrets.TBTC_SUBGRAPH_API_KEY }}

# This job will be triggered after merges of PRs to the `main` branch. As the
# triggering is not related to the changes in the contracts / client code, we
Expand All @@ -178,11 +178,11 @@ jobs:
gcpBucketName: dashboard.test.threshold.network
preview: false
secrets:
ethUrlHttp: ${{ secrets.SEPOLIA_ETH_HOSTNAME_HTTP }}
ethUrlWS: ${{ secrets.SEPOLIA_ETH_HOSTNAME_WS }}
alchemyApiKey: ${{ secrets.ALCHEMY_API_KEY }}
gcpServiceKey: ${{ secrets.KEEP_TEST_CI_UPLOAD_DAPP_JSON_KEY_BASE64 }}
electrumProtocol: ${{ secrets.TESTNET_ELECTRUMX_PROTOCOL }}
electrumHost: ${{ secrets.TESTNET_ELECTRUMX_HOST }}
electrumPort: ${{ secrets.TESTNET_ELECTRUMX_PORT }}
sentryDsn: ${{ secrets.TESTNET_SENTRY_DSN }}
walletConnectProjectId: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
tbtcSubgraphApiKey: ${{ secrets.TBTC_SUBGRAPH_API_KEY }}
8 changes: 4 additions & 4 deletions .github/workflows/dashboard-mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ jobs:
env:
PUBLIC_URL: /${{ github.ref_name }}
CHAIN_ID: 1
ETH_HOSTNAME_HTTP: ${{ secrets.MAINNET_ETH_HOSTNAME_HTTP }}
ETH_HOSTNAME_WS: ${{ secrets.MAINNET_ETH_HOSTNAME_WS }}
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
NODE_OPTIONS: --max_old_space_size=4096
ELECTRUM_PROTOCOL: ${{ secrets.MAINNET_ELECTRUMX_PROTOCOL }}
ELECTRUM_HOST: ${{ secrets.MAINNET_ELECTRUMX_HOST }}
Expand All @@ -59,6 +58,7 @@ jobs:
SENTRY_DSN: ${{ secrets.MAINNET_SENTRY_DSN }}
TRM_SUPPORT: ${{ secrets.TRM_SUPPORT }}
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
TBTC_SUBGRAPH_API_KEY: ${{ secrets.TBTC_SUBGRAPH_API_KEY }}
GOOGLE_TAG_MANAGER_SUPPORT: false
GOOGLE_TAG_MANAGER_ID: ${{ secrets.GOOGLE_TAG_MANAGER_ID }}

Expand All @@ -68,8 +68,7 @@ jobs:
env:
PUBLIC_URL: /
CHAIN_ID: 1
ETH_HOSTNAME_HTTP: ${{ secrets.MAINNET_ETH_HOSTNAME_HTTP }}
ETH_HOSTNAME_WS: ${{ secrets.MAINNET_ETH_HOSTNAME_WS }}
ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }}
NODE_OPTIONS: --max_old_space_size=4096
POSTHOG_SUPPORT: true
POSTHOG_API_KEY: ${{ secrets.MAINNET_POSTHOG_API_KEY }}
Expand All @@ -81,6 +80,7 @@ jobs:
SENTRY_DSN: ${{ secrets.MAINNET_SENTRY_DSN }}
TRM_SUPPORT: ${{ secrets.TRM_SUPPORT }}
WALLET_CONNECT_PROJECT_ID: ${{ secrets.WALLET_CONNECT_PROJECT_ID }}
TBTC_SUBGRAPH_API_KEY: ${{ secrets.TBTC_SUBGRAPH_API_KEY }}
GOOGLE_TAG_MANAGER_SUPPORT: true
GOOGLE_TAG_MANAGER_ID: ${{ secrets.GOOGLE_TAG_MANAGER_ID }}

Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/reusable-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,20 @@ on:
default: false
type: boolean
secrets:
ethUrlHttp:
description: The HTTP ETH API URL.
required: true
ethUrlWS:
description: The WebSocket ETH API URL.
alchemyApiKey:
description: The Alchemy API Key.
required: true
gcpServiceKey:
description: JSON key for Google Cloud Platform service account.
required: true
electrumProtocol:
description: Protocol used by the Electrum server.
description: Protocol used by the Testnet Electrum server.
required: true
electrumHost:
description: Host pointing to the Electrum server.
description: Host pointing to the Testnet Electrum server.
required: true
electrumPort:
description: Port the Electrum server listens on.
description: Port the Testnet Electrum server listens on.
Copy link
Member

Choose a reason for hiding this comment

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

It is not necessarily testnet, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

In the context of reusable-build-and-publish.yml, the workflow is expected to receive only testnet values for these secret variables. However, in a broader context, electrum variables can be passed in different ways (e.g., through other workflow files).

To avoid any potential confusion, I have removed this term in: remove testnet term of descriptions in reusable workflow

required: true
sentryDsn:
description: Sentry DSN endpoint
Expand All @@ -75,6 +72,9 @@ on:
Project Id gathered from WalletConnect cloud. Required for
WalletConnect v2.
required: true
tbtcSubgraphApiKey:
description: The API key for the tBTC subgraph.
required: true

jobs:
build-and-publish:
Expand Down Expand Up @@ -162,15 +162,15 @@ jobs:
env:
PUBLIC_URL: /
CHAIN_ID: ${{ env.NETWORK_ID }}
ETH_HOSTNAME_HTTP: ${{ secrets.ethUrlHttp }}
ETH_HOSTNAME_WS: ${{ secrets.ethUrlWS }}
ALCHEMY_API_KEY: ${{ secrets.alchemyApiKey }}
NODE_OPTIONS: --max_old_space_size=4096
ELECTRUM_PROTOCOL: ${{ secrets.electrumProtocol }}
ELECTRUM_HOST: ${{ secrets.electrumHost }}
ELECTRUM_PORT: ${{ secrets.electrumPort }}
SENTRY_SUPPORT: true
SENTRY_DSN: ${{ secrets.sentryDsn }}
WALLET_CONNECT_PROJECT_ID: ${{ secrets.walletConnectProjectId }}
TBTC_SUBGRAPH_API_KEY: ${{ secrets.tbtcSubgraphApiKey }}
DAPP_DEVELOPMENT_TESTNET_CONTRACTS: ${{ inputs.preview == true }}

- name: Build
Expand All @@ -180,15 +180,15 @@ jobs:
env:
PUBLIC_URL: /${{ inputs.gcpBucketPath }}
CHAIN_ID: ${{ env.NETWORK_ID }}
ETH_HOSTNAME_HTTP: ${{ secrets.ethUrlHttp }}
ETH_HOSTNAME_WS: ${{ secrets.ethUrlWS }}
ALCHEMY_API_KEY: ${{ secrets.alchemyApiKey }}
NODE_OPTIONS: --max_old_space_size=4096
ELECTRUM_PROTOCOL: ${{ secrets.electrumProtocol }}
ELECTRUM_HOST: ${{ secrets.electrumHost }}
ELECTRUM_PORT: ${{ secrets.electrumPort }}
SENTRY_SUPPORT: true
SENTRY_DSN: ${{ secrets.sentryDsn }}
WALLET_CONNECT_PROJECT_ID: ${{ secrets.walletConnectProjectId }}
TBTC_SUBGRAPH_API_KEY: ${{ secrets.tbtcSubgraphApiKey }}
DAPP_DEVELOPMENT_TESTNET_CONTRACTS: ${{ inputs.preview == true }}

- name: Deploy to GCP
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ REACT_APP_MOCK_BITCOIN_CLIENT=false

REACT_APP_WALLET_CONNECT_PROJECT_ID=$WALLET_CONNECT_PROJECT_ID

REACT_APP_TBTC_SUBGRAPH_API=$TBTC_SUBGRAPH_API
REACT_APP_TBTC_SUBGRAPH_API_KEY=$TBTC_SUBGRAPH_API_KEY

REACT_APP_TACO_DOMAIN=dashboard
```
Expand Down
2 changes: 1 addition & 1 deletion src/enums/env.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const envVariables = [
"DEFAULT_PROVIDER_CHAIN_ID",
"ALCHEMY_API_KEY",
"TBTC_SUBGRAPH_API",
"TBTC_SUBGRAPH_API_KEY",
"FEATURE_FLAG_TBTC_V2",
"FEATURE_FLAG_TBTC_V2_REDEMPTION",
"FEATURE_FLAG_MULTI_APP_STAKING",
Expand Down
4 changes: 2 additions & 2 deletions src/utils/subgraphAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import axios from "axios"
import { EnvVariable } from "../enums"
import { getEnvVariable } from "./getEnvVariable"

const tbtcSubgraphApi = getEnvVariable(EnvVariable.TBTC_SUBGRAPH_API)
const tbtcSubgraphApiKey = getEnvVariable(EnvVariable.TBTC_SUBGRAPH_API_KEY)
export const TBTC_SUBGRAPH_ID = "DETCX5Xm6tJfctRcZAxhQB9q3aK8P4BXLbujHmzEBXYV"
export const TBTC_SUBGRAPH_URL = `https://gateway.thegraph.com/api/${tbtcSubgraphApi}/subgraphs/id/${TBTC_SUBGRAPH_ID}`
export const TBTC_SUBGRAPH_URL = `https://gateway.thegraph.com/api/${tbtcSubgraphApiKey}/subgraphs/id/${TBTC_SUBGRAPH_ID}`

const LIMIT_FOR_ONE_QUERY = 1000

Expand Down