Skip to content

Do handle the "What's cooking" mails correctly - #487

Merged
dscho merged 3 commits into
gitgitgadget:mainfrom
dscho:do-handle-whats-cooking
Mar 8, 2021
Merged

dscho merged 3 commits into
gitgitgadget:mainfrom
dscho:do-handle-whats-cooking

Conversation

@dscho

@dscho dscho commented Mar 8, 2021

Copy link
Copy Markdown
Member

In reacting to the review of #458, I managed to break the central part of it. D'oh.

dscho added 3 commits March 8, 2021 16:22
In the review of gitgitgadget#458,
we decided to go for a `Map` to store the parsed branches (a previous
iteration had used a plain old Javascript object instead).

The one user of this map was not updated accordingly.

This prevented
https://dev.azure.com/gitgitgadget/git/_build/results?buildId=78770 from
handling the "What's cooking" mail properly, even though
https://lore.kernel.org/git/xmqqlfb4k0h8.fsf@gitster.c.googlers.com/ was
properly parsed correctly (in https://lore.kernel.org/git/0, that mail
was added via 3ae7c4db85fed3028585ead06e2da1d8a11316b0).

Let's fix this.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Thank you, ESLint.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This should make it easier to diagnose potential hiccups in the future.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
dscho merged commit 3046dff into gitgitgadget:main Mar 8, 2021
@dscho
dscho deleted the do-handle-whats-cooking branch March 8, 2021 19:11
if (!sousChef.messageID) {
throw new Error(`Could not parse Message-ID of ${mbox}`);
}
console.log(`Handling "${sousChef.subject}"`);

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.

Just noting that in the unlikely event subject is not found the log will say:

  console.log
    Handling "undefined"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right... Still better than saying nothing at all ;-)

console.log(`Handling "${sousChef.subject}"`);
const whatsCookingBaseURL = "https://lore.kernel.org/git/";
for (const branchName of Object.keys(sousChef.branches)) {
for (const branchName of sousChef.branches.keys()) {

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.

Sorry I missed this (I had updated in my local test branch). May need to look at creating tests for MailArchiveGitHelper.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That would be nice. I am not quite comfortable yet adding these tests...

@dscho

dscho commented Mar 10, 2021

Copy link
Copy Markdown
Member Author

So... https://lore.kernel.org/git/xmqqft1542wu.fsf@gitster.c.googlers.com/ has been sent on Monday, and it looks as if this PR did its job (see e.g. gitgitgadget/git#889 (comment))!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants