Commit 20fd3163 authored by Eric Stroczynski's avatar Eric Stroczynski Committed by GitHub

Merge pull request #1036 from estroz/debug-to-info-github

connector/github: debug->info logging, informative userInOrg msg
parents b84721cb 5894d017
...@@ -350,9 +350,8 @@ func (c *githubConnector) listGroups(ctx context.Context, client *http.Client, u ...@@ -350,9 +350,8 @@ func (c *githubConnector) listGroups(ctx context.Context, client *http.Client, u
// 'teams' list in config. // 'teams' list in config.
if len(org.Teams) == 0 { if len(org.Teams) == 0 {
inOrgNoTeams = true inOrgNoTeams = true
c.logger.Debugf("github: user %q in org %q", userName, org.Name)
} else if teams = filterTeams(teams, org.Teams); len(teams) == 0 { } else if teams = filterTeams(teams, org.Teams); len(teams) == 0 {
c.logger.Debugf("github: user %q in org %q but no teams", userName, org.Name) c.logger.Infof("github: user %q in org %q but no teams", userName, org.Name)
} }
// Orgs might have the same team names. We append orgPrefix to team name, // Orgs might have the same team names. We append orgPrefix to team name,
...@@ -360,7 +359,6 @@ func (c *githubConnector) listGroups(ctx context.Context, client *http.Client, u ...@@ -360,7 +359,6 @@ func (c *githubConnector) listGroups(ctx context.Context, client *http.Client, u
orgPrefix := org.Name + ":" orgPrefix := org.Name + ":"
for _, teamName := range teams { for _, teamName := range teams {
groups = append(groups, orgPrefix+teamName) groups = append(groups, orgPrefix+teamName)
c.logger.Debugf("github: user %q in org %q team %q", userName, org.Name, teamName)
} }
} }
if inOrgNoTeams || len(groups) > 0 { if inOrgNoTeams || len(groups) > 0 {
...@@ -542,7 +540,7 @@ func (c *githubConnector) userInOrg(ctx context.Context, client *http.Client, us ...@@ -542,7 +540,7 @@ func (c *githubConnector) userInOrg(ctx context.Context, client *http.Client, us
switch resp.StatusCode { switch resp.StatusCode {
case http.StatusNoContent: case http.StatusNoContent:
case http.StatusFound, http.StatusNotFound: case http.StatusFound, http.StatusNotFound:
c.logger.Debugf("github: user %q not in org %q", userName, orgName) c.logger.Infof("github: user %q not in org %q or application not authorized to read org data", userName, orgName)
default: default:
err = fmt.Errorf("github: unexpected return status: %q", resp.Status) err = fmt.Errorf("github: unexpected return status: %q", resp.Status)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment