Skip to content

Commit

Permalink
Merge branch 'main' into update-sonic-logo
Browse files Browse the repository at this point in the history
  • Loading branch information
b1rdmania authored Jan 10, 2025
2 parents 0fc10c0 + b2c5314 commit 3ee24e2
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 25 deletions.
29 changes: 16 additions & 13 deletions .github/workflows/publish-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,41 +25,44 @@ jobs:
BASE_REF: ${{ github.event.pull_request.base.ref }}
run: |
merge_base="$(git merge-base "origin/${BASE_REF}" HEAD)"
echo "Merge base is '${merge_base}'"
echo "MERGE_BASE=${merge_base}" >> "$GITHUB_OUTPUT"
echo "Merge base is '${merge_base}'"
- name: Get CircleCI job details
id: get-circleci-job-details
env:
REPOSITORY: ${{ github.repository }}
OWNER: ${{ github.repository_owner }}
REPOSITORY: ${{ github.event.repository.name }}
# For a `pull_request` event, the branch is `github.head_ref``.
BRANCH: ${{ github.head_ref }}
# For a `pull_request` event, the head commit hash is `github.event.pull_request.head.sha`.
HEAD_COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
JOB_NAME: job-publish-prerelease
run: |
pipeline_id=$(curl --silent "https://circleci.com/api/v2/project/gh/$OWNER/$REPOSITORY/pipeline?branch=$BRANCH" | jq -r ".items | map(select(.vcs.revision == \"${HEAD_COMMIT_HASH}\" )) | first | .id")
pipeline_id=$(curl --silent "https://circleci.com/api/v2/project/gh/$OWNER/$REPOSITORY/pipeline?branch=$BRANCH" | jq --arg head_commit_hash "${HEAD_COMMIT_HASH}" -r '.items | map(select(.vcs.revision == $head_commit_hash)) | first | .id')
workflow_id=$(curl --silent "https://circleci.com/api/v2/pipeline/$pipeline_id/workflow" | jq -r ".items[0].id")
job_details=$(curl --silent "https://circleci.com/api/v2/workflow/$workflow_id/job" | jq -r '.items[] | select(.name == "job-publish-prerelease")')
build_num=$(echo "$job_details" | jq -r '.job_number')
job_details=$(curl --silent "https://circleci.com/api/v2/workflow/$workflow_id/job" | jq --arg job_name "${JOB_NAME}" -r '.items[] | select(.name == $job_name)')
build_num=$(echo "$job_details" | jq -r '.job_number')
echo 'CIRCLE_BUILD_NUM='"$build_num" >> "$GITHUB_OUTPUT"
job_id=$(echo "$job_details" | jq -r '.id')
echo 'CIRCLE_WORKFLOW_JOB_ID='"$job_id" >> "$GITHUB_OUTPUT"
echo "Getting artifacts from pipeline '${pipeline_id}', workflow '${workflow_id}', build number '${build_num}', job ID '${job_id}'"
echo "Getting artifacts from pipeline '${pipeline_id}', workflow '${workflow_id}', build number '${build_num}', job id '${job_id}'"
- name: Get CircleCI job artifacts
env:
CIRCLE_WORKFLOW_JOB_ID: ${{ steps.get-circleci-job-details.outputs.CIRCLE_WORKFLOW_JOB_ID }}
run: |
mkdir -p "test-artifacts/chrome/benchmark"
mkdir -p test-artifacts/chrome/benchmark
curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/benchmark/pageload.json" > "test-artifacts/chrome/benchmark/pageload.json"
bundle_size=$(curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/bundle_size.json")
mkdir -p "test-artifacts/chrome"
echo "${bundle_size}" > "test-artifacts/chrome/bundle_size.json"
mkdir -p test-artifacts/chrome
curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/test-artifacts/chrome/bundle_size.json" > "test-artifacts/chrome/bundle_size.json"
stories=$(curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/storybook/stories.json")
mkdir "storybook-build"
echo "${stories}" > "storybook-build/stories.json"
mkdir storybook-build
curl --silent --location "https://output.circle-artifacts.com/output/job/${CIRCLE_WORKFLOW_JOB_ID}/artifacts/0/storybook/stories.json" > "storybook-build/stories.json"
- name: Publish prerelease
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async function addEthereumChainHandler(
) {
let validParams;
try {
validParams = validateAddEthereumChainParams(req.params[0], end);
validParams = validateAddEthereumChainParams(req.params[0]);
} catch (error) {
return end(error);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function validateChainId(chainId) {
return _chainId;
}

export function validateSwitchEthereumChainParams(req, end) {
export function validateSwitchEthereumChainParams(req) {
if (!req.params?.[0] || typeof req.params[0] !== 'object') {
throw rpcErrors.invalidParams({
message: `Expected single, object parameter. Received:\n${JSON.stringify(
Expand All @@ -43,10 +43,10 @@ export function validateSwitchEthereumChainParams(req, end) {
});
}

return validateChainId(chainId, end);
return validateChainId(chainId);
}

export function validateAddEthereumChainParams(params, end) {
export function validateAddEthereumChainParams(params) {
if (!params || typeof params !== 'object') {
throw rpcErrors.invalidParams({
message: `Expected single, object parameter. Received:\n${JSON.stringify(
Expand Down Expand Up @@ -75,7 +75,7 @@ export function validateAddEthereumChainParams(params, end) {
});
}

const _chainId = validateChainId(chainId, end);
const _chainId = validateChainId(chainId);
if (!rpcUrls || !Array.isArray(rpcUrls) || rpcUrls.length === 0) {
throw rpcErrors.invalidParams({
message: `Expected an array with at least one valid string HTTPS url 'rpcUrls', Received:\n${rpcUrls}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function switchEthereumChainHandler(
) {
let chainId;
try {
chainId = validateSwitchEthereumChainParams(req, end);
chainId = validateSwitchEthereumChainParams(req);
} catch (error) {
return end(error);
}
Expand Down
2 changes: 0 additions & 2 deletions app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,6 @@ export default class MetamaskController extends EventEmitter {
}),
});

this.nftController.setApiKey(process.env.OPENSEA_KEY);

const nftDetectionControllerMessenger =
this.controllerMessenger.getRestricted({
name: 'NftDetectionController',
Expand Down
11 changes: 7 additions & 4 deletions builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,9 @@ env:
# API keys to 3rd party services
###

- PUBNUB_PUB_KEY: null
- PUBNUB_SUB_KEY: null
- SEGMENT_HOST: null
- SENTRY_DSN: null
- SENTRY_DSN_DEV: null
- OPENSEA_KEY: null
- ETHERSCAN_KEY: null
# also INFURA_PROJECT_ID below

###
Expand Down Expand Up @@ -318,3 +314,10 @@ env:
# This should NEVER be enabled in production since it slows down react
###
- ENABLE_WHY_DID_YOU_RENDER: false

###
# Unused environment variables referenced in dependencies
# Unset environment variables cause a build error. These are set to `null` to tell our build
# system that they are intentionally unset.
###
- ETHERSCAN_KEY: null # Used by `gridplus-sdk/dist/util.js`

0 comments on commit 3ee24e2

Please sign in to comment.