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: update git related messages for runs and debug #26758

Merged
merged 25 commits into from
May 19, 2023

Conversation

jordanpowell88
Copy link
Contributor

Additional details

This PR adds messaging for users who are either NOT using git or their are NO recorded runs for their current branch on the debug and runs page.

Steps to test

yarn workspace @packages/app dev

How has the user experience changed?

DEBUG PAGE
No Recorded Runs for Current Branch

Git Not Detected

RUNS PAGE
NO Recorded Runs for Current Branch

Git Not Detected

PR Tasks

@cypress
Copy link

cypress bot commented May 15, 2023

30 flaky tests on run #46563 ↗︎

0 27302 1308 0 Flakiness 30

Details:

Changed Debug test assertion and reordered new components for Debug
Project: cypress Commit: ce63656228
Status: Passed Duration: 20:12 💡
Started: May 19, 2023 12:40 PM Ended: May 19, 2023 1:01 PM
Flakiness  commands/net_stubbing.cy.ts • 1 flaky test • 5x-driver-electron

View Output Video

Test Artifacts
network stubbing > intercepting request > can delay and throttle a StaticResponse Output Video
Flakiness  cypress/cypress.cy.js • 3 flaky tests • 5x-driver-electron

View Output Video

Test Artifacts
... > correctly returns currentRetry Output Video
... > correctly returns currentRetry Output Video
... > correctly returns currentRetry Output Video
Flakiness  create-from-component.cy.ts • 2 flaky tests • app-e2e

View Output Video

Test Artifacts
... > runs generated spec Output Screenshots Video
... > runs generated spec Output Screenshots Video
Flakiness  specs_list_latest_runs.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
App/Cloud Integration - Latest runs and Average duration > when no runs are recorded > shows placeholders for all visible specs Output Screenshots Video
Flakiness  cypress-in-cypress.cy.ts • 1 flaky test • app-e2e

View Output Video

Test Artifacts
Cypress in Cypress > scales the AUT correctly in component Output Screenshots Video

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.

@jordanpowell88 jordanpowell88 changed the title Jordanpowell88/update git messages feat: update git related messages for runs and debug page May 15, 2023
@jordanpowell88 jordanpowell88 force-pushed the jordanpowell88/update-git-messages branch from d7bddf5 to 10341b9 Compare May 15, 2023 18:17
@jordanpowell88 jordanpowell88 changed the title feat: update git related messages for runs and debug page feat: update git related messages for runs and debug May 16, 2023
cli/CHANGELOG.md Outdated Show resolved Hide resolved
packages/app/src/debug/DebugContainer.vue Show resolved Hide resolved
:title="t('debugPage.emptyStates.noRunsFoundForBranch')"
:description="t('debugPage.emptyStates.noRunsForBranchMessage')"
:icon="IconTechnologyCommandLineError"
help-link-href="https://on.cypress.io/git-info"
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Asking about this...

Copy link
Contributor

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')
Copy link
Contributor

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)

Copy link
Contributor Author

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.",
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor

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>`
Copy link
Contributor

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" ..... >

Copy link
Contributor Author

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.

Copy link
Contributor

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})`

Copy link
Contributor Author

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"
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rebased in 28d8f35

Copy link
Contributor

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

@jordanpowell88 jordanpowell88 force-pushed the jordanpowell88/update-git-messages branch from 19e7466 to 28d8f35 Compare May 16, 2023 15:11
@mike-plummer
Copy link
Contributor

@jordanpowell88 Looks like there's still some legitimate test failures here

@jordanpowell88
Copy link
Contributor Author

@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

Copy link
Contributor

@warrensplayer warrensplayer left a 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"
Copy link
Contributor

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,
Copy link
Contributor

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'

Copy link
Contributor Author

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')"
Copy link
Contributor

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.

Copy link
Contributor Author

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"
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also fixed in e1f23d0

Comment on lines 71 to 73
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'
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 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.

Comment on lines 69 to 74
if (props.helpLinkHref) {
const learnMoreLabel = t('links.learnMoreButton')

return `${props.message} [${learnMoreLabel}](${props.helpLinkHref})`
}

Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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

@jordanpowell88 jordanpowell88 force-pushed the jordanpowell88/update-git-messages branch from 3014ce0 to e1f23d0 Compare May 18, 2023 13:46
@@ -1,5 +1,7 @@
export const DEBUG_TAB_MEDIUM = 'Debug Tab'

export const RUNS_TAB_MEDIUM = 'Runs Tab'
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be removed

Copy link
Contributor

@warrensplayer warrensplayer left a 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(),
Copy link
Contributor

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

@jordanpowell88 jordanpowell88 merged commit a0efc77 into develop May 19, 2023
@jordanpowell88 jordanpowell88 deleted the jordanpowell88/update-git-messages branch May 19, 2023 15:35
@cypress-bot
Copy link
Contributor

cypress-bot bot commented May 23, 2023

Released in 12.13.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v12.13.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators May 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ACI - Updated Git related messages for Runs and Debug page
3 participants