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

fix(app): show correct git status for newly created/modified files #20744

Merged
merged 31 commits into from
Mar 28, 2022

Conversation

lmiller1990
Copy link
Contributor

@lmiller1990 lmiller1990 commented Mar 23, 2022

User facing changelog

  • Show correct git status for untracked, staged and modified files
  • Align UI with Figma mocks (Should not show git status on folders, just files)
  • Fix bug where git status is not appearing on linux (git command not working in /bin/sh; default to $SHELL or /bin/bash for unix-like systems).
  • Add proper tests (create an actual git repo; not mocking the response)

image

Additional details

N/A

How has the user experience changed?

PR Tasks

  • Have tests been added/updated?
  • Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • Has a PR for user-facing changes been opened in cypress-documentation?
  • Have API changes been updated in the type definitions?
  • Have new configuration options been added to the cypress.schema.json?

@lmiller1990 lmiller1990 requested review from a team as code owners March 23, 2022 06:12
@lmiller1990 lmiller1990 requested review from rockhold and removed request for a team March 23, 2022 06:12
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 23, 2022

Thanks for taking the time to open a PR!

@lmiller1990 lmiller1990 changed the base branch from develop to 10.0-release March 23, 2022 06:13
@lmiller1990 lmiller1990 changed the title Lmiller1990/unify 863 fix(app): show correct git status for newly created/modified files Mar 23, 2022
@lmiller1990 lmiller1990 marked this pull request as draft March 23, 2022 06:34
@lmiller1990 lmiller1990 removed request for a team and rockhold March 23, 2022 06:34
@cypress
Copy link

cypress bot commented Mar 23, 2022



Test summary

17788 0 217 0Flakiness 1


Run details

Project cypress
Status Passed
Commit ec3e0b4
Started Mar 28, 2022 7:42 AM
Ended Mar 28, 2022 7:54 AM
Duration 12:03 💡
OS Linux Debian - 10.10
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/e2e/commands/net_stubbing.cy.ts Flakiness
1 network stubbing > waiting and aliasing > yields the expected interception when two requests are raced

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

import { createTestDataContext, scaffoldMigrationProject } from '../helper'

describe('GitDataSource', () => {
it(`gets correct status for files on ${os.platform()}`, async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Making sure it runs on windows/linux/macos.

@lmiller1990 lmiller1990 marked this pull request as ready for review March 24, 2022 12:35
Copy link
Contributor

@marktnoonan marktnoonan left a comment

Choose a reason for hiding this comment

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

I've done a bit of testing and seems to work great overall. There are two things to look at. First, when creating a spec from Cypress, it doesn't show the git status in the table, see filename.cy.ts here:

Screen Shot 2022-03-24 at 1 44 27 PM

Second, in the mocks, before files are committed, the designs show "created" and "modified" without the name attached. Should we match that here?

Love the new tests!

// macOS/Linux: getInfoPosix
// Windows: getInfoWindows
// Where possible, we use SimpleGit to get other git info, like
// the status of untracked files and the current git username.
Copy link
Contributor

Choose a reason for hiding this comment

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

Really happy to have this reasoning included

elevatebart
elevatebart previously approved these changes Mar 24, 2022
@@ -0,0 +1 @@
export const gitStatusType = ['modified', 'created', 'unmodified'] as const
Copy link
Contributor

Choose a reason for hiding this comment

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

It's almost like we should have this model of files for everything in the constants.ts file.

I like this though.

@lmiller1990
Copy link
Contributor Author

lmiller1990 commented Mar 25, 2022

@marktnoonan I have

  • changed UI not to show username for created/modified
  • fixed bugs where UI is not updating when you create a new spec from the UI
  • other small bugs I found

I put a video demo here to show the new UI and it working as expected: https://cypress-io.atlassian.net/browse/UNIFY-863?focusedCommentId=17183

This was a surprisingly complex ticket. Our virtualized spec list is a bit weird (well, how we compose useCachedSpecs and useCollapsibleTree - there's a computed property of a computed property, which seems like a code smell 🤔). We should revisit this - it was the cause of the UI not updating correctly, it was doing some caching, preventing the UI from updating.

Anyway, it works for now! Please re-review. cc @elevatebart for one more ✔️, thanks!

@marktnoonan marktnoonan dismissed their stale review March 25, 2022 12:29

I have comments but am OOO today, so don't want my review to be blocking

@marktnoonan
Copy link
Contributor

@lmiller1990 I'm confused by this Percy snapshot, and this one.

The first seems to show results where we should be on the empty state, and both show file.git.null in the UI. I am OOO the rest of the day and haven't looked any deeper into this. I've dismissed my change request since I won't be able to re-review until Monday.

I'd agree about revisiting the specs list, @ZachJW34 and I have talked about this as well. There are a couple of related problems it would be good to talk about together.

@ryanthemanuel
Copy link
Collaborator

Should foo.cy.js and blah.cy.js have been checked in? It looks like they're generated as part of a test

@lmiller1990
Copy link
Contributor Author

lmiller1990 commented Mar 28, 2022

@marktnoonan thanks for catching this. I'd forgotten to update the stubs, in this file.

Happy to wait for your re-review if you are out, or get someone else to 👀. I don't really understand why the generated mock data has changed, and I don't know how to get it back to the original state. We might just need to re-approve these.

Far too much time has been wasted on these dynamic fixtures, I'm going to remove them. Ticket: https://cypress-io.atlassian.net/browse/UNIFY-1403.

@ryanthemanuel thanks, I removed those two junk testing files.

@elevatebart Can you please re-review?

@lmiller1990 lmiller1990 merged commit 7bb5571 into 10.0-release Mar 28, 2022
@lmiller1990 lmiller1990 deleted the lmiller1990/UNIFY-863 branch March 28, 2022 20:06
tgriesser added a commit that referenced this pull request Mar 29, 2022
* 10.0-release:
  fix(launchpad): show more specific error when default supportFile is missing (#20792)
  fix(app): show correct git status for newly created/modified files (#20744)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants