Skip to content

Baseline stashing metrics - #7438

Merged
shiftkey merged 31 commits into
developmentfrom
baseline-stashing-metrics
May 29, 2019
Merged

shiftkey merged 31 commits into
developmentfrom
baseline-stashing-metrics

Conversation

@iAmWillShepherd

@iAmWillShepherd iAmWillShepherd commented Apr 30, 2019 •

Copy link
Copy Markdown
Contributor

partly addresses #7246

This pr has been updated to adjust the basline stashing metrics implemented in #7470 by merging getDesktopStashEntries and getStash.

William Shepherd and others added 10 commits April 30, 2019 14:58
Co-Authored-By: Billy Griffin <[email protected]>
Co-Authored-By: Billy Griffin <[email protected]>
This is needed because we want to add the entries for each repo opened during the day
This number will vary based on which repos the user opens during this period
Moving this here ensures another state refresh doesn't cause the same repo to be counted twice
@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

@tierninho testing this one is a bit involved, so let me know if you'd like to pair.

In the meantime, you can use these steps to test.

The number of stash entries created outside of Desktop

Try to make sure to delete all application databases before each scenario. Doing this will ensure you aren't effected by the 24 hour check cycle and makes verifying values a tad easier.

Only count stash entries that don't use our marker

For this scenario you'll need a repo with a mix of stash entries created with Desktop and externally (keeping count will be really important).

  1. Add your repo
  2. Verify that stashesCreatedOutsideOfDesktop is what you expect

What I'm getting on my repo
Screen Shot 2019-04-30 at 4 55 57 PM
Your result will likely differ from mine

Stash Checks are scoped per repo

This scenario will verify that each repo keeps track of its own check date for stash entries. You will need another repo, in addition to the one mentioned above. Like last time, knowing how many stash entries were created by Desktop and outside of Desktop is important.

  1. Do the first scenario (Only count stash entries that don't use our marker)
  2. Add your new test repo
  3. Verify that stashesCreatedOutsideOfDesktop is the previous value plus the number of non-Desktop stash entries your test repo has
  4. Switch back to the repo added in step 1
  5. Verify that stashesCreatedOutsideOfDesktop is the same as it was in step 3
  6. Switch back to the repo added in step 2
  7. Verify that stashesCreatedOutsideOfDesktop is the same as it was in step 5

Switching back and forth is necessary since the logic that acts as a gatekeeper to this metric is called every state refresh.

The number of times the user has been presented with the DugiteError.LocalChangesOverwritten error

You will need to return false from enableStashing

/** Should the app show the "stash changes" dialog? */
export function enableStashing(): boolean {
return enableBetaFeatures()
}

  1. Setup a repo with 2 branches such that master is at least 1 commit ahead of the descending branch
  2. Switch branches
  3. You should get an error message
  4. verify that errorWhenSwitchingBranchesWithUncommmittedChanges has incremented by 1

Comment thread app/src/lib/stats/stats-database.ts Resolved
@tierninho
tierninho self-requested a review April 30, 2019 22:13
@iAmWillShepherd iAmWillShepherd added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 1, 2019
@iAmWillShepherd iAmWillShepherd added this to the 1.7.0 milestone May 1, 2019
@iAmWillShepherd
iAmWillShepherd requested a review from a team May 1, 2019 16:19
@iAmWillShepherd iAmWillShepherd removed the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 1, 2019
@tierninho

tierninho commented May 1, 2019 •

Copy link
Copy Markdown
Contributor

Thanks for the detailed steps.

  • ✅ Verifying that stashesCreatedOutsideOfDesktop correctly tracks stashes outside of Desktop.
  • Had some trouble with errorWhenSwitchingBranchesWithUncommmittedChanges. Couldn't get the error to trigger. Does a stash have to be present? Do I have to wipe the DBs for this as well?

@outofambit
outofambit removed the request for review from a team May 1, 2019 22:53
@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed steps.

  • ✅ Verifying that stashesCreatedOutsideOfDesktop correctly tracks stashes outside of Desktop.
  • Had some trouble with errorWhenSwitchingBranchesWithUncommmittedChanges. Couldn't get the error to trigger. Does a stash have to be present? Do I have to wipe the DBs for this as well?

You have to disable the enableStashing feature flag by returning false. Once that's done, you can get the error to popup by

  1. Branching from development
  2. Committing a change on your new branch
  3. Moving development ahead of your new branch
  4. Making changes on your new branch without committing them
  5. Checking out development

That last step should result in an error being generated.

@tierninho
tierninho removed their request for review May 3, 2019 21:53
@tierninho

Copy link
Copy Markdown
Contributor

Not sure if my env is configured wrong or it's another issue, but cannot seem to get the remaining test working. I feel confident that this already functions correctly, and as it is very low risk, I am ok with shipping to beta. I will easily be able to test it then.

@trisa88

This comment has been minimized.

@iAmWillShepherd

This comment has been minimized.

@iAmWillShepherd

iAmWillShepherd commented May 14, 2019 •

Copy link
Copy Markdown
Contributor Author

@niik spotted that the initial implementation of baseline metrics checks for stash entries in the selectRepository while this one does it in refreshRepository ( comment). This is just a note ensure this gets done.

@shiftkey shiftkey added the epic:stashing Tracking label for work related to the stashing flow label May 20, 2019
@iAmWillShepherd
iAmWillShepherd requested a review from a team May 28, 2019 14:07
@iAmWillShepherd iAmWillShepherd added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label May 28, 2019
@outofambit outofambit self-assigned this May 28, 2019
Comment thread app/src/models/stash-entry.ts Resolved
Comment thread app/src/lib/git/stash.ts Resolved
Comment thread app/src/lib/git/stash.ts Resolved
Comment thread app/src/lib/stores/app-store.ts Resolved
Comment thread app/src/lib/git/stash.ts Resolved

@shiftkey shiftkey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Some extra cleanup to follow up with @outofambit's feedback

Comment thread app/src/lib/stores/app-store.ts Resolved
Comment thread app/src/lib/stores/app-store.ts Resolved
Comment thread app/src/lib/stores/git-store.ts Resolved
@outofambit

Copy link
Copy Markdown
Contributor

all review comments should be addressed now

@outofambit
outofambit requested a review from shiftkey May 28, 2019 22:11

@shiftkey shiftkey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nothing blocking, just this suggestion left to look at afterwards

Comment thread app/src/lib/git/stash.ts
repository: Repository
): Promise<ReadonlyArray<IStashEntry>> {
): Promise<{
/** The stash entries created by Desktop */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🎨 given the presence of code comments here, this feels like it could be extracted to it's own internal type after we land this PR to keep things more organized...

@shiftkey
shiftkey merged commit 9a59e09 into development May 29, 2019
@shiftkey
shiftkey deleted the baseline-stashing-metrics branch May 29, 2019 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

epic:stashing Tracking label for work related to the stashing flow ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants