Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion svc/ctrl/worker/deploy/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ go_library(
"//pkg/db",
"//pkg/fault",
"//pkg/logger",
"//pkg/mysql",
"//pkg/ptr",
"//pkg/uid",
"//svc/ctrl/worker/github",
Expand Down
24 changes: 15 additions & 9 deletions svc/ctrl/worker/deploy/deploy_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/unkeyed/unkey/pkg/db"
"github.com/unkeyed/unkey/pkg/fault"
"github.com/unkeyed/unkey/pkg/logger"
"github.com/unkeyed/unkey/pkg/mysql"
"github.com/unkeyed/unkey/pkg/uid"
githubclient "github.com/unkeyed/unkey/svc/ctrl/worker/github"
)
Expand Down Expand Up @@ -983,24 +982,31 @@ func (w *Workflow) initGitHubStatus(
}

repoConn, err := restate.Run(ctx, func(runCtx restate.RunContext) (db.GithubRepoConnection, error) {
return db.Query.FindGithubRepoConnectionByAppId(runCtx, w.db.RO(), deployment.AppID)
found, findErr := db.Query.FindGithubRepoConnectionByAppId(runCtx, w.db.RO(), deployment.AppID)
if findErr != nil {
if db.IsNotFound(findErr) {
// No connection — return zero value, not an error.
// Returning an error here would cause Restate to retry forever.
return db.GithubRepoConnection{}, nil //nolint:exhaustruct
}
return db.GithubRepoConnection{}, findErr //nolint:exhaustruct
}
return found, nil
}, restate.WithName("find github repo connection"))
if err != nil {
if !mysql.IsNotFound(err) {
logger.Warn("failed to look up github repo connection, skipping deployment status reporting",
"app_id", deployment.AppID,
"error", err,
)
}
logger.Warn("failed to look up github repo connection, skipping deployment status reporting",
"app_id", deployment.AppID,
"error", err,
)

return reporter
}

if repoConn.InstallationID == 0 {
logger.Info("no github repo connection, skipping deployment status reporting",
"app_id", deployment.AppID,
"error", err,
)

return reporter
}

Expand Down
Loading