refactor(forge): align config lookup and service docs with AX
All checks were successful
Security Scan / security (push) Successful in 16s
Test / test (push) Successful in 1m58s

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-02 08:40:50 +00:00
parent 4b33c1b71c
commit 4b27f1072a
2 changed files with 202 additions and 3 deletions

View file

@ -4,7 +4,6 @@ import (
"encoding/json"
"os"
"path/filepath"
"syscall"
core "dappco.re/go/core"
coreio "dappco.re/go/core/io"
@ -94,10 +93,10 @@ func ResolveConfig(flagURL, flagToken string) (url, token string, err error) {
token = fileToken
}
if envURL, ok := syscall.Getenv("FORGE_URL"); ok && envURL != "" {
if envURL, ok := os.LookupEnv("FORGE_URL"); ok && envURL != "" {
url = envURL
}
if envToken, ok := syscall.Getenv("FORGE_TOKEN"); ok && envToken != "" {
if envToken, ok := os.LookupEnv("FORGE_TOKEN"); ok && envToken != "" {
token = envToken
}

View file

@ -1,6 +1,11 @@
package forge
// String returns a safe summary of the actions service.
//
// Usage:
//
// s := &forge.ActionsService{}
// _ = s.String()
func (s *ActionsService) String() string {
if s == nil {
return "forge.ActionsService{<nil>}"
@ -9,9 +14,19 @@ func (s *ActionsService) String() string {
}
// GoString returns a safe Go-syntax summary of the actions service.
//
// Usage:
//
// s := &forge.ActionsService{}
// _ = fmt.Sprintf("%#v", s)
func (s *ActionsService) GoString() string { return s.String() }
// String returns a safe summary of the ActivityPub service.
//
// Usage:
//
// s := &forge.ActivityPubService{}
// _ = s.String()
func (s *ActivityPubService) String() string {
if s == nil {
return "forge.ActivityPubService{<nil>}"
@ -20,9 +35,19 @@ func (s *ActivityPubService) String() string {
}
// GoString returns a safe Go-syntax summary of the ActivityPub service.
//
// Usage:
//
// s := &forge.ActivityPubService{}
// _ = fmt.Sprintf("%#v", s)
func (s *ActivityPubService) GoString() string { return s.String() }
// String returns a safe summary of the admin service.
//
// Usage:
//
// s := &forge.AdminService{}
// _ = s.String()
func (s *AdminService) String() string {
if s == nil {
return "forge.AdminService{<nil>}"
@ -31,9 +56,19 @@ func (s *AdminService) String() string {
}
// GoString returns a safe Go-syntax summary of the admin service.
//
// Usage:
//
// s := &forge.AdminService{}
// _ = fmt.Sprintf("%#v", s)
func (s *AdminService) GoString() string { return s.String() }
// String returns a safe summary of the branch service.
//
// Usage:
//
// s := &forge.BranchService{}
// _ = s.String()
func (s *BranchService) String() string {
if s == nil {
return "forge.BranchService{<nil>}"
@ -42,9 +77,19 @@ func (s *BranchService) String() string {
}
// GoString returns a safe Go-syntax summary of the branch service.
//
// Usage:
//
// s := &forge.BranchService{}
// _ = fmt.Sprintf("%#v", s)
func (s *BranchService) GoString() string { return s.String() }
// String returns a safe summary of the commit service.
//
// Usage:
//
// s := &forge.CommitService{}
// _ = s.String()
func (s *CommitService) String() string {
if s == nil {
return "forge.CommitService{<nil>}"
@ -53,9 +98,19 @@ func (s *CommitService) String() string {
}
// GoString returns a safe Go-syntax summary of the commit service.
//
// Usage:
//
// s := &forge.CommitService{}
// _ = fmt.Sprintf("%#v", s)
func (s *CommitService) GoString() string { return s.String() }
// String returns a safe summary of the content service.
//
// Usage:
//
// s := &forge.ContentService{}
// _ = s.String()
func (s *ContentService) String() string {
if s == nil {
return "forge.ContentService{<nil>}"
@ -64,9 +119,19 @@ func (s *ContentService) String() string {
}
// GoString returns a safe Go-syntax summary of the content service.
//
// Usage:
//
// s := &forge.ContentService{}
// _ = fmt.Sprintf("%#v", s)
func (s *ContentService) GoString() string { return s.String() }
// String returns a safe summary of the issue service.
//
// Usage:
//
// s := &forge.IssueService{}
// _ = s.String()
func (s *IssueService) String() string {
if s == nil {
return "forge.IssueService{<nil>}"
@ -75,9 +140,19 @@ func (s *IssueService) String() string {
}
// GoString returns a safe Go-syntax summary of the issue service.
//
// Usage:
//
// s := &forge.IssueService{}
// _ = fmt.Sprintf("%#v", s)
func (s *IssueService) GoString() string { return s.String() }
// String returns a safe summary of the label service.
//
// Usage:
//
// s := &forge.LabelService{}
// _ = s.String()
func (s *LabelService) String() string {
if s == nil {
return "forge.LabelService{<nil>}"
@ -86,9 +161,19 @@ func (s *LabelService) String() string {
}
// GoString returns a safe Go-syntax summary of the label service.
//
// Usage:
//
// s := &forge.LabelService{}
// _ = fmt.Sprintf("%#v", s)
func (s *LabelService) GoString() string { return s.String() }
// String returns a safe summary of the milestone service.
//
// Usage:
//
// s := &forge.MilestoneService{}
// _ = s.String()
func (s *MilestoneService) String() string {
if s == nil {
return "forge.MilestoneService{<nil>}"
@ -97,9 +182,19 @@ func (s *MilestoneService) String() string {
}
// GoString returns a safe Go-syntax summary of the milestone service.
//
// Usage:
//
// s := &forge.MilestoneService{}
// _ = fmt.Sprintf("%#v", s)
func (s *MilestoneService) GoString() string { return s.String() }
// String returns a safe summary of the misc service.
//
// Usage:
//
// s := &forge.MiscService{}
// _ = s.String()
func (s *MiscService) String() string {
if s == nil {
return "forge.MiscService{<nil>}"
@ -108,9 +203,19 @@ func (s *MiscService) String() string {
}
// GoString returns a safe Go-syntax summary of the misc service.
//
// Usage:
//
// s := &forge.MiscService{}
// _ = fmt.Sprintf("%#v", s)
func (s *MiscService) GoString() string { return s.String() }
// String returns a safe summary of the notification service.
//
// Usage:
//
// s := &forge.NotificationService{}
// _ = s.String()
func (s *NotificationService) String() string {
if s == nil {
return "forge.NotificationService{<nil>}"
@ -119,9 +224,19 @@ func (s *NotificationService) String() string {
}
// GoString returns a safe Go-syntax summary of the notification service.
//
// Usage:
//
// s := &forge.NotificationService{}
// _ = fmt.Sprintf("%#v", s)
func (s *NotificationService) GoString() string { return s.String() }
// String returns a safe summary of the organisation service.
//
// Usage:
//
// s := &forge.OrgService{}
// _ = s.String()
func (s *OrgService) String() string {
if s == nil {
return "forge.OrgService{<nil>}"
@ -130,9 +245,19 @@ func (s *OrgService) String() string {
}
// GoString returns a safe Go-syntax summary of the organisation service.
//
// Usage:
//
// s := &forge.OrgService{}
// _ = fmt.Sprintf("%#v", s)
func (s *OrgService) GoString() string { return s.String() }
// String returns a safe summary of the package service.
//
// Usage:
//
// s := &forge.PackageService{}
// _ = s.String()
func (s *PackageService) String() string {
if s == nil {
return "forge.PackageService{<nil>}"
@ -141,9 +266,19 @@ func (s *PackageService) String() string {
}
// GoString returns a safe Go-syntax summary of the package service.
//
// Usage:
//
// s := &forge.PackageService{}
// _ = fmt.Sprintf("%#v", s)
func (s *PackageService) GoString() string { return s.String() }
// String returns a safe summary of the pull request service.
//
// Usage:
//
// s := &forge.PullService{}
// _ = s.String()
func (s *PullService) String() string {
if s == nil {
return "forge.PullService{<nil>}"
@ -152,9 +287,19 @@ func (s *PullService) String() string {
}
// GoString returns a safe Go-syntax summary of the pull request service.
//
// Usage:
//
// s := &forge.PullService{}
// _ = fmt.Sprintf("%#v", s)
func (s *PullService) GoString() string { return s.String() }
// String returns a safe summary of the release service.
//
// Usage:
//
// s := &forge.ReleaseService{}
// _ = s.String()
func (s *ReleaseService) String() string {
if s == nil {
return "forge.ReleaseService{<nil>}"
@ -163,9 +308,19 @@ func (s *ReleaseService) String() string {
}
// GoString returns a safe Go-syntax summary of the release service.
//
// Usage:
//
// s := &forge.ReleaseService{}
// _ = fmt.Sprintf("%#v", s)
func (s *ReleaseService) GoString() string { return s.String() }
// String returns a safe summary of the repository service.
//
// Usage:
//
// s := &forge.RepoService{}
// _ = s.String()
func (s *RepoService) String() string {
if s == nil {
return "forge.RepoService{<nil>}"
@ -174,9 +329,19 @@ func (s *RepoService) String() string {
}
// GoString returns a safe Go-syntax summary of the repository service.
//
// Usage:
//
// s := &forge.RepoService{}
// _ = fmt.Sprintf("%#v", s)
func (s *RepoService) GoString() string { return s.String() }
// String returns a safe summary of the team service.
//
// Usage:
//
// s := &forge.TeamService{}
// _ = s.String()
func (s *TeamService) String() string {
if s == nil {
return "forge.TeamService{<nil>}"
@ -185,9 +350,19 @@ func (s *TeamService) String() string {
}
// GoString returns a safe Go-syntax summary of the team service.
//
// Usage:
//
// s := &forge.TeamService{}
// _ = fmt.Sprintf("%#v", s)
func (s *TeamService) GoString() string { return s.String() }
// String returns a safe summary of the user service.
//
// Usage:
//
// s := &forge.UserService{}
// _ = s.String()
func (s *UserService) String() string {
if s == nil {
return "forge.UserService{<nil>}"
@ -196,9 +371,19 @@ func (s *UserService) String() string {
}
// GoString returns a safe Go-syntax summary of the user service.
//
// Usage:
//
// s := &forge.UserService{}
// _ = fmt.Sprintf("%#v", s)
func (s *UserService) GoString() string { return s.String() }
// String returns a safe summary of the webhook service.
//
// Usage:
//
// s := &forge.WebhookService{}
// _ = s.String()
func (s *WebhookService) String() string {
if s == nil {
return "forge.WebhookService{<nil>}"
@ -207,9 +392,19 @@ func (s *WebhookService) String() string {
}
// GoString returns a safe Go-syntax summary of the webhook service.
//
// Usage:
//
// s := &forge.WebhookService{}
// _ = fmt.Sprintf("%#v", s)
func (s *WebhookService) GoString() string { return s.String() }
// String returns a safe summary of the wiki service.
//
// Usage:
//
// s := &forge.WikiService{}
// _ = s.String()
func (s *WikiService) String() string {
if s == nil {
return "forge.WikiService{<nil>}"
@ -218,4 +413,9 @@ func (s *WikiService) String() string {
}
// GoString returns a safe Go-syntax summary of the wiki service.
//
// Usage:
//
// s := &forge.WikiService{}
// _ = fmt.Sprintf("%#v", s)
func (s *WikiService) GoString() string { return s.String() }