Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unblock issues caused by bad validation #85

Merged
merged 2 commits into from
Oct 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ func main() {
log.Fatalf("couldn't open configuration file: %s\n", err)
}

err = authmanager.AcquireToken(localCfg)
if err != nil {
log.Fatalf("couldn't acquire token from config: %s\n", err)
}

if errors := validation.Validate(localCfg); len(errors) > 0 {
for _, err := range errors {
log.Println(err)
Expand All @@ -50,11 +55,6 @@ func main() {
os.Exit(1)
}

err = authmanager.AcquireToken(localCfg)
if err != nil {
log.Fatalf("couldn't acquire token from config: %s\n", err)
}

baseURL, err := issuetracker.BaseURLFor(localCfg.IssueTracker, localCfg.Origin)
if err != nil {
log.Fatalf("couldn't get base url for origin %s & issue tracker %s: %s\n",
Expand Down
4 changes: 0 additions & 4 deletions validation/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ func Validate(cfg *config.Local) []error {
errs = append(errs, err)
}

if err := validateIssueTrackerExists(cfg); err != nil {
mehdy marked this conversation as resolved.
Show resolved Hide resolved
errs = append(errs, err)
}

if err := validateAuthType(cfg); err != nil {
errs = append(errs, err)
}
Expand Down