Switch GitGitGadget to be backed by an Azure Function and an Azure Pipeline#51
Merged
dscho merged 5 commits intogitgitgadget:mastergitgitgadget/gitgitgadget:masterfrom Dec 21, 2018
dscho:switch-to-azure-functiondscho/gitgitgadget:switch-to-azure-functionCopy head branch name to clipboard
Merged
Switch GitGitGadget to be backed by an Azure Function and an Azure Pipeline#51dscho merged 5 commits intogitgitgadget:mastergitgitgadget/gitgitgadget:masterfrom dscho:switch-to-azure-functiondscho/gitgitgadget:switch-to-azure-functionCopy head branch name to clipboard
dscho merged 5 commits intogitgitgadget:mastergitgitgadget/gitgitgadget:masterfrom
dscho:switch-to-azure-functiondscho/gitgitgadget:switch-to-azure-functionCopy head branch name to clipboard
Conversation
Earlier, we used an Azure WebApp. The free tiers do not allow these WebApps to be "always on", which resulted in roughly 2 minutes of waiting time before the WebApp would kick in, and there was no way for users to see the progress. Besides, two concurrent `/submit` commands would wreak havoc because they used the same Git worktree. Let's use an Azure Function instead that does nothing else but kick off an Azure Pipeline build. Solving all of the above-mentioned problems. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The "new strategy" being to trigger an Azure Pipeline via an Azure Function (instead of doing everything in one opaque WebApp). To that end, this commit ports the Javascript code in `index.js` to the `misc-helper` (catching one bug: the `/disallow` command would have called the `disallowUser()` method that does not exist; It is called `denyUser()` instead). Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It does not make sense for random strangers to `/submit` because they are unlikely to be able to force-push improvements insofar required by the review on the Git mailing list. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This will help test this "in production". Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Let's explain the current design... Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Member
Author
|
The first PR that went through with the new design: gitgitgadget/git#104 (comment) |
Closed
derrickstolee
approved these changes
Dec 21, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous design let the GitHub App that is GitGitGadget be backed by an Azure WebApp. However:
/submitted at roughly the same time, two jobs were started that used the same Git worktree, causing the first one "to win".All of these problems go away by switching to an Azure Function/Pipeline combo. Which I already did, BTW, it simply runs from this branch until it is merged. The simple idea is: GitHub App triggers Azure Function, Azure Function does some real light-weight validation (like checking that GitHub sent the payload, that this event comes from https://github.com/gitgitgadget/git, that we're looking at a PR comment that contains a command) and then simply triggers the Azure Pipeline. This Pipeline retrieves the comment by ID, verifies that the user who authored that comment is in the permitted list, parses the command and then handles it.
One additional important benefit is that users now also get visual feedback in the form of a Check on their PR (which also offers a convenient way to access the logs).