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

feat: Add ui_customizations metric for transactions #25736

Merged
merged 7 commits into from
Jul 12, 2024
Merged

Conversation

pedronfigueiredo
Copy link
Contributor

@pedronfigueiredo pedronfigueiredo commented Jul 10, 2024

Description

This PR also includes an e2e test, and migrates existing transaction redesign e2e tests to TypeScript.

Open in GitHub Codespaces

Related issues

Fixes: #24486

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@@ -256,6 +311,7 @@ describe('Confirmation Redesign Contract Interaction Component', function () {
},
);
});
<<<<<<< Updated upstream:test/e2e/tests/confirmations/transactions/contract-interaction-redesign.spec.js
Copy link
Member

Choose a reason for hiding this comment

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

Guess this is forgotten.

Comment on lines 53 to 56
}: {
driver: Driver;
contractRegistry: GanacheContractAddressRegistry;
}) => {
Copy link
Member

Choose a reason for hiding this comment

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

Nit: we could've create a small interface for this repetitive argument type.

@@ -402,3 +458,97 @@ async function assertAdvancedGasDetailsWithL2Breakdown(driver) {
await driver.waitForSelector({ css: 'p', text: 'Speed' });
await driver.waitForSelector({ css: 'p', text: 'Max fee' });
}
=======
Copy link
Member

Choose a reason for hiding this comment

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

Missed this one as well.

});
});
});
>>>>>>> Stashed changes:test/e2e/tests/confirmations/transactions/contract-interaction-redesign.spec.ts
Copy link
Member

Choose a reason for hiding this comment

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

And this

uiCustomizations.push(
MetaMetricsEventUiCustomization.RedesignedConfirmation,
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it should also include check to see if user has enabled re-designs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added in 50e5516

@@ -978,6 +979,13 @@ async function buildEventFragmentProperties({
uiCustomizations.push(MetaMetricsEventUiCustomization.GasEstimationFailed);
}

if (
REDESIGN_TRANSACTION_TYPES.includes(transactionMeta.type as TransactionType)
Copy link
Member

Choose a reason for hiding this comment

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

Following the developer settings PR, this will be static and not based on the ENV, so do we also want to temporarily check the env / preference here? @pnarayanaswamy

Depends which PR goes in first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added in 50e5516

smartContract,
);
async ({ driver, contractRegistry }: TestSuiteArguments) => {
const contractAddress = await (
Copy link
Member

Choose a reason for hiding this comment

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

Minor, is this worth a small function to avoid the duplication?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in c326fdb8d3

} = require('../../../helpers');
const FixtureBuilder = require('../../../fixture-builder');

describe('Metrics', function () {
Copy link
Member

Choose a reason for hiding this comment

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

Since integration tests are now merged, would this be a great use case for one, rather than adding more E2E tests for functionality that won't directly impact the user?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree this is a use case, but I would prefer to avoid deleting working e2e tests in this PR

@pedronfigueiredo pedronfigueiredo force-pushed the pnf/24486 branch 2 times, most recently from 53533cf to 3aeb614 Compare July 11, 2024 13:23
jpuri
jpuri previously approved these changes Jul 12, 2024
Copy link

@metamaskbot
Copy link
Collaborator

Builds ready [cd1c1d8]
Page Load Metrics (63 ± 7 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint6412896189
domContentLoaded95827157
load399063157
domInteractive95827157
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 407 Bytes (0.01%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

codecov bot commented Jul 12, 2024

Codecov Report

Attention: Patch coverage is 55.55556% with 4 lines in your changes missing coverage. Please review.

Project coverage is 69.96%. Comparing base (5ee57a6) to head (cd1c1d8).
Report is 35 commits behind head on develop.

Files Patch % Lines
app/scripts/lib/transaction/metrics.ts 71.43% 2 Missing ⚠️
app/scripts/metamask-controller.js 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #25736      +/-   ##
===========================================
+ Coverage    69.77%   69.96%   +0.18%     
===========================================
  Files         1376     1390      +14     
  Lines        48403    48904     +501     
  Branches     13348    13455     +107     
===========================================
+ Hits         33773    34212     +439     
- Misses       14630    14692      +62     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pedronfigueiredo pedronfigueiredo dismissed matthewwalsh0’s stale review July 12, 2024 11:50

all feedback has been addressed

@pedronfigueiredo pedronfigueiredo merged commit 81c85a6 into develop Jul 12, 2024
73 checks passed
@pedronfigueiredo pedronfigueiredo deleted the pnf/24486 branch July 12, 2024 11:51
@github-actions github-actions bot locked and limited conversation to collaborators Jul 12, 2024
@metamaskbot metamaskbot added the release-12.3.0 Issue or pull request that will be included in release 12.3.0 label Jul 12, 2024
@metamaskbot metamaskbot added release-12.2.0 Issue or pull request that will be included in release 12.2.0 and removed release-12.3.0 Issue or pull request that will be included in release 12.3.0 labels Aug 19, 2024
@metamaskbot
Copy link
Collaborator

Missing release label release-12.2.0 on PR. Adding release label release-12.2.0 on PR and removing other release labels(release-12.3.0), as PR was added to branch 12.2.0 when release was cut.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
confirmation-re-design confirmation-redesign release-12.2.0 Issue or pull request that will be included in release 12.2.0 team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ui_customizations "redesigned_confirmation" metric for transactions
6 participants