diff --git a/domain/section/github/commits.go b/domain/section/github/commits.go index 4da91c83..1a4861e3 100644 --- a/domain/section/github/commits.go +++ b/domain/section/github/commits.go @@ -145,6 +145,7 @@ func getCommits(client *gogithub.Client, config *githubConfig) ([]githubCommit, guff, _, err := client.Repositories.ListCommits(context.Background(), orb.Owner, orb.Repo, opts) if err != nil { + fmt.Println(err) return nil, nil, err } diff --git a/domain/section/github/github.go b/domain/section/github/github.go index b1c68639..7e83dc48 100644 --- a/domain/section/github/github.go +++ b/domain/section/github/github.go @@ -153,6 +153,7 @@ func (p *Provider) Refresh(ctx *provider.Context, configJSON, data string) strin err := json.Unmarshal([]byte(configJSON), &c) if err != nil { + p.Runtime.Log.Error("github.Refresh unmarshal", err) return "internal configuration error '" + err.Error() + "'" } @@ -163,6 +164,7 @@ func (p *Provider) Refresh(ctx *provider.Context, configJSON, data string) strin byts, err := json.Marshal(refreshReportData(&c, client)) if err != nil { + p.Runtime.Log.Error("github.Refresh marshal", err) return "internal configuration error '" + err.Error() + "'" } @@ -195,6 +197,7 @@ func (p *Provider) Render(ctx *provider.Context, config, data string) string { data = strings.TrimSpace(data) if len(data) == 0 { + p.Runtime.Log.Info("GitHub connector received empty data for rendering") // TODO review why this error occurs & if it should be reported - seems to occur for new sections // log.ErrorString(fmt.Sprintf("Rendered empty github JSON payload as '' for owner %s repos %#v", c.Owner, c.Lists)) return "" @@ -225,9 +228,7 @@ func (p *Provider) Render(ctx *provider.Context, config, data string) string { } t := template.New("github") - t, err = t.Parse(rep.template) - if err != nil { p.Runtime.Log.Error("github render template.Parse error:", err) //for k, v := range strings.Split(rep.template, "\n") { @@ -246,5 +247,6 @@ func (p *Provider) Render(ctx *provider.Context, config, data string) string { ret += buffer.String() } + return ret } diff --git a/domain/section/github/summary.go b/domain/section/github/summary.go index 9ad50988..6388df6d 100644 --- a/domain/section/github/summary.go +++ b/domain/section/github/summary.go @@ -11,15 +11,13 @@ package github -import ( - gogithub "github.com/google/go-github/github" -) +import gogithub "github.com/google/go-github/github" const ( tagSummaryData = "summaryData" ) -// sort branches in order that that should be presented. +// sort branches in order that they should be presented. type branchesToSort []githubBranch diff --git a/domain/section/register.go b/domain/section/register.go index c86fa5c6..7edfb685 100644 --- a/domain/section/register.go +++ b/domain/section/register.go @@ -19,7 +19,6 @@ import ( "github.com/documize/community/domain/section/airtable" "github.com/documize/community/domain/section/code" "github.com/documize/community/domain/section/gemini" - "github.com/documize/community/domain/section/github" "github.com/documize/community/domain/section/markdown" "github.com/documize/community/domain/section/papertrail" "github.com/documize/community/domain/section/plantuml" @@ -33,7 +32,7 @@ import ( func Register(rt *env.Runtime, s *domain.Store) { provider.Register("code", &code.Provider{Runtime: rt, Store: s}) provider.Register("gemini", &gemini.Provider{Runtime: rt, Store: s}) - provider.Register("github", &github.Provider{Runtime: rt, Store: s}) + // provider.Register("github", &github.Provider{Runtime: rt, Store: s}) provider.Register("markdown", &markdown.Provider{Runtime: rt, Store: s}) provider.Register("papertrail", &papertrail.Provider{Runtime: rt, Store: s}) provider.Register("table", &table.Provider{Runtime: rt, Store: s})