Mirror answers on the Git mailing list to the corresponding PRs#72
Mirror answers on the Git mailing list to the corresponding PRs#72dscho merged 22 commits intogitgitgadget:mastergitgitgadget/gitgitgadget:masterfrom dscho:mirror-replies-to-prsdscho/gitgitgadget:mirror-replies-to-prsCopy head branch name to clipboard
Conversation
|
@jeffhostetler the code in this PR generated gitgitgadget/git#108 (comment) (if you wondered about that). |
|
@jeffhostetler I know you're not necessarily familiar with the GitGitGadget code base, but maybe you could give this PR a look-over? |
kewillford
left a comment
There was a problem hiding this comment.
I would take this approval with a grain of salt considering
- I'm not that familiar with typescript
- I'm not that familiar with gitgitgadget
- I'm not that familiar with the format of git mail messages
But it looks like it works and is organized.
I was wondering if there are any tests for gitgitgadget because there is a lot of parsing going on and tests would really help validate it.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In preparation for upgrading ts-jest, fix a couple of issues where possibly undefined values really need to be verified *not* to be undefined, and avoid unused variables, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Suggested by `npm audit`. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This comes in *real* handy for debugging and developing. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It is nice and dandy if the commit-to-mail and mail-to-commit notes are reliable, but when they are not (and they seem not to, for some reason there was an uptick of unmatched commits recently), it becomes less nice and less dandy. In preparation for spending a bit more effort to identify upstream commits, allow specifying the upstream commit explicitly. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
09fde46 to
2552d43
Compare
The `git range-diff` command already has code to identify upstream commits. Since we expect those to be in `pu`, we have a *relatively* limited set of commits to choose from, therefore we can make use of the `range-diff` command. This should make the detection quite a bit more robust. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
We just spent a lot of time trying to make sure that we find the upstream commits corresponding to the PRs' original commits. Let's use that information, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This offers a much more robust (and much slower) way to detect which upstream commits correspond to the original commits in the PRs. That robustness is needed, though, as there are quite a few open PRs that do not have the correct labels because no upstream branch is associated with them, even if those branches exist in many cases. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
... because they hurt the reading flow. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It declares its fields as readonly, we need them mutable (see the next commits). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In the next commit, we will add some optional stdout processing that won't work inside an async function because it needs access to the `reject()` function of the returned Promise. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
With this option, we allow callers to specify a callback that handles every line of the input individually. This will come in handy when we will start processing the output of `git log -p` in public-inbox/git, as we will be able to handle each commit individually, together with its diff, from which we can extract the corresponding mbox. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
We will introduce more of the same kind shortly, needing the ID of the generated comment, so it makes sense to have all of them consistent. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is a bit tricky because GitHub wants a path and a position, too. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is super easy ;-) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It really is a number, not a string. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It is all nice and dandy to submit patch series from PRs, but you cannot really see the reviewers' comments in the PRs, making the entire exercise a little less fun. Let's do something about it. This new class only helps with processing the mails, but it is not hooked up with any command-line interface yet, and it also does not store the state correctly yet, e.g. "what was the latest mail we processed?" (to allow for efficient incremental processing). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is what will be used in an Azure Pipeline to mirror the mails to the PRs. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2552d43 to
6697549
Compare
It is true, if we treat the `gitOpts` variable strictly as `IGitOptions`, then it does not have an `env` field... Let's play it a bit loose by simply not stating what interface it should implement explicity, but use it as such implicitly. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Indeed, it gives a bit more confidence to have tests covering this functionality. The part that I think is the only part that is testable, though, is the parsing of the mbox file (which is already tested). The more important part is where the code actually acts on mails sent to the mailing list, which I think is not really testable, not unless I mock quite a bit of stuff into the code... which would cost me a lot of time, and might actually be buggy in and of itself? So I'll try to be lazy here ;-) Thank you for the review! |
So far, GitGitGadget has been a one-way street: commits pushed to GitGitGadgets' Git fork could be sent to the Git mailing list, but the communication about the patches had to happen there, completely.
With this PR, the answers on the Git mailing list get added as PR comments.
While the format is far from perfect (the emails are rendered in a rather ugly way, non-ASCII senders are not displayed properly, for replies to individual patches, there is no obvious link to the respective commit, etc), it is a start.
This can be seen in action at gitgitgadget/git#31 (comment)