1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 07:09:43 +02:00

Disable native GitHub commits module

This commit is contained in:
Harvey Kandola 2018-04-11 15:08:03 +01:00
parent b1d677778b
commit 1ea30ee8e1
4 changed files with 8 additions and 8 deletions

View file

@ -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
}

View file

@ -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
}

View file

@ -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

View file

@ -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})