-
Notifications
You must be signed in to change notification settings - Fork 5
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
Tag diff #14
Tag diff #14
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some slight comments about the programming style that we are following in this repo. I'll take another look soon for the APIs and the workflow
return ''.join(output) | ||
|
||
def _repr_html_(self): | ||
return print(self.gen_tables())._repr_html_() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you have to print this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The print function is used to generate the HTML in Rich
stockroom/diff.py
Outdated
table = Table(title='Diff %s..%s'%(self.ref_commit[2:7], self.dest_commit[2:7])) | ||
|
||
# Generate Columns | ||
column_headings = ['Tags'] + [self.ref_commit, self.dest_commit] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you just do ['Tags', self.ref_commit, self.dest_commit]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this seems better...will convert
stockroom/diff.py
Outdated
dest_row = "" | ||
|
||
if row in self._added: | ||
dest_row = "[green] %s [/green]"%(self._added[row]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use fstrings whenever possible. Fstrings is the new feature added to 3.6 and since we support only 3.6+, it's preferable to use that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do that
Parse the hangar.diff and store the changes in the TagDiff object | ||
""" | ||
|
||
print('Accessing ref_commit') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should print these messages; do you have any specific reason to think would help the user?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I guess not now ... but maybe later when we have the capabilities to diff with multiple branches and staged? seemed like a good info but does clutter it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hhsecond I think that for the purposes of Stockroom, it would be a good idea to implement some sort of logging which records the series of operations performed...
As we've discussed, managing branching/merging will be a bit of a coordination challenge (syncronizing branches between Git & Hangar), and i can imagine there are a few corner cases where having an audit log of
accessed commit #foo
diffed commit #foo << #bar
checking out tag "vFoo.Bar.Baz"
created branch xyz
...
would be super helpful for debugging purposes.
The hangar core can reconstruct the sequence of operations by querying it's internals directly, but since that isn't available to stockroom (It's not a public API, and never will be) it wouldn't be the worst idea to use a logging file handler to record stuff like this (even if it's not printed to the screen).
Just my 2-cents worth of input :)
This pull request introduces 2 alerts when merging 3e0bc23 into d133577 - view on LGTM.com new alerts:
|
Closing since inactive and since it has been stalled |
Adding TagDiff
Why is this change required? What problem does it solve? Describe your changes in detail:
This is used to perform a diff of the tags in Stockroom and create a neat representation of the same.
If it fixes an open issue, please link to the issue here:
#9
Screenshots (if appropriate):
Types of changes
What types of changes does your code introduce? Put an
x
in all the boxes that apply: