Skip to content

Commit

Permalink
chore: merge with main
Browse files Browse the repository at this point in the history
  • Loading branch information
plyr4 committed Oct 24, 2024
1 parent a218157 commit 949b385
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
3 changes: 3 additions & 0 deletions constants/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ const (
// EventTag defines the event type for build and repo tag events.
EventTag = "tag"

// EventInstallation defines the event type for scm installation events.
EventInstallation = "installation"

// Alternates for common user inputs that do not match our set constants.

// EventPullAlternate defines the alternate event type for build and repo pull_request events.
Expand Down
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ services:
restart: always
ports:
- '8080:8080'
# dlv
- '4000:4000'
depends_on:
postgres:
condition: service_healthy
Expand Down
8 changes: 3 additions & 5 deletions scm/github/app_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func updateRepoInstallationID(ctx context.Context, webhook *internal.Webhook, r
h.SetWebhookID(webhook.Hook.GetWebhookID())
h.SetCreated(webhook.Hook.GetCreated())
h.SetHost(webhook.Hook.GetHost())
h.SetEvent("installation")
h.SetEvent(constants.EventInstallation)
h.SetStatus(webhook.Hook.GetStatus())

r, err := db.UpdateRepo(ctx, r)
Expand Down Expand Up @@ -140,7 +140,7 @@ func updateRepoInstallationID(ctx context.Context, webhook *internal.Webhook, r

// FinishInstallation completes the web flow for a GitHub App installation, returning a redirect to the app installation page.
func (c *client) FinishInstallation(ctx context.Context, request *http.Request, installID int64) (string, error) {
c.Logger.Tracef("finishing GitHub App installation")
c.Logger.Tracef("finishing GitHub App installation for ID %d", installID)

githubAppClient, err := c.newGithubAppClient(ctx)
if err != nil {
Expand All @@ -152,7 +152,5 @@ func (c *client) FinishInstallation(ctx context.Context, request *http.Request,
return "", err
}

r := install.GetHTMLURL()

return r, nil
return install.GetHTMLURL(), nil
}
4 changes: 2 additions & 2 deletions scm/github/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ func (c *client) GetBranch(ctx context.Context, r *api.Repo, branch string) (str
return data.GetName(), data.GetCommit().GetSHA(), nil
}

// CreateChecks defines a function that does stuff...
// CreateChecks authenticates with the GitHub App and creates a check run for the repo.
func (c *client) CreateChecks(ctx context.Context, r *api.Repo, commit, step, event string) (int64, error) {
// create client from GitHub App
t, err := c.newGithubAppInstallationRepoToken(ctx, r, []string{}, map[string]string{})
Expand All @@ -705,7 +705,7 @@ func (c *client) CreateChecks(ctx context.Context, r *api.Repo, commit, step, ev
return check.GetID(), nil
}

// UpdateChecks defines a function that does stuff...
// UpdateChecks authenticates with the GitHub App and updates a check run for the repo.
func (c *client) UpdateChecks(ctx context.Context, r *api.Repo, s *api.Step, commit, event string) error {
// create client from GitHub App
t, err := c.newGithubAppInstallationRepoToken(ctx, r, []string{}, map[string]string{})
Expand Down

0 comments on commit 949b385

Please sign in to comment.