Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Switch GitGitGadget to be backed by an Azure Function and an Azure Pipeline#51

Merged
dscho merged 5 commits intogitgitgadget:mastergitgitgadget/gitgitgadget:masterfrom
dscho:switch-to-azure-functiondscho/gitgitgadget:switch-to-azure-functionCopy head branch name to clipboard
Dec 21, 2018
Merged

Switch GitGitGadget to be backed by an Azure Function and an Azure Pipeline#51
dscho merged 5 commits intogitgitgadget:mastergitgitgadget/gitgitgadget:masterfrom
dscho:switch-to-azure-functiondscho/gitgitgadget:switch-to-azure-functionCopy head branch name to clipboard

Conversation

@dscho
Copy link
Member

@dscho dscho commented Dec 21, 2018

The previous design let the GitHub App that is GitGitGadget be backed by an Azure WebApp. However:

  • The free tier does not offer any always-on mode, therefore it always took something like 2-5 minutes for the web app to be spun up.
  • Logging was also a slight problem, as only one person (yours truly) could look at it and tell what problems occurred.
  • Finally, if two PRs were /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).

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>
@dscho dscho requested a review from derrickstolee December 21, 2018 12:56
@dscho
Copy link
Member Author

dscho commented Dec 21, 2018

The first PR that went through with the new design: gitgitgadget/git#104 (comment)

@dscho dscho mentioned this pull request Dec 21, 2018
@dscho dscho merged commit 1ade86f into gitgitgadget:master Dec 21, 2018
@dscho dscho deleted the switch-to-azure-function branch December 21, 2018 17:59
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.