-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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: update git related messages for runs and debug #26758
Conversation
30 flaky tests on run #46563 ↗︎
Details:
commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-electron
cypress/cypress.cy.js • 3 flaky tests • 5x-driver-electron
create-from-component.cy.ts • 2 flaky tests • app-e2e
specs_list_latest_runs.cy.ts • 1 flaky test • app-e2e
cypress-in-cypress.cy.ts • 1 flaky test • app-e2e
The first 5 flaky specs are shown, see all 17 specs in Cypress Cloud. This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
d7bddf5
to
10341b9
Compare
:title="t('debugPage.emptyStates.noRunsFoundForBranch')" | ||
:description="t('debugPage.emptyStates.noRunsForBranchMessage')" | ||
:icon="IconTechnologyCommandLineError" | ||
help-link-href="https://on.cypress.io/git-info" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No UTM params needed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No UTM params needed here?
I don't see anything about UTM params in the requirements. @warrensplayer does this need added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asking about this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the links should have UTM params. The requirements in the issue have been updated.
describe('<DebugBranchError />', () => { | ||
it('can mount', () => { | ||
cy.mount(<DebugBranchError />) | ||
cy.contains('No runs found for your branch') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could just reference the i18n bundle in this test so we don't inline a bunch of text:
import defaultMessages from '@packages/frontend-shared/src/locales/en-US.json'
...
cy.contains(defaultMessages.debugPage.emptyStates.noRunsFoundForBranch)
cy.contains(defaultMessages.debugPage.emptyStates.noRunsForBranchMessage)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, added in 28d8f35
"learnAboutRecordingSrText": "about recording a run to Cypress Cloud", | ||
"learnAboutDebuggingSrText": "about debugging CI failures in Cypress", | ||
"learnAboutProjectSetupSrText": "about project setup in Cypress", | ||
"noRunsFoundForBranch": "No runs found for your branch", | ||
"noRunsForBranchMessage": "Cypress uses Git to show runs for your branch. Ensure that version control is properly configured and that you are sending Git information to Cypress Cloud.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why uppercase Git
here, but lowercase in message above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the way it was in the ticket. @warrensplayer should the requirements be changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Git" should be capitalized. I will get the requirements and Figma updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screenshot in issue has been updated
@@ -64,6 +66,11 @@ let message = computed(() => { | |||
return [props.message, ` ${ props.details }`].join('\n\n') | |||
} | |||
|
|||
if (props.helpLinkHref) { | |||
// eslint-disable-next-line prefer-template | |||
return props.message + ` <span class="ml-[4px]"><a href="${props.helpLinkHref}" class="text-indigo-500 hocus-link-default">${t('links.learnMoreButton')}</a></span>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just trying to shove a link into the message so it gets processed as markdown or whatever for the v-html
? Why not just add a conditional ExternalLink
in the template?
<div
ref="markdownTarget"
class="warning-markdown"
v-html="markdown"
/>
<ExternalLink v-if="helpLinkHref" ..... >
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be added to the props.message
so that the link display inline
the p
copy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we able to tack this on using markdown format rather than inline HTML? Would this get processed correctly by useMarkdown
?
const learnMoreLabel = t('links.learnMoreButton')
return `${props.message} [${learnMoreLabel}](${props.helpLinkHref})`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh, yes. Now i'm following you. Yes it is implemented in 27100e3
cli/package.json
Outdated
@@ -125,42 +125,42 @@ | |||
"require": "./index.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The weirdness in this file may have been fixed in this PR? Maybe try pulling latest from develop and re-run the yarn
install
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebased in 28d8f35
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is still showing diffs that are not related to this PR. You might just have to manually revert them by comparing the file to develop
and syncing the changes
19e7466
to
28d8f35
Compare
@jordanpowell88 Looks like there's still some legitimate test failures here |
They should be resolved now. It was erroring because of UTM params in CT do not run right apparently. I updated the test to reflect this change in e33d420 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost done reviewing, but here are a few things to address.
cli/package.json
Outdated
@@ -125,42 +125,42 @@ | |||
"require": "./index.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is still showing diffs that are not related to this PR. You might just have to manually revert them by comparing the file to develop
and syncing the changes
url: 'https://on.cypress.io/git-info', | ||
params: { | ||
utm_source: getUtmSource(), | ||
utm_medium: DEBUG_TAB_MEDIUM, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 'Runs Tab', not 'Debug Tab'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in e1f23d0
<RunsConnect | ||
v-if="!currentProject?.projectId || !cloudViewer?.id" | ||
:campaign="!cloudViewer?.id ? RUNS_PROMO_CAMPAIGNS.login : RUNS_PROMO_CAMPAIGNS.connectProject" | ||
/> | ||
<Warning | ||
v-else-if="userProjectStatusStore.cloudStatusMatches('needsRecordedRun') && userProjectStatusStore.project.isUsingGit" | ||
:title="t('debugPage.emptyStates.noRunsFoundForBranch')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Runs page copy is different than the Debug page. This component needs different i18n messaging instead of reusing the Debug messaging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahhh, I didn't see this subtle difference, Fixed in e1f23d0
@@ -32,6 +40,11 @@ | |||
:dismissible="false" | |||
class="mx-auto mb-[24px]" | |||
/> | |||
<Warning | |||
v-if="!userProjectStatusStore.project.isUsingGit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Runs page copy is different than the Debug page. This component needs different i18n messaging instead of reusing the Debug messaging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also fixed in e1f23d0
import { getUrlWithParams } from '@packages/frontend-shared/src/utils/getUrlWithParams' | ||
import { getUtmSource } from '@packages/frontend-shared/src/utils/getUtmSource' | ||
import { DEBUG_TAB_MEDIUM } from '../debug/utils/constants' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is okay for now, but I find when I start adding several new imports to a component that already has a lot of imports that it might be a sign to make a separate component. Mainly just to keep this parent component to a manageable level of dependencies. Just something to consider for the future.
if (props.helpLinkHref) { | ||
const learnMoreLabel = t('links.learnMoreButton') | ||
|
||
return `${props.message} [${learnMoreLabel}](${props.helpLinkHref})` | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is adding a very specific prop to this generic component. Since this is just formatting markdown in the message, you can just add the Learn More
link to the message already formatted as Markdown. No need to modify this component.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, now that this is working using the markdown via @mike-plummer suggestion we can remove this. Fixed in e1f23d0
|
||
const { t } = useI18n() | ||
|
||
const props = defineProps<{ | ||
title: string | ||
description?: string | ||
icon?: FunctionalComponent<SVGAttributes, {}> | ||
exampleTestName?: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This prop is not used
3014ce0
to
e1f23d0
Compare
@@ -1,5 +1,7 @@ | |||
export const DEBUG_TAB_MEDIUM = 'Debug Tab' | |||
|
|||
export const RUNS_TAB_MEDIUM = 'Runs Tab' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jordanpowell88 Looks good to go now. I did push a small tweak to the order of the components in the conditional list on DebugContainer to make sure the missing Git message only showed after they logged in. That was not specified in the requirements, but it encourages the user to log in first before worrying about Git.
const learnMoreLink = getUrlWithParams({ | ||
url: 'https://on.cypress.io/git-info', | ||
params: { | ||
utm_source: getUtmSource(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/nit: I think getUrlWithParams
automatically applies a utm_source
value which ends up overwriting any you supply
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Additional details
This PR adds messaging for users who are either NOT using
git
or their are NO recorded runs for their currentbranch
on thedebug
andruns
page.Steps to test
yarn workspace @packages/app dev
How has the user experience changed?
DEBUG PAGE
RUNS PAGE
PR Tasks
cypress-documentation
?type definitions
?