*: remove unneeded logging
remove many log.Info entries that where old debugging entries and move some of them to the Debug level.
This commit is contained in:
parent
5c911523c5
commit
5e21089baa
|
@ -517,7 +517,6 @@ func (d *DataManager) WriteWalAdditionalOps(ctx context.Context, actions []*Acti
|
|||
getWalsData := etcdclientv3.OpGet(etcdWalsDataKey)
|
||||
getWal := etcdclientv3.OpGet(walKey)
|
||||
|
||||
//w.log.Infof("cgt: %s", util.Dump(cgt))
|
||||
if cgt != nil {
|
||||
for cgName, cgRev := range cgt.ChangeGroupsRevisions {
|
||||
cgKey := path.Join(etcdChangeGroupsDir, cgName)
|
||||
|
|
|
@ -159,7 +159,6 @@ func (h *GitSmartHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
ctx := r.Context()
|
||||
|
||||
repoPath, reqType, err := MatchPath(r.URL.Path)
|
||||
h.log.Infof("repoPath: %s", repoPath)
|
||||
repoAbsPath, exists, err := h.repoAbsPathFunc(h.reposDir, repoPath)
|
||||
if err != nil {
|
||||
if err == ErrWrongRepoPath {
|
||||
|
@ -169,8 +168,6 @@ func (h *GitSmartHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
h.log.Infof("repoAbsPath: %s", repoAbsPath)
|
||||
h.log.Infof("repo exists: %t", exists)
|
||||
|
||||
git := &util.Git{GitDir: repoAbsPath}
|
||||
|
||||
|
@ -186,7 +183,7 @@ func (h *GitSmartHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
case RequestTypeInfoRefs:
|
||||
if h.createRepo && !exists {
|
||||
if output, err := git.Output(ctx, nil, "init", "--bare", repoAbsPath); err != nil {
|
||||
h.log.Infof("git error %v, output: %s", err, output)
|
||||
h.log.Errorf("git error %v, output: %s", err, output)
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
@ -218,7 +215,7 @@ func (h *GitSmartHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
if err := gitService(ctx, w, body, repoAbsPath, "upload-pack"); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
// we cannot return any http error since the http header has already been written
|
||||
h.log.Infof("git command error: %v", err)
|
||||
h.log.Errorf("git command error: %v", err)
|
||||
}
|
||||
case RequestTypeReceivePack:
|
||||
w.Header().Set("Content-Type", "application/x-git-receive-pack-result")
|
||||
|
@ -226,7 +223,7 @@ func (h *GitSmartHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
if err := gitService(ctx, w, body, repoAbsPath, "receive-pack"); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
// we cannot return any http error since the http header has already been written
|
||||
h.log.Infof("git command error: %v", err)
|
||||
h.log.Errorf("git command error: %v", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -254,8 +251,6 @@ func (h *FetchFileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
h.log.Infof("fetchData: %v", fetchData)
|
||||
|
||||
repoAbsPath, _, err := h.repoAbsPathFunc(h.reposDir, fetchData.RepoPath)
|
||||
if err != nil {
|
||||
if err == ErrWrongRepoPath {
|
||||
|
@ -269,6 +264,6 @@ func (h *FetchFileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
if err := gitFetchFile(ctx, w, r.Body, repoAbsPath, fetchData.Ref, fetchData.Path); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
// we cannot return any http error since the http header has already been written
|
||||
h.log.Infof("git command error: %v", err)
|
||||
h.log.Errorf("git command error: %v", err)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,7 +226,6 @@ func (h *UsersHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
// handle special queries, like get user by token
|
||||
queryType := query.Get("query_type")
|
||||
h.log.Infof("query_type: %s", queryType)
|
||||
|
||||
var users []*types.User
|
||||
switch queryType {
|
||||
|
@ -238,7 +237,6 @@ func (h *UsersHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
user, err = h.readDB.GetUserByTokenValue(tx, token)
|
||||
return err
|
||||
})
|
||||
h.log.Infof("user: %s", util.Dump(user))
|
||||
if err != nil {
|
||||
h.log.Errorf("err: %+v", err)
|
||||
httpError(w, err)
|
||||
|
@ -257,7 +255,6 @@ func (h *UsersHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
user, err = h.readDB.GetUserByLinkedAccount(tx, linkedAccountID)
|
||||
return err
|
||||
})
|
||||
h.log.Infof("user: %s", util.Dump(user))
|
||||
if err != nil {
|
||||
h.log.Errorf("err: %+v", err)
|
||||
httpError(w, err)
|
||||
|
@ -277,7 +274,6 @@ func (h *UsersHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
user, err = h.readDB.GetUserByLinkedAccountRemoteUserIDandSource(tx, remoteUserID, remoteSourceID)
|
||||
return err
|
||||
})
|
||||
h.log.Infof("user: %s", util.Dump(user))
|
||||
if err != nil {
|
||||
h.log.Errorf("err: %+v", err)
|
||||
httpError(w, err)
|
||||
|
|
|
@ -40,7 +40,7 @@ func (r *ReadDB) insertOrg(tx *db.Tx, data []byte) error {
|
|||
if err := json.Unmarshal(data, &org); err != nil {
|
||||
return errors.Errorf("failed to unmarshal org: %w", err)
|
||||
}
|
||||
r.log.Infof("inserting org: %s", util.Dump(org))
|
||||
r.log.Debugf("inserting org: %s", util.Dump(org))
|
||||
// poor man insert or update...
|
||||
if err := r.deleteOrg(tx, org.ID); err != nil {
|
||||
return err
|
||||
|
@ -209,7 +209,7 @@ func (r *ReadDB) insertOrgMember(tx *db.Tx, data []byte) error {
|
|||
if err := json.Unmarshal(data, &orgmember); err != nil {
|
||||
return errors.Errorf("failed to unmarshal orgmember: %w", err)
|
||||
}
|
||||
r.log.Infof("inserting orgmember: %s", util.Dump(orgmember))
|
||||
r.log.Debugf("inserting orgmember: %s", util.Dump(orgmember))
|
||||
// poor man insert or update...
|
||||
if err := r.deleteOrgMember(tx, orgmember.ID); err != nil {
|
||||
return err
|
||||
|
|
|
@ -306,7 +306,7 @@ func (r *ReadDB) SyncRDB(ctx context.Context) error {
|
|||
}
|
||||
}
|
||||
|
||||
r.log.Infof("startWalSeq: %s", curWalSeq)
|
||||
r.log.Debugf("startWalSeq: %s", curWalSeq)
|
||||
|
||||
// Sync from wals
|
||||
// sync from objectstorage until the current known lastCommittedStorageWal in
|
||||
|
@ -326,8 +326,8 @@ func (r *ReadDB) SyncRDB(ctx context.Context) error {
|
|||
if err != nil {
|
||||
return errors.Errorf("failed to get first available wal data: %w", err)
|
||||
}
|
||||
r.log.Infof("firstAvailableWalData: %s", util.Dump(firstAvailableWalData))
|
||||
r.log.Infof("revision: %d", revision)
|
||||
r.log.Debugf("firstAvailableWalData: %s", util.Dump(firstAvailableWalData))
|
||||
r.log.Debugf("revision: %d", revision)
|
||||
if firstAvailableWalData == nil {
|
||||
if curWalSeq != "" {
|
||||
// this happens if etcd has been reset
|
||||
|
@ -448,7 +448,7 @@ func (r *ReadDB) HandleEvents(ctx context.Context) error {
|
|||
|
||||
wctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
r.log.Infof("revision: %d", revision)
|
||||
r.log.Debugf("revision: %d", revision)
|
||||
wch := r.dm.Watch(wctx, revision+1)
|
||||
for we := range wch {
|
||||
r.log.Debugf("we: %s", util.Dump(we))
|
||||
|
@ -487,7 +487,7 @@ func (r *ReadDB) HandleEvents(ctx context.Context) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
r.log.Infof("we.WalData.WalSequence: %q", we.WalData.WalSequence)
|
||||
r.log.Debugf("we.WalData.WalSequence: %q", we.WalData.WalSequence)
|
||||
weWalEpoch := weWalSequence.Epoch
|
||||
if curWalEpoch != weWalEpoch {
|
||||
r.Initialized = false
|
||||
|
@ -665,13 +665,11 @@ func (r *ReadDB) Do(f func(tx *db.Tx) error) error {
|
|||
}
|
||||
|
||||
func (r *ReadDB) insertRevision(tx *db.Tx, revision int64) error {
|
||||
//r.log.Infof("insert revision: %d", revision)
|
||||
// poor man insert or update that works because transaction isolation level is serializable
|
||||
if _, err := tx.Exec("delete from revision"); err != nil {
|
||||
return errors.Errorf("failed to delete revision: %w", err)
|
||||
}
|
||||
// TODO(sgotti) go database/sql and mattn/sqlite3 don't support uint64 types...
|
||||
//q, args, err = revisionInsert.Values(int64(wresp.Header.ClusterId), run.Revision).ToSql()
|
||||
q, args, err := revisionInsert.Values(revision).ToSql()
|
||||
if err != nil {
|
||||
return errors.Errorf("failed to build query: %w", err)
|
||||
|
@ -710,7 +708,7 @@ func (r *ReadDB) getRevision(tx *db.Tx) (int64, error) {
|
|||
}
|
||||
|
||||
func (r *ReadDB) insertCommittedWalSequence(tx *db.Tx, seq string) error {
|
||||
r.log.Infof("insert seq: %s", seq)
|
||||
r.log.Debugf("insert seq: %s", seq)
|
||||
// poor man insert or update that works because transaction isolation level is serializable
|
||||
if _, err := tx.Exec("delete from committedwalsequence"); err != nil {
|
||||
return errors.Errorf("failed to delete committedwalsequence: %w", err)
|
||||
|
@ -742,7 +740,7 @@ func (r *ReadDB) GetCommittedWalSequence(tx *db.Tx) (string, error) {
|
|||
}
|
||||
|
||||
func (r *ReadDB) insertChangeGroupRevision(tx *db.Tx, changegroup string, revision int64) error {
|
||||
r.log.Infof("insertChangeGroupRevision: %s %d", changegroup, revision)
|
||||
r.log.Debugf("insertChangeGroupRevision: %s %d", changegroup, revision)
|
||||
|
||||
// poor man insert or update that works because transaction isolation level is serializable
|
||||
if _, err := tx.Exec("delete from changegrouprevision where id = $1", changegroup); err != nil {
|
||||
|
|
|
@ -46,7 +46,7 @@ func (r *ReadDB) insertUser(tx *db.Tx, data []byte) error {
|
|||
if err := json.Unmarshal(data, &user); err != nil {
|
||||
return errors.Errorf("failed to unmarshal user: %w", err)
|
||||
}
|
||||
r.log.Infof("inserting user: %s", util.Dump(user))
|
||||
r.log.Debugf("inserting user: %s", util.Dump(user))
|
||||
// poor man insert or update...
|
||||
if err := r.deleteUser(tx, user.ID); err != nil {
|
||||
return err
|
||||
|
@ -74,7 +74,7 @@ func (r *ReadDB) insertUser(tx *db.Tx, data []byte) error {
|
|||
}
|
||||
// insert user_token
|
||||
for _, tokenValue := range user.Tokens {
|
||||
r.log.Infof("inserting user token: %s", tokenValue)
|
||||
r.log.Debugf("inserting user token: %s", tokenValue)
|
||||
if err := r.deleteUserToken(tx, tokenValue); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -108,7 +108,6 @@ func (h *ActionHandler) CreateProject(ctx context.Context, req *CreateProjectReq
|
|||
if err != nil {
|
||||
return nil, errors.Errorf("failed to get remote source %q: %w", req.RemoteSourceName, ErrFromRemote(resp, err))
|
||||
}
|
||||
h.log.Infof("rs: %s", util.Dump(rs))
|
||||
var la *types.LinkedAccount
|
||||
for _, v := range user.LinkedAccounts {
|
||||
if v.RemoteSourceID == rs.ID {
|
||||
|
@ -116,7 +115,6 @@ func (h *ActionHandler) CreateProject(ctx context.Context, req *CreateProjectReq
|
|||
break
|
||||
}
|
||||
}
|
||||
h.log.Infof("la: %s", util.Dump(la))
|
||||
if la == nil {
|
||||
return nil, errors.Errorf("user doesn't have a linked account for remote source %q", rs.Name)
|
||||
}
|
||||
|
@ -220,7 +218,6 @@ func (h *ActionHandler) ProjectUpdateRepoLinkedAccount(ctx context.Context, proj
|
|||
if err != nil {
|
||||
return nil, errors.Errorf("failed to get remote source %q: %w", p.RemoteSourceID, ErrFromRemote(resp, err))
|
||||
}
|
||||
h.log.Infof("rs: %s", util.Dump(rs))
|
||||
var la *types.LinkedAccount
|
||||
for _, v := range user.LinkedAccounts {
|
||||
if v.RemoteSourceID == rs.ID {
|
||||
|
@ -228,7 +225,6 @@ func (h *ActionHandler) ProjectUpdateRepoLinkedAccount(ctx context.Context, proj
|
|||
break
|
||||
}
|
||||
}
|
||||
h.log.Infof("la: %s", util.Dump(la))
|
||||
if la == nil {
|
||||
return nil, util.NewErrBadRequest(errors.Errorf("user doesn't have a linked account for remote source %q", rs.Name))
|
||||
}
|
||||
|
@ -316,7 +312,6 @@ func (h *ActionHandler) ReconfigProject(ctx context.Context, projectRef string)
|
|||
}
|
||||
|
||||
la := user.LinkedAccounts[p.LinkedAccountID]
|
||||
h.log.Infof("la: %s", util.Dump(la))
|
||||
if la == nil {
|
||||
return errors.Errorf("linked account %q in user %q doesn't exist", p.LinkedAccountID, user.Name)
|
||||
}
|
||||
|
@ -377,7 +372,6 @@ func (h *ActionHandler) ProjectCreateRun(ctx context.Context, projectRef, branch
|
|||
if err != nil {
|
||||
return errors.Errorf("failed to get remote source %q: %w", p.RemoteSourceID, ErrFromRemote(resp, err))
|
||||
}
|
||||
h.log.Infof("rs: %s", util.Dump(rs))
|
||||
var la *types.LinkedAccount
|
||||
for _, v := range user.LinkedAccounts {
|
||||
if v.RemoteSourceID == rs.ID {
|
||||
|
@ -385,7 +379,6 @@ func (h *ActionHandler) ProjectCreateRun(ctx context.Context, projectRef, branch
|
|||
break
|
||||
}
|
||||
}
|
||||
h.log.Infof("la: %s", util.Dump(la))
|
||||
if la == nil {
|
||||
return util.NewErrBadRequest(errors.Errorf("user doesn't have a linked account for remote source %q", rs.Name))
|
||||
}
|
||||
|
|
|
@ -516,30 +516,25 @@ func (h *ActionHandler) genRunVariables(ctx context.Context, req *CreateRunReque
|
|||
if err != nil {
|
||||
return nil, errors.Errorf("failed to get project variables: %w", err)
|
||||
}
|
||||
h.log.Infof("pvars: %v", util.Dump(pvars))
|
||||
|
||||
// remove overriden variables
|
||||
pvars = common.FilterOverriddenVariables(pvars)
|
||||
h.log.Infof("pvars: %v", util.Dump(pvars))
|
||||
|
||||
// get project secrets
|
||||
secrets, _, err := h.configstoreClient.GetProjectSecrets(ctx, req.Project.ID, true)
|
||||
if err != nil {
|
||||
return nil, errors.Errorf("failed to get project secrets: %w", err)
|
||||
}
|
||||
h.log.Infof("secrets: %v", util.Dump(secrets))
|
||||
for _, pvar := range pvars {
|
||||
// find the value match
|
||||
var varval types.VariableValue
|
||||
for _, varval = range pvar.Values {
|
||||
h.log.Infof("varval: %v", util.Dump(varval))
|
||||
match := types.MatchWhen(varval.When, req.Branch, req.Tag, req.Ref)
|
||||
if !match {
|
||||
continue
|
||||
}
|
||||
// get the secret value referenced by the variable, it must be a secret at the same level or a lower level
|
||||
secret := common.GetVarValueMatchingSecret(varval, pvar.ParentPath, secrets)
|
||||
h.log.Infof("secret: %v", util.Dump(secret))
|
||||
if secret != nil {
|
||||
varValue, ok := secret.Data[varval.SecretVar]
|
||||
if ok {
|
||||
|
@ -549,7 +544,6 @@ func (h *ActionHandler) genRunVariables(ctx context.Context, req *CreateRunReque
|
|||
break
|
||||
}
|
||||
}
|
||||
h.log.Infof("variables: %v", util.Dump(variables))
|
||||
|
||||
return variables, nil
|
||||
}
|
||||
|
|
|
@ -168,7 +168,6 @@ func (h *ActionHandler) CreateUserLA(ctx context.Context, req *CreateUserLAReque
|
|||
if err != nil {
|
||||
return nil, errors.Errorf("failed to get remote source %q: %w", req.RemoteSourceName, ErrFromRemote(resp, err))
|
||||
}
|
||||
h.log.Infof("rs: %s", util.Dump(rs))
|
||||
var la *types.LinkedAccount
|
||||
for _, v := range user.LinkedAccounts {
|
||||
if v.RemoteSourceID == rs.ID {
|
||||
|
@ -176,7 +175,6 @@ func (h *ActionHandler) CreateUserLA(ctx context.Context, req *CreateUserLAReque
|
|||
break
|
||||
}
|
||||
}
|
||||
h.log.Infof("la: %s", util.Dump(la))
|
||||
if la != nil {
|
||||
return nil, util.NewErrBadRequest(errors.Errorf("user %q already have a linked account for remote source %q", userRef, rs.Name))
|
||||
}
|
||||
|
@ -230,7 +228,6 @@ func (h *ActionHandler) UpdateUserLA(ctx context.Context, userRef string, la *ty
|
|||
break
|
||||
}
|
||||
}
|
||||
h.log.Infof("la: %s", util.Dump(la))
|
||||
if !laFound {
|
||||
return util.NewErrBadRequest(errors.Errorf("user %q doesn't have a linked account with id %q", userRef, la.ID))
|
||||
}
|
||||
|
@ -314,7 +311,6 @@ func (h *ActionHandler) RegisterUser(ctx context.Context, req *RegisterUserReque
|
|||
if err != nil {
|
||||
return nil, errors.Errorf("failed to get remote source %q: %w", req.RemoteSourceName, ErrFromRemote(resp, err))
|
||||
}
|
||||
h.log.Infof("rs: %s", util.Dump(rs))
|
||||
|
||||
accessToken, err := common.GetAccessToken(rs, req.UserAccessToken, req.Oauth2AccessToken)
|
||||
if err != nil {
|
||||
|
@ -374,7 +370,6 @@ func (h *ActionHandler) LoginUser(ctx context.Context, req *LoginUserRequest) (*
|
|||
if err != nil {
|
||||
return nil, errors.Errorf("failed to get remote source %q: %w", req.RemoteSourceName, ErrFromRemote(resp, err))
|
||||
}
|
||||
h.log.Infof("rs: %s", util.Dump(rs))
|
||||
|
||||
accessToken, err := common.GetAccessToken(rs, req.UserAccessToken, req.Oauth2AccessToken)
|
||||
if err != nil {
|
||||
|
@ -405,7 +400,6 @@ func (h *ActionHandler) LoginUser(ctx context.Context, req *LoginUserRequest) (*
|
|||
break
|
||||
}
|
||||
}
|
||||
h.log.Infof("la: %s", util.Dump(la))
|
||||
if la == nil {
|
||||
return nil, errors.Errorf("linked account for user %q for remote source %q doesn't exist", user.Name, rs.Name)
|
||||
}
|
||||
|
@ -465,7 +459,6 @@ func (h *ActionHandler) Authorize(ctx context.Context, req *AuthorizeRequest) (*
|
|||
if err != nil {
|
||||
return nil, errors.Errorf("failed to get remote source %q: %w", req.RemoteSourceName, ErrFromRemote(resp, err))
|
||||
}
|
||||
h.log.Infof("rs: %s", util.Dump(rs))
|
||||
|
||||
accessToken, err := common.GetAccessToken(rs, req.UserAccessToken, req.Oauth2AccessToken)
|
||||
if err != nil {
|
||||
|
@ -500,7 +493,6 @@ func (h *ActionHandler) HandleRemoteSourceAuth(ctx context.Context, remoteSource
|
|||
if err != nil {
|
||||
return nil, errors.Errorf("failed to get remote source %q: %w", remoteSourceName, ErrFromRemote(resp, err))
|
||||
}
|
||||
h.log.Infof("rs: %s", util.Dump(rs))
|
||||
|
||||
switch requestType {
|
||||
case RemoteSourceRequestTypeCreateUserLA:
|
||||
|
@ -526,7 +518,6 @@ func (h *ActionHandler) HandleRemoteSourceAuth(ctx context.Context, remoteSource
|
|||
break
|
||||
}
|
||||
}
|
||||
h.log.Infof("la: %s", util.Dump(la))
|
||||
if la != nil {
|
||||
return nil, util.NewErrBadRequest(errors.Errorf("user %q already have a linked account for remote source %q", req.UserRef, rs.Name))
|
||||
}
|
||||
|
@ -555,7 +546,6 @@ func (h *ActionHandler) HandleRemoteSourceAuth(ctx context.Context, remoteSource
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
h.log.Infof("oauth2 redirect: %s", redirect)
|
||||
|
||||
return &RemoteSourceAuthResponse{
|
||||
Oauth2Redirect: redirect,
|
||||
|
@ -574,7 +564,6 @@ func (h *ActionHandler) HandleRemoteSourceAuth(ctx context.Context, remoteSource
|
|||
}
|
||||
return nil, errors.Errorf("failed to login to remote source %q with login name %q: %w", rs.Name, loginName, err)
|
||||
}
|
||||
h.log.Infof("access token: %s", accessToken)
|
||||
requestj, err := json.Marshal(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -741,7 +730,6 @@ func (h *ActionHandler) HandleOauth2Callback(ctx context.Context, code, state st
|
|||
if err != nil {
|
||||
return nil, errors.Errorf("failed to get remote source %q: %w", remoteSourceName, ErrFromRemote(resp, err))
|
||||
}
|
||||
h.log.Infof("rs: %s", util.Dump(rs))
|
||||
|
||||
oauth2Source, err := common.GetOauth2Source(rs, "")
|
||||
if err != nil {
|
||||
|
|
|
@ -50,7 +50,6 @@ func (h *CreateOrgHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
if userIDVal != nil {
|
||||
userID = userIDVal.(string)
|
||||
}
|
||||
h.log.Infof("userID: %q", userID)
|
||||
|
||||
var req CreateOrgRequest
|
||||
d := json.NewDecoder(r.Body)
|
||||
|
|
|
@ -60,7 +60,6 @@ func (h *CreateProjectGroupHandler) ServeHTTP(w http.ResponseWriter, r *http.Req
|
|||
return
|
||||
}
|
||||
userID := userIDVal.(string)
|
||||
h.log.Infof("userID: %q", userID)
|
||||
|
||||
creq := &action.CreateProjectGroupRequest{
|
||||
Name: req.Name,
|
||||
|
|
|
@ -38,8 +38,6 @@ func (h *ReposHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
vars := mux.Vars(r)
|
||||
path := vars["rest"]
|
||||
|
||||
h.log.Infof("path: %s", path)
|
||||
|
||||
u, err := url.Parse(h.gitServerURL)
|
||||
if err != nil {
|
||||
h.log.Errorf("err: %+v", err)
|
||||
|
@ -49,9 +47,6 @@ func (h *ReposHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
u.Path = path
|
||||
u.RawQuery = r.URL.RawQuery
|
||||
|
||||
h.log.Infof("u: %s", u.String())
|
||||
// TODO(sgotti) Check authorized call from client
|
||||
|
||||
defer r.Body.Close()
|
||||
// proxy all the request body to the destination server
|
||||
req, err := http.NewRequest(r.Method, u.String(), r.Body)
|
||||
|
|
|
@ -79,7 +79,6 @@ func (h *webhooksHandler) handleWebhook(r *http.Request) error {
|
|||
return util.NewErrInternal(errors.Errorf("failed to get user by linked account %q: %w", project.LinkedAccountID, err))
|
||||
}
|
||||
la := user.LinkedAccounts[project.LinkedAccountID]
|
||||
h.log.Infof("la: %s", util.Dump(la))
|
||||
if la == nil {
|
||||
return util.NewErrInternal(errors.Errorf("linked account %q in user %q doesn't exist", project.LinkedAccountID, user.Name))
|
||||
}
|
||||
|
@ -114,8 +113,6 @@ func (h *webhooksHandler) handleWebhook(r *http.Request) error {
|
|||
|
||||
cloneURL := webhookData.SSHURL
|
||||
|
||||
h.log.Infof("webhookData: %s", util.Dump(webhookData))
|
||||
|
||||
req := &action.CreateRunRequest{
|
||||
RunType: types.RunTypeProject,
|
||||
RefType: common.WebHookEventToRunRefType(webhookData.Event),
|
||||
|
|
|
@ -99,7 +99,6 @@ func (n *NotificationService) runEventsHandler(ctx context.Context) error {
|
|||
buf.Write(line[6:])
|
||||
case bytes.Equal(line, []byte("\n")):
|
||||
data := buf.Bytes()
|
||||
log.Infof("data: %s", data)
|
||||
buf.Reset()
|
||||
|
||||
var ev *rstypes.RunEvent
|
||||
|
|
|
@ -244,8 +244,8 @@ func (h *ActionHandler) recreateRun(ctx context.Context, req *RunCreateRequest)
|
|||
return nil, util.NewErrBadRequest(errors.Errorf("run %q doesn't exist: %w", req.RunID, err))
|
||||
}
|
||||
|
||||
h.log.Infof("rc: %s", util.Dump(rc))
|
||||
h.log.Infof("run: %s", util.Dump(run))
|
||||
h.log.Debugf("rc: %s", util.Dump(rc))
|
||||
h.log.Debugf("run: %s", util.Dump(run))
|
||||
|
||||
if req.FromStart {
|
||||
if canRestart, reason := run.CanRestartFromScratch(); !canRestart {
|
||||
|
@ -259,8 +259,8 @@ func (h *ActionHandler) recreateRun(ctx context.Context, req *RunCreateRequest)
|
|||
|
||||
rb := recreateRun(util.DefaultUUIDGenerator{}, run, rc, id, req)
|
||||
|
||||
h.log.Infof("created rc from existing rc: %s", util.Dump(rb.Rc))
|
||||
h.log.Infof("created run from existing run: %s", util.Dump(rb.Run))
|
||||
h.log.Debugf("created rc from existing rc: %s", util.Dump(rb.Rc))
|
||||
h.log.Debugf("created run from existing run: %s", util.Dump(rb.Run))
|
||||
|
||||
return rb, nil
|
||||
}
|
||||
|
@ -383,7 +383,7 @@ func (h *ActionHandler) saveRun(ctx context.Context, rb *types.RunBundle, runcgt
|
|||
rc := rb.Rc
|
||||
|
||||
c, cgt, err := h.getRunCounter(run.Group)
|
||||
h.log.Infof("c: %d, cgt: %s", c, util.Dump(cgt))
|
||||
h.log.Debugf("c: %d, cgt: %s", c, util.Dump(cgt))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -200,14 +200,12 @@ func (r *ReadDB) SyncRDB(ctx context.Context) error {
|
|||
}
|
||||
resp := listResp.Resp
|
||||
continuation = listResp.Continuation
|
||||
r.log.Infof("continuation: %s", util.Dump(continuation))
|
||||
|
||||
if revision == 0 {
|
||||
revision = resp.Header.Revision
|
||||
}
|
||||
|
||||
for _, kv := range resp.Kvs {
|
||||
r.log.Infof("key: %s", kv.Key)
|
||||
var run *types.Run
|
||||
if err := json.Unmarshal(kv.Value, &run); err != nil {
|
||||
return err
|
||||
|
@ -570,7 +568,7 @@ func (r *ReadDB) SyncObjectStorage(ctx context.Context) error {
|
|||
}
|
||||
}
|
||||
|
||||
r.log.Infof("startWalSeq: %s", curWalSeq)
|
||||
r.log.Debugf("startWalSeq: %s", curWalSeq)
|
||||
|
||||
// Sync from wals
|
||||
// sync from objectstorage until the current known lastCommittedStorageWal in etcd
|
||||
|
@ -590,8 +588,8 @@ func (r *ReadDB) SyncObjectStorage(ctx context.Context) error {
|
|||
if err != nil {
|
||||
return errors.Errorf("failed to get first available wal data: %w", err)
|
||||
}
|
||||
r.log.Infof("firstAvailableWalData: %s", util.Dump(firstAvailableWalData))
|
||||
r.log.Infof("revision: %d", revision)
|
||||
r.log.Debugf("firstAvailableWalData: %s", util.Dump(firstAvailableWalData))
|
||||
r.log.Debugf("revision: %d", revision)
|
||||
if firstAvailableWalData == nil {
|
||||
if curWalSeq != "" {
|
||||
// this happens if etcd has been reset
|
||||
|
@ -784,7 +782,7 @@ func (r *ReadDB) handleEventsOST(ctx context.Context) error {
|
|||
|
||||
wctx, cancel := context.WithCancel(ctx)
|
||||
defer cancel()
|
||||
r.log.Infof("revision: %d", revision)
|
||||
r.log.Debugf("revision: %d", revision)
|
||||
wch := r.dm.Watch(wctx, revision+1)
|
||||
for we := range wch {
|
||||
r.log.Debugf("we: %s", util.Dump(we))
|
||||
|
@ -824,7 +822,7 @@ func (r *ReadDB) handleEventsOST(ctx context.Context) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
r.log.Infof("we.WalData.WalSequence: %q", we.WalData.WalSequence)
|
||||
r.log.Debugf("we.WalData.WalSequence: %q", we.WalData.WalSequence)
|
||||
weWalEpoch := weWalSequence.Epoch
|
||||
if curWalEpoch != weWalEpoch {
|
||||
r.Initialized = false
|
||||
|
@ -879,7 +877,7 @@ func (r *ReadDB) applyWal(tx *db.Tx, walDataFileID string) error {
|
|||
}
|
||||
|
||||
func (r *ReadDB) applyAction(tx *db.Tx, action *datamanager.Action) error {
|
||||
r.log.Infof("action: dataType: %s, ID: %s", action.DataType, action.ID)
|
||||
r.log.Debugf("action: dataType: %s, ID: %s", action.DataType, action.ID)
|
||||
switch action.ActionType {
|
||||
case datamanager.ActionTypePut:
|
||||
switch action.DataType {
|
||||
|
@ -896,7 +894,7 @@ func (r *ReadDB) applyAction(tx *db.Tx, action *datamanager.Action) error {
|
|||
if err := json.Unmarshal(action.Data, &runCounter); err != nil {
|
||||
return err
|
||||
}
|
||||
r.log.Infof("inserting run counter %q, c: %d", action.ID, runCounter)
|
||||
r.log.Debugf("inserting run counter %q, c: %d", action.ID, runCounter)
|
||||
if err := r.insertRunCounterOST(tx, action.ID, runCounter); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -1443,7 +1441,7 @@ func scanChangeGroupsRevision(rows *sql.Rows) (types.ChangeGroupsRevisions, erro
|
|||
}
|
||||
|
||||
func (r *ReadDB) insertCommittedWalSequenceOST(tx *db.Tx, seq string) error {
|
||||
r.log.Infof("insert seq: %s", seq)
|
||||
r.log.Debugf("insert seq: %s", seq)
|
||||
// poor man insert or update that works because transaction isolation level is serializable
|
||||
if _, err := tx.Exec("delete from committedwalsequence_ost"); err != nil {
|
||||
return errors.Errorf("failed to delete committedwalsequence: %w", err)
|
||||
|
@ -1475,7 +1473,7 @@ func (r *ReadDB) GetCommittedWalSequenceOST(tx *db.Tx) (string, error) {
|
|||
}
|
||||
|
||||
func (r *ReadDB) insertChangeGroupRevisionOST(tx *db.Tx, changegroup string, revision int64) error {
|
||||
r.log.Infof("insertChangeGroupRevision: %s %d", changegroup, revision)
|
||||
r.log.Debugf("insertChangeGroupRevision: %s %d", changegroup, revision)
|
||||
|
||||
// poor man insert or update that works because transaction isolation level is serializable
|
||||
if _, err := tx.Exec("delete from changegrouprevision_ost where id = $1", changegroup); err != nil {
|
||||
|
|
|
@ -54,7 +54,6 @@ func (s *Scheduler) schedule(ctx context.Context) error {
|
|||
if err != nil {
|
||||
return errors.Errorf("failed to get queued runs: %w", err)
|
||||
}
|
||||
//log.Infof("queuedRuns: %s", util.Dump(queuedRunsResponse.Runs))
|
||||
|
||||
for _, run := range queuedRunsResponse.Runs {
|
||||
groups[run.Group] = struct{}{}
|
||||
|
@ -79,7 +78,6 @@ func (s *Scheduler) schedule(ctx context.Context) error {
|
|||
func (s *Scheduler) scheduleRun(ctx context.Context, groupID string) error {
|
||||
// get first queued run
|
||||
queuedRunsResponse, _, err := s.runserviceClient.GetGroupFirstQueuedRuns(ctx, groupID, nil)
|
||||
//log.Infof("first queuedRuns: %s", util.Dump(queuedRunsResponse.Runs))
|
||||
if err != nil {
|
||||
return errors.Errorf("failed to get the first project queued run: %w", err)
|
||||
}
|
||||
|
@ -87,7 +85,6 @@ func (s *Scheduler) scheduleRun(ctx context.Context, groupID string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
//log.Infof("queued runs: %s", queuedRunsResponse.Runs)
|
||||
run := queuedRunsResponse.Runs[0]
|
||||
|
||||
changegroup := util.EncodeSha256Hex(fmt.Sprintf("changegroup-%s", groupID))
|
||||
|
@ -95,10 +92,9 @@ func (s *Scheduler) scheduleRun(ctx context.Context, groupID string) error {
|
|||
if err != nil {
|
||||
return errors.Errorf("failed to get running runs: %w", err)
|
||||
}
|
||||
//log.Infof("running Runs: %s", util.Dump(runningRunsResponse.Runs))
|
||||
if len(runningRunsResponse.Runs) == 0 {
|
||||
log.Infof("starting run %s", run.ID)
|
||||
log.Infof("changegroups: %s", runningRunsResponse.ChangeGroupsUpdateToken)
|
||||
log.Debugf("changegroups: %s", runningRunsResponse.ChangeGroupsUpdateToken)
|
||||
if _, err := s.runserviceClient.StartRun(ctx, run.ID, runningRunsResponse.ChangeGroupsUpdateToken); err != nil {
|
||||
log.Errorf("failed to start run %s: %v", run.ID, err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue