Skip to content

Retreive and store git tags on the commit model - #9383

Merged
rafeca merged 23 commits into
developmentfrom
feature/add-tags-to-commit-model
Apr 6, 2020
Merged

rafeca merged 23 commits into
developmentfrom
feature/add-tags-to-commit-model

Conversation

@outofambit

@outofambit outofambit commented Mar 27, 2020 •

Copy link
Copy Markdown
Contributor

closes #9425

Description

  • adds tags to getCommits git command
  • adds parsing to extract that tag information
  • adds field to commit model to store that information in
  • adds unit tests to cover this codepath (including a new fixture git repo)
  • display tags in commit summary UI (thanks @rafeca!)
    • no display on the commit list itself (that'll come in a later PR)
  • feature flag for the UI portion of this

Reviewing and Testing Notes

You can ignore all the added files in app/test/fixtures.

I think the only thing to test here is to make sure that all tags associated with a commit show up in the commit details UI.

Screen Shot 2020-04-02 at 3 20 03 PM

@rafeca

rafeca commented Mar 31, 2020 •

Copy link
Copy Markdown
Contributor

It's possible that the tag information may be missing for some commits stored in state, because getBranches uses a git command that can't extract that information when it gets the tip of each branch. I've verified this is a problem and am looking into ways to address it.

I've created a new branch simplify-branch-tip based on this one which tries to address this (relevant commit: 8339aa7).

What I've done is creating a new structure to store the branch tip which contains much less information than a commit (it only contains the sha and the commitIdentity, which is the required data to show on the branches UI). Good thing is that this allows us to request less data in the getBranches() method, which I guess will mean faster load times with repos with lots of branches.

I've done this in a separate branch because I wanted to get your opinion on this approach first

@rafeca

rafeca commented Mar 31, 2020

Copy link
Copy Markdown
Contributor

👋I've added 350dea1 to this branch which shows the list of tags on the commit view:

Screenshot 2020-03-31 at 16 32 38

(haven't added them yet on the history tab, since afaik the designs are not final)

@outofambit
outofambit dismissed a stale review via c1cfe2c April 2, 2020 22:00
@outofambit
outofambit force-pushed the feature/add-tags-to-commit-model branch from 350dea1 to c1cfe2c Compare April 2, 2020 22:00
@outofambit
outofambit dismissed a stale review via a5effd4 April 2, 2020 22:02
@outofambit
outofambit dismissed a stale review via 6377769 April 2, 2020 22:10
@outofambit
outofambit marked this pull request as ready for review April 2, 2020 22:12
@outofambit
outofambit requested a review from rafeca April 2, 2020 22:13
@outofambit
outofambit dismissed a stale review via b8dd489 April 2, 2020 22:20
@outofambit
outofambit requested a review from tierninho April 2, 2020 22:21
tierninho
tierninho previously approved these changes Apr 3, 2020

@tierninho tierninho left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All tags retrieved/deleted in command line were successfully updated. All tags for Github.com were retrieved ok. I could not get deleted tags from Github.com to disappear from Desktop, but as the PR says "retrieve" I will add this to tests as the feature progresses.

I take it this is WIP:
Screen Shot 2020-04-02 at 2 34 03 PM

rafeca
rafeca previously approved these changes Apr 3, 2020

@rafeca rafeca left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread app/test/unit/create-branch-test.ts Resolved
Comment on lines +50 to +58
const commits = await getCommits(repository, 'HEAD', 100)
expect(commits).toBeArrayOfSize(5)

expect(commits[0].tags).toIncludeSameMembers(['important'])
expect(commits[1].tags).toIncludeSameMembers([
'tentative',
'less-important',
])
expect(commits[2].tags).toBeArrayOfSize(0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This kind of tests are super nice! 😍

This comment was marked as spam.

@outofambit

Copy link
Copy Markdown
Contributor Author

All tags retrieved/deleted in command line were successfully updated. All tags for Github.com were retrieved ok. I could not get deleted tags from Github.com to disappear from Desktop, but as the PR says "retrieve" I will add this to tests as the feature progresses.

@tierninho yes that's right!

I take it this is WIP:
Screen Shot 2020-04-02 at 2 34 03 PM

@tierninho oh that is not an intentional regression! fixing now

@outofambit
outofambit dismissed stale reviews from rafeca, tierninho, and ghost via 142a870 April 3, 2020 17:53
@outofambit

Copy link
Copy Markdown
Contributor Author

@tierninho can you please verify the changed file list css is fixed now with 142a870?

@outofambit
outofambit requested review from rafeca and tierninho April 3, 2020 17:57
tierninho
tierninho previously approved these changes Apr 3, 2020

@tierninho tierninho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changed files back to normal on Mac/Windows 👍

Add createTag() method to git library wrapper
@outofambit
outofambit dismissed stale reviews from tierninho and ghost via 23b7436 April 3, 2020 20:12
@rafeca

rafeca commented Apr 6, 2020

Copy link
Copy Markdown
Contributor

@tierninho oh that is not an intentional regression! fixing now

Ups sorry about that, I introduced this in 8988dce 🤡

@rafeca
rafeca merged commit 124fbfb into development Apr 6, 2020
@rafeca
rafeca deleted the feature/add-tags-to-commit-model branch April 6, 2020 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add place to store tags in desktop

4 participants