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:
parent
b1d677778b
commit
1ea30ee8e1
4 changed files with 8 additions and 8 deletions
|
@ -145,6 +145,7 @@ func getCommits(client *gogithub.Client, config *githubConfig) ([]githubCommit,
|
||||||
guff, _, err := client.Repositories.ListCommits(context.Background(), orb.Owner, orb.Repo, opts)
|
guff, _, err := client.Repositories.ListCommits(context.Background(), orb.Owner, orb.Repo, opts)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
fmt.Println(err)
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -153,6 +153,7 @@ func (p *Provider) Refresh(ctx *provider.Context, configJSON, data string) strin
|
||||||
|
|
||||||
err := json.Unmarshal([]byte(configJSON), &c)
|
err := json.Unmarshal([]byte(configJSON), &c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
p.Runtime.Log.Error("github.Refresh unmarshal", err)
|
||||||
return "internal configuration error '" + err.Error() + "'"
|
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))
|
byts, err := json.Marshal(refreshReportData(&c, client))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
p.Runtime.Log.Error("github.Refresh marshal", err)
|
||||||
return "internal configuration error '" + err.Error() + "'"
|
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)
|
data = strings.TrimSpace(data)
|
||||||
if len(data) == 0 {
|
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
|
// 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))
|
// log.ErrorString(fmt.Sprintf("Rendered empty github JSON payload as '' for owner %s repos %#v", c.Owner, c.Lists))
|
||||||
return ""
|
return ""
|
||||||
|
@ -225,9 +228,7 @@ func (p *Provider) Render(ctx *provider.Context, config, data string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
t := template.New("github")
|
t := template.New("github")
|
||||||
|
|
||||||
t, err = t.Parse(rep.template)
|
t, err = t.Parse(rep.template)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
p.Runtime.Log.Error("github render template.Parse error:", err)
|
p.Runtime.Log.Error("github render template.Parse error:", err)
|
||||||
//for k, v := range strings.Split(rep.template, "\n") {
|
//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()
|
ret += buffer.String()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,15 +11,13 @@
|
||||||
|
|
||||||
package github
|
package github
|
||||||
|
|
||||||
import (
|
import gogithub "github.com/google/go-github/github"
|
||||||
gogithub "github.com/google/go-github/github"
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
tagSummaryData = "summaryData"
|
tagSummaryData = "summaryData"
|
||||||
)
|
)
|
||||||
|
|
||||||
// sort branches in order that that should be presented.
|
// sort branches in order that they should be presented.
|
||||||
|
|
||||||
type branchesToSort []githubBranch
|
type branchesToSort []githubBranch
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ import (
|
||||||
"github.com/documize/community/domain/section/airtable"
|
"github.com/documize/community/domain/section/airtable"
|
||||||
"github.com/documize/community/domain/section/code"
|
"github.com/documize/community/domain/section/code"
|
||||||
"github.com/documize/community/domain/section/gemini"
|
"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/markdown"
|
||||||
"github.com/documize/community/domain/section/papertrail"
|
"github.com/documize/community/domain/section/papertrail"
|
||||||
"github.com/documize/community/domain/section/plantuml"
|
"github.com/documize/community/domain/section/plantuml"
|
||||||
|
@ -33,7 +32,7 @@ import (
|
||||||
func Register(rt *env.Runtime, s *domain.Store) {
|
func Register(rt *env.Runtime, s *domain.Store) {
|
||||||
provider.Register("code", &code.Provider{Runtime: rt, Store: s})
|
provider.Register("code", &code.Provider{Runtime: rt, Store: s})
|
||||||
provider.Register("gemini", &gemini.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("markdown", &markdown.Provider{Runtime: rt, Store: s})
|
||||||
provider.Register("papertrail", &papertrail.Provider{Runtime: rt, Store: s})
|
provider.Register("papertrail", &papertrail.Provider{Runtime: rt, Store: s})
|
||||||
provider.Register("table", &table.Provider{Runtime: rt, Store: s})
|
provider.Register("table", &table.Provider{Runtime: rt, Store: s})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue