-
Notifications
You must be signed in to change notification settings - Fork 146
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
Document what to do with duplicate items #33
Comments
Continuing on from above with the review comments, for commit fd4109d the review comments are in note 0328cd2a389f. Review Comments
It appears there's no way to update review comments other than replying with a new message? I guess that's ok, I just like being able to go back and fix spelling mistakes when needed. So again there's no issue with duplicates, they're all just individual items.
|
Just took a look at the actual source and it seems that for the review request it just takes the last written (in the file, ignoring the timestamp values) request, while for the CI statuses it checks the timestamps and only uses the latest one for the build status message. |
Everything you've said seems spot-on, but in particular the comment about us needing to explicitly document this stuff in the spec is absolutely right. I'll take a pass at the spec later today and try to make things more clear, but it is easy for me to overlook something being under-specified, so please take another look after I do that. As for the specific details:
Normally, since we always write the timestamp first, and notes are either appended to the end or merged using cat_sort_uniq, this final line will also be the one with the latest timestamp. However, that isn't very reliable, so I think we should change it to explicitly sort them in-memory and take the one with the latest timestamp. The particular requests you saw with identical timestamps seem to be a side effect of a recent change I made to our script that mirrors pull requests into git-appraise. I don't expect this to happen very often, but we do need a solid (official) story for how that should be interpreted. I'll think about it some more. Think of this as the equivalent of sending emails to a pull request in a mailing list; you can't unsend email, so not being able to edit a comment after the fact seemed reasonable. That being said, it's just stored in git history, and that is mutable. I could see us adding a command to update a comment that hasn't been pushed to a remote yet, but once you push it to a remote, then that seems too late to undo (e.g. what if someone posts another comment responding to your typo?).
Thanks for looking into this and pointing out the ambiguities. |
A follow up question, @Nemo157: I assume the context for this is your git-appraise-rs project... Do you intend to open source that? If so, could you add licensing information to the repo (e.g. a LICENSE or COPYING file)? If you do, then would you like us to add a link to that project from the git-appraise README? |
@ojarjur Yes, yes and sure 😄 I'll split the repo as well into just the base library and the web interface, so if you link to the existing repo as just a rust client library for interacting with the git-appraise notes in a repository that would be great. I should get to that at some point tonight, I'll ping you once it's done. Probably not worth linking to the web interface wherever that ends up, at least until I get it actually useful 😄. |
@ojarjur Done, https://github.com/Nemo157/git-appraise-rs now contains just the client library, dual licensed under MIT and Apache v2. The web service has been moved to https://github.com/Nemo157/git-appraise-server in case you wanted to find it. |
Previously, the tool was taking the last request in a note as being the current one, and relying on the combination of appending notes and merging them using "cat_sort_uniq" to make that correspond to the request with the latest timestamp. However, that was neither as robust as it could be, nor was it documented in our spec. This change makes the tool pick the last request by timestamp, and updates the spec to indicate that this is how the notes should be interpreted. This change also makes the sorting of both requests and comments stable, and extends the Summary struct to store all of the review requests in addition to storing the current one. This change is a (partial) response to feedback in #33.
Formalize how to handle multiple review requests on a commit. Previously, the tool was taking the last request in a note as being the current one, and relying on the combination of appending notes and merging them using "cat_sort_uniq" to make that correspond to the request with the latest timestamp. However, that was neither as robust as it could be, nor was it documented in our spec. This change makes the tool pick the last request by timestamp, and updates the spec to indicate that this is how the notes should be interpreted. This change also makes the sorting of both requests and comments stable, and extends the Summary struct to store all of the review requests in addition to storing the current one. This change is a (partial) response to feedback in #33.
I can probably work out what to do by checking the code, but it would be good for this to be defined as part of the format. An example is for the review on fd4109d, this has reviews stored under note e81a4e0ea017 and CI status under note 4914d5adea78. Using
git show
to view the notes directly givesReview
For this I assume just taking the latest instance would be appropriate.
CI Status
Since there are multiple agents submitting their CI status I guess the latest entry from each unique
url
(oragent
whenurl
is missing?) value may be appropriate.These are the only parts of the spec that I've really looked into so far. A quick glance at robot comments seems like it should be ok since there's nothing there to update, I'll take a deeper look at review comments and add an update.
The text was updated successfully, but these errors were encountered: