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

Project git branch reporting as '(no' when a rebase is in progress #22604

Closed
kaiyoma opened this issue Jun 29, 2022 · 12 comments
Closed

Project git branch reporting as '(no' when a rebase is in progress #22604

kaiyoma opened this issue Jun 29, 2022 · 12 comments
Labels
E2E Issue related to end-to-end testing stale no activity on this issue for a long period type: bug

Comments

@kaiyoma
Copy link

kaiyoma commented Jun 29, 2022

Current behavior

In several places in the Cypress UI, I'm seeing the text ((no). What does this mean?

image

image

Desired behavior

No response

Test code to reproduce

Run Cypress.

Cypress Version

10.3.0

Other

No response

@cypress-bot cypress-bot bot added the stage: investigating Someone from Cypress is looking into this label Jun 29, 2022
@tbiethman
Copy link
Contributor

@kaiyoma thank you for the report. Those area's of the app are intended to display the current git branch for your project, if your project uses git. So either:

  • You are using a branch named (no, or
  • Cypress is failing to determine your true branch name

Can you confirm:

  1. whether or not your project is using git
  2. the branch named checked out when you took those screenshots
  3. the platforms on which you see this issue (looks like Windows in the snapshots?)
  4. any custom shells you may be using on Windows

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: investigating Someone from Cypress is looking into this labels Jun 30, 2022
@kaiyoma
Copy link
Author

kaiyoma commented Jun 30, 2022

@tbiethman Yes, we're using git, and the branch is named trunk. I'm running the git bash shell in Windows 10.

@cypress-bot cypress-bot bot added stage: investigating Someone from Cypress is looking into this and removed stage: awaiting response Potential fix was proposed; awaiting response labels Jun 30, 2022
@tbiethman
Copy link
Contributor

@kaiyoma gotcha, I'd expect that to work just fine. Let's see what the logs tell us. Could you try running Cypress with the DEBUG env set like below?

DEBUG=cypress*:data-context:sources:GitDataSource

That should output the detected git settings for your project. If you see '(no' in the logs, then we have a detection problem. If you see 'trunk', then we have a processing problem.

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: investigating Someone from Cypress is looking into this labels Jul 1, 2022
@kaiyoma
Copy link
Author

kaiyoma commented Jul 1, 2022

@tbiethman

  cypress:data-context:sources:GitDataSource config: { isRunMode: false, projectRoot: 'C:\\Work\\event-viewer\\tools\\test-e2e', onError: [Function (anonymous)], onBranchChange: [Function: onBranchChange], onGitInfoChange: [Function: onGitInfoChange] } +0ms
  cypress:data-context:sources:GitDataSource On current branch (no +2s

@cypress-bot cypress-bot bot added stage: investigating Someone from Cypress is looking into this and removed stage: awaiting response Potential fix was proposed; awaiting response labels Jul 1, 2022
@tbiethman
Copy link
Contributor

Thanks @kaiyoma , that appears to be a parsing issue from simple-git, the dependency we use within Cypress to retrieve your project's git info.

My guess here is that it's parsing some sort of error message that git outputs when we call the branch command. (no doesn't give us much to work with, though.

I wrote a small isolation script that you could run from your project root. I'm curious what the output may be for you? It's likely still going to show (no as the current branch, but we could dig into the module to see the pre-parsed message and hopefully get a better lead.

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: investigating Someone from Cypress is looking into this labels Jul 1, 2022
@kaiyoma
Copy link
Author

kaiyoma commented Jul 1, 2022

@tbiethman Here you go:

Click to expand full console output
BranchSummaryResult {
  all: [
    'trunk',
    'remotes/origin/cv-prod-20210521',
    'remotes/origin/cvp.imperial',
    'remotes/origin/cvp.jackson',
    'remotes/origin/cvp.kent',
    'remotes/origin/cvp.lloyd',
    'remotes/origin/donner',
    'remotes/origin/donner.A1',
    'remotes/origin/donner.B1',
    'remotes/origin/donner.C1',
    'remotes/origin/echo',
    'remotes/origin/echo.A1',
    'remotes/origin/echo.B1',
    'remotes/origin/echo.C1',
    'remotes/origin/folsom',
    'remotes/origin/folsom.A1',
    'remotes/origin/folsom.B1',
    'remotes/origin/foster',
    'remotes/origin/foster.A1',
    'remotes/origin/grant',
    'remotes/origin/grant.A1',
    'remotes/origin/grant.B1',
    'remotes/origin/grant.C1',
    'remotes/origin/grant.D1',
    'remotes/origin/green',
    'remotes/origin/green.A1',
    'remotes/origin/green.B1',
    'remotes/origin/hetchy',
    'remotes/origin/hetchy.A1',
    'remotes/origin/hetchy.B1',
    'remotes/origin/hetchy.C1',
    'remotes/origin/hetchy.D1',
    'remotes/origin/howard',
    'remotes/origin/howard.A1',
    'remotes/origin/hume',
    'remotes/origin/hume.A1',
    'remotes/origin/trunk'
  ],
  branches: {
    trunk: {
      current: true,
      linkedWorkTree: false,
      name: 'trunk',
      commit: 'e82c3cbc11',
      label: '[ahead 3] WIP: chore(components): graduate Input to cv-components'
    },
    'remotes/origin/cv-prod-20210521': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/cv-prod-20210521',
      commit: '05c39c4e3a',
      label: 'chore(devices): Update required Terminattr version'
    },
    'remotes/origin/cvp.imperial': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/cvp.imperial',
      commit: 'd9038c7db2',
      label: 'fix(ZoomableSubscribedGraph): Do not pass window times if live'
    },
    'remotes/origin/cvp.jackson': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/cvp.jackson',
      commit: '9aaf20cc6e',
      label: 'fix(studios): Studios RBAC section was missing in Jackson'
    },
    'remotes/origin/cvp.kent': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/cvp.kent',
      commit: 'e4e68113e3',
      label: 'fix(Tasks): Use DeviceConfigDiffV2 in modal'
    },
    'remotes/origin/cvp.lloyd': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/cvp.lloyd',
      commit: 'cbf13cf82e',
      label: 'fix(studios): Add default studios permissions for role creation'
    },
    'remotes/origin/donner': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/donner',
      commit: '145299509a',
      label: 'Subscribe: change to versions=1'
    },
    'remotes/origin/donner.A1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/donner.A1',
      commit: 'ad04fed8b4',
      label: 'deviceMetrics: fix DEVICE_ETHERNET_INTERFACE_COUNT'
    },
    'remotes/origin/donner.B1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/donner.B1',
      commit: '27c23ad3b6',
      label: 'package.json: update version to 1.2.0'
    },
    'remotes/origin/donner.C1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/donner.C1',
      commit: '8f5ed0f61b',
      label: 'timeline: follow-up timeline/window scroll'
    },
    'remotes/origin/echo': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/echo',
      commit: '77c37541e0',
      label: 'devices:add 7280SR2-48YC6(-M) and 7060SX2-48YC6'
    },
    'remotes/origin/echo.A1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/echo.A1',
      commit: 'a61b097ffb',
      label: 'reducer: rewrite mergeAerisData to not use splice'
    },
    'remotes/origin/echo.B1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/echo.B1',
      commit: 'cb2c83223c',
      label: 'Topology: Layout improvements'
    },
    'remotes/origin/echo.C1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/echo.C1',
      commit: 'db18925566',
      label: 'topology: fix reload with node selection'
    },
    'remotes/origin/folsom': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/folsom',
      commit: '1004d38c21',
      label: 'snapshots: update interval humanizer'
    },
    'remotes/origin/folsom.A1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/folsom.A1',
      commit: 'e2bcaa410c',
      label: 'fix(topology): Enable Firefox and Edge support'
    },
    'remotes/origin/folsom.B1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/folsom.B1',
      commit: '1157718060',
      label: 'fix(package.json): Fix SHAs of unpublished packages'
    },
    'remotes/origin/foster': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/foster',
      commit: '156ca757c0',
      label: 'fix(Compliance): return empty object to avoid indefinite loading'
    },
    'remotes/origin/foster.A1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/foster.A1',
      commit: '5d29b8e86f',
      label: 'feat(devices): Use CVP Provisioning Mgmt IP as Device Mgmt IP'
    },
    'remotes/origin/grant': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/grant',
      commit: 'e2f70c53f2',
      label: 'fix(devices): Add image and mapping for 7280CR2A-30'
    },
    'remotes/origin/grant.A1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/grant.A1',
      commit: '056b47db07',
      label: `Revert "fix(EventAlerts): don't write empty strings for config"`
    },
    'remotes/origin/grant.B1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/grant.B1',
      commit: 'f3be00f45a',
      label: 'chore(package.json): Bump geiger version to 1.4.0'
    },
    'remotes/origin/grant.C1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/grant.C1',
      commit: '17c4fac036',
      label: 'fix(EventLog): Update CC IDs metrics and datapaths'
    },
    'remotes/origin/grant.D1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/grant.D1',
      commit: 'ca9190b5d3',
      label: 'fix(ChangeControl): add rendering improvements'
    },
    'remotes/origin/green': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/green',
      commit: '6dd24be8ab',
      label: 'fix(build): also create tarball on staging builds'
    },
    'remotes/origin/green.A1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/green.A1',
      commit: '3cca9b9d68',
      label: 'fix(AppError): wait for data to load + improve rendering'
    },
    'remotes/origin/green.B1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/green.B1',
      commit: '8bce714e5b',
      label: 'chore(pipelines): fix checkout signature'
    },
    'remotes/origin/hetchy': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/hetchy',
      commit: '54e89f1cfc',
      label: 'test(e2e): pull mochawesome report assets from CDN'
    },
    'remotes/origin/hetchy.A1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/hetchy.A1',
      commit: 'e6cb15df3d',
      label: 'fix(CloudTracer): add lima alert to all events'
    },
    'remotes/origin/hetchy.B1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/hetchy.B1',
      commit: '53197417a5',
      label: 'infra(pipelines): add retries to geiger-dist'
    },
    'remotes/origin/hetchy.C1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/hetchy.C1',
      commit: '719b96ead8',
      label: 'chore(packages): fix versions for package forks'
    },
    'remotes/origin/hetchy.D1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/hetchy.D1',
      commit: 'cff6ae8b7c',
      label: 'chore(sentry): move to Arista IT org'
    },
    'remotes/origin/howard': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/howard',
      commit: '2402ef0b02',
      label: 'chore(sentry): move to Arista IT org'
    },
    'remotes/origin/howard.A1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/howard.A1',
      commit: 'fd078d6288',
      label: 'fix(nginx): add Sentry ingest to CSP'
    },
    'remotes/origin/hume': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/hume',
      commit: '79b8bb06de',
      label: 'fix(Metrics): VxlanMacAddress moves'
    },
    'remotes/origin/hume.A1': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/hume.A1',
      commit: '677b75ae8e',
      label: 'fix(ztp): Fix incorrect secureZtp data path'
    },
    'remotes/origin/trunk': {
      current: false,
      linkedWorkTree: false,
      name: 'remotes/origin/trunk',
      commit: '4778f8d8a3',
      label: 'chore(dependencies): upgrade to latest'
    }
  },
  current: 'trunk',
  detached: false
}

@kaiyoma
Copy link
Author

kaiyoma commented Jul 8, 2022

@tbiethman Ah, I think I figured it out: this problem happens only when editing a commit during a git rebase. If you're outside of a rebase, then the branch name shows up correctly.

@tbiethman
Copy link
Contributor

tbiethman commented Jul 11, 2022

@kaiyoma Nice find! I can reproduce the same by loading cypress during a rebase.

The branch gets reported as something like:
* (no branch, rebasing tbiethman/test-git-rebase)....

Which then turns into (no after running through the branch parser within simple-git.

We'll have to see if there are mitigating steps we can take or work with simple-git to get better output here.

@cypress-bot cypress-bot bot added stage: routed to e2e-core and removed stage: awaiting response Potential fix was proposed; awaiting response labels Jul 11, 2022
@tbiethman tbiethman removed their assignment Jul 11, 2022
@tbiethman tbiethman changed the title What does ((no) mean? Project git branch reporting as '(no' when a rebase is in progress Jul 11, 2022
@mschile mschile added the triage label Aug 18, 2022
@mschile mschile removed the triage label Aug 18, 2022
@nagash77 nagash77 added E2E Issue related to end-to-end testing and removed E2E-core labels Nov 8, 2022
@github-actions
Copy link
Contributor

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@github-actions github-actions bot added the stale no activity on this issue for a long period label May 12, 2023
@kaiyoma
Copy link
Author

kaiyoma commented May 12, 2023

AFAIK this is still an issue.

@cypress-app-bot cypress-app-bot removed the stale no activity on this issue for a long period label May 15, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Nov 12, 2023
@cypress-app-bot
Copy link
Collaborator

This issue has been closed due to inactivity.

@cypress-app-bot cypress-app-bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E2E Issue related to end-to-end testing stale no activity on this issue for a long period type: bug
Projects
None yet
Development

No branches or pull requests

5 participants