Skip to content

Commit a926566

Browse files
committed
Revert "Merge branch 'develop' into feat/repos-webhooks"
This reverts commit 1ac8483, reversing changes made to ab529a6.
1 parent ba7104b commit a926566

File tree

6 files changed

+2
-72
lines changed

6 files changed

+2
-72
lines changed

backend/controllers/github.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,6 @@ func (d DiggerController) GithubAppWebHook(c *gin.Context) {
9292
c.String(http.StatusAccepted, "Failed to handle webhook event.")
9393
return
9494
}
95-
case *github.InstallationRepositoriesEvent:
96-
slog.Info("Processing InstallationRepositoriesEvent",
97-
"action", *event.Action,
98-
"installationId", *event.Installation.ID,
99-
"repositoriesAdded", len(event.RepositoriesAdded),
100-
"repositoriesRemoved", len(event.RepositoriesRemoved),
101-
)
102-
103-
err := handleInstallationRepositoriesEvent(event, appId64)
104-
if err != nil {
105-
slog.Error("Failed to handle installation repositories event", "error", err)
106-
c.String(http.StatusAccepted, "Failed to handle webhook event.")
107-
return
108-
}
10995
case *github.PushEvent:
11096
slog.Info("Processing PushEvent",
11197
"repo", *event.Repo.FullName,

backend/controllers/github_callback.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,13 @@ func (d DiggerController) GithubAppCallbackPage(c *gin.Context) {
2525
c.String(http.StatusBadRequest, "installation_id parameter for github app is empty")
2626
return
2727
}
28-
2928
//setupAction := c.Request.URL.Query()["setup_action"][0]
3029
codeParams, codeExists := c.Request.URL.Query()["code"]
31-
32-
// Code parameter is only provided for fresh installations, not for updates
33-
// If code is missing, this is likely an update - just show success page
34-
// The actual repository changes will be handled by the InstallationRepositoriesEvent webhook
3530
if !codeExists || len(codeParams) == 0 {
36-
slog.Info("No code parameter - likely an installation update, showing success page")
37-
c.HTML(http.StatusOK, "github_success.tmpl", gin.H{})
31+
slog.Error("There was no code in the url query parameters")
32+
c.String(http.StatusBadRequest, "could not find the code query parameter for github app")
3833
return
3934
}
40-
4135
code := codeParams[0]
4236
if len(code) < 1 {
4337
slog.Error("Code parameter is empty")

backend/controllers/github_test.go

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -866,34 +866,3 @@ func TestJobsTreeWithThreeLevels(t *testing.T) {
866866
assert.NoError(t, err)
867867
assert.Equal(t, result["333"].DiggerJobID, parentLinks[0].ParentDiggerJobId)
868868
}
869-
870-
func TestHandleInstallationRepositoriesEvent(t *testing.T) {
871-
teardownSuite, database := setupSuite(t)
872-
defer teardownSuite(t)
873-
874-
// Test repositories added event
875-
var addedEvent github.InstallationRepositoriesEvent
876-
err := json.Unmarshal([]byte(installationRepositoriesAddedPayload), &addedEvent)
877-
assert.NoError(t, err)
878-
879-
err = handleInstallationRepositoriesEvent(&addedEvent, 360162)
880-
assert.NoError(t, err)
881-
882-
// Verify repo was added
883-
installation, err := database.GetGithubAppInstallationByIdAndRepo(41584295, "diggerhq/test-github-action")
884-
assert.NoError(t, err)
885-
assert.NotNil(t, installation)
886-
assert.Equal(t, "diggerhq/test-github-action", installation.Repo)
887-
888-
// Test repositories removed event
889-
var removedEvent github.InstallationRepositoriesEvent
890-
err = json.Unmarshal([]byte(installationRepositoriesDeletedPayload), &removedEvent)
891-
assert.NoError(t, err)
892-
893-
err = handleInstallationRepositoriesEvent(&removedEvent, 360162)
894-
assert.NoError(t, err)
895-
896-
// Verify repo was removed (soft deleted)
897-
installation, err = database.GetGithubAppInstallationByIdAndRepo(41584295, "diggerhq/test-github-action")
898-
assert.Error(t, err) // Should error because repo is deleted
899-
}

docs/ce/howto/noise-reduction.mdx

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/docs.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
{
9191
"group": "How To",
9292
"pages": [
93-
"ce/howto/noise-reduction",
9493
"ce/howto/specify-terraform-version",
9594
"ce/howto/caching-strategies",
9695
"ce/howto/apply-on-merge",

docs/images/howto/checks.png

-355 KB
Binary file not shown.

0 commit comments

Comments
 (0)