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

return branch heads in repo log method #125

Merged
merged 1 commit into from
Oct 8, 2019
Merged

Conversation

rlizzo
Copy link
Member

@rlizzo rlizzo commented Oct 2, 2019

Motivation and Context

Why is this change required? What problem does it solve?:

Add more useful branch info to log output

If it fixes an open issue, please link to the issue here:

Description

Describe your changes in detail:

branch_heads key now returned along side the rest of the info.

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • Documentation update
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Is this PR ready for review, or a work in progress?

  • Ready for review
  • Work in progress

How Has This Been Tested?

Put an x in the boxes that apply:

  • Current tests cover modifications made
  • New tests have been added to the test suite
  • Modifications were made to existing tests to support these changes
  • Tests may be needed, but they are not included when the PR was proposed
  • I don't know. Help!

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have signed (or will sign when prompted) the tensorwork CLA.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@rlizzo rlizzo added Bug: Priority 3 No risk of data/record corruption or loss; No user facing impacts Awaiting Review Author has determined PR changes area nearly complete and ready for formal review. labels Oct 2, 2019
@rlizzo rlizzo requested a review from hhsecond October 2, 2019 15:01
@codecov
Copy link

codecov bot commented Oct 2, 2019

Codecov Report

Merging #125 into master will increase coverage by 0.06%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           master    #125      +/-   ##
=========================================
+ Coverage   92.03%   92.1%   +0.06%     
=========================================
  Files          60      60              
  Lines       10005   10087      +82     
  Branches      997     999       +2     
=========================================
+ Hits         9208    9290      +82     
  Misses        582     582              
  Partials      215     215
Impacted Files Coverage Δ
tests/test_visualizations.py 100% <100%> (ø) ⬆️
src/hangar/repository.py 96.64% <100%> (+0.12%) ⬆️
src/hangar/utils.py 82.99% <100%> (ø) ⬆️

@rlizzo
Copy link
Member Author

rlizzo commented Oct 3, 2019

@hhsecond, does this work for your purposes?

I chose to go with a mapping between

'commit_digest' -> List['BranchName1', 'BranchName2']

rather than a reverse mapping of branch names to (possibly duplicate) commits in order to keep in line with the other layout of results (ancestors -> List[ commid_digest(s) ] / commit_digest -> Dict[ commit_message, time, etc. ])

ie.

'ancestors': {
    '0ff3f2ec156ab8e1026b5271630ccae4556cc260': [''],
    '3c9530ac0da1106c0acbe1201900c51548bbcdd9'': ['fed88489ab6e59913aee935169b15fe68755d82c'],
    'fed88489ab6e59913aee935169b15fe68755d82c': ['0ff3f2ec156ab8e1026b5271630ccae4556cc260']
}

'specs': {'0ff3f2ec156ab8e1026b5271630ccae4556cc260': {
                'commit_message': 'first commit adding training images and labels',
                'commit_time': 1562203787.257128, 'commit_user': 'Foo User', 'commit_email': 'foo@bar.com'},
          '3c9530ac0da1106c0acbe1201900c51548bbcdd9': {
                'commit_message': 'added testing labels only',
                'commit_time': 1562203787.388417, 'commit_user': 'Foo User', 'commit_email': 'foo@bar.com'},
          'fed88489ab6e59913aee935169b15fe68755d82c': {
                'commit_message': 'added testing images only',
                'commit_time': 1562203787.372292, 'commit_user': 'Foo User', 'commit_email': 'foo@bar.com'}}
}

so that the result now includes something which looks like:

'branch_heads': {
        '3c9530ac0da1106c0acbe1201900c51548bbcdd9': ['add-test'],
        'e5ea58dd9c7ffacd45fb128ddc00aced08d13889': ['add-validation'],
        '074f81d6b9fa5fa856175d47c7cc95cc4a839965': ['master', 'dev-branch'],
}

I could make a case for both mapping directions, so let me know if you have an opinion to add. I'm OK either way.

Copy link
Member

@hhsecond hhsecond left a comment

Choose a reason for hiding this comment

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

Looks good for my use case

@rlizzo
Copy link
Member Author

rlizzo commented Oct 8, 2019

Great! Merging now!

@rlizzo rlizzo merged commit 84417d5 into tensorwerk:master Oct 8, 2019
@rlizzo rlizzo deleted the repo-log branch October 15, 2019 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Review Author has determined PR changes area nearly complete and ready for formal review. Bug: Priority 3 No risk of data/record corruption or loss; No user facing impacts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG REPORT] repo log doesn't return branch information when return_contents is True
2 participants