|
30 | 30 |
|
31 | 31 | // ErrUnexpectedGoListOutput is returned when go list output has unexpected format. |
32 | 32 | ErrUnexpectedGoListOutput = errors.New("unexpected go list output") |
33 | | - |
34 | | - // ErrTransitiveDepsRequired is returned when updating a package requires co-updating other dependencies. |
35 | | - ErrTransitiveDepsRequired = errors.New("transitive dependencies need co-updating") |
36 | 33 | ) |
37 | 34 |
|
38 | 35 | // Golang implements the Language interface for Go projects. |
@@ -408,17 +405,15 @@ func resolveAndFilterPackages(ctx context.Context, packages map[string]*Package, |
408 | 405 | log.Infof("Will update %s from %s to %s", name, currentVersion, resolvedVersion) |
409 | 406 | } |
410 | 407 |
|
411 | | - if err := checkMissingTransitiveDeps(ctx, filtered, modFile); err != nil { |
412 | | - return nil, err |
413 | | - } |
| 408 | + checkMissingTransitiveDeps(ctx, filtered, modFile) |
414 | 409 |
|
415 | 410 | return filtered, nil |
416 | 411 | } |
417 | 412 |
|
418 | 413 | // checkMissingTransitiveDeps checks all packages being updated for transitive dependency |
419 | | -// requirements not satisfied by the current go.mod, and returns an error with co-update |
| 414 | +// requirements not satisfied by the current go.mod, and logs a warning with co-update |
420 | 415 | // recommendations if any are found. |
421 | | -func checkMissingTransitiveDeps(ctx context.Context, filtered map[string]*Package, modFile *modfile.File) error { |
| 416 | +func checkMissingTransitiveDeps(ctx context.Context, filtered map[string]*Package, modFile *modfile.File) { |
422 | 417 | log := clog.FromContext(ctx) |
423 | 418 |
|
424 | 419 | // Build set of packages being updated |
@@ -459,7 +454,7 @@ func checkMissingTransitiveDeps(ctx context.Context, filtered map[string]*Packag |
459 | 454 | } |
460 | 455 |
|
461 | 456 | if len(allMissingDeps) == 0 && len(apiCompatibilityAlerts) == 0 { |
462 | | - return nil |
| 457 | + return |
463 | 458 | } |
464 | 459 |
|
465 | 460 | var msg strings.Builder |
@@ -514,17 +509,12 @@ func checkMissingTransitiveDeps(ctx context.Context, filtered map[string]*Packag |
514 | 509 | fmt.Fprintf(&msg, "\n") |
515 | 510 | } |
516 | 511 |
|
517 | | - // Only error if there are required co-updates; API alerts are informational |
518 | 512 | if len(allMissingDeps) > 0 { |
519 | 513 | fmt.Fprintf(&msg, "SUGGESTED UPDATE COMMAND\n\n") |
520 | 514 | fmt.Fprintf(&msg, "%s", buildSuggestedCommand(filtered, allMissingDeps, apiCompatibilityAlerts, modFile)) |
521 | 515 | fmt.Fprintf(&msg, "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n") |
522 | | - return fmt.Errorf("%w:%s", ErrTransitiveDepsRequired, msg.String()) |
523 | 516 | } |
524 | | - |
525 | | - // If only API alerts (no required co-updates), just log as warning |
526 | | - log.Warnf("API compatibility alerts:\n%s", msg.String()) |
527 | | - return nil |
| 517 | + log.Warnf("%s", msg.String()) |
528 | 518 | } |
529 | 519 |
|
530 | 520 | // buildSuggestedCommand builds the omnibump --packages "..." command string. |
|
0 commit comments