-
Notifications
You must be signed in to change notification settings - Fork 519
Description
The only reason why we still ship the ./relnotes script is the presence of pkg/patch/internal
, wich is a golang wrapper to the previous bash implementation:
release/pkg/patch/internal/release_notes.go
Lines 44 to 73 in 44172ed
func (r *ReleaseNoter) GetMarkdown() (string, error) { | |
binPath, err := filepath.Abs(filepath.Join(r.ReleaseToolsDir, "relnotes")) | |
if err != nil { | |
return "", fmt.Errorf("could not determine current working directory") | |
} | |
r.Logger().WithField("binpath", binPath).Debug("binpath set") | |
cmd := r.CommandCreator.create( | |
"bash", "-c", fmt.Sprintf(relnoteScript, binPath), | |
) | |
if cmd == nil { | |
return "", fmt.Errorf("command is nil") | |
} | |
r.Logger().Debug("command created") | |
cmd.SetDir(r.K8sDir) | |
cmd.SetEnv([]string{ | |
"GITHUB_TOKEN=" + r.GithubToken, | |
}) | |
r.Logger().WithField("workdir", r.K8sDir).Info("starting release notes gatherer ... this may take a while ...") | |
s, eerr := cmdOutput(cmd) | |
if eerr != nil { | |
r.Logger().WithError(eerr).Debug("execing & getting output failed") | |
r.Logger().WithField("error", eerr.FullError()).Trace("full exec error") | |
return "", eerr | |
} | |
return s, nil | |
} |
This code is mainly used by krel patch-announce
. This leaves us in an undefined state when it comes to removing the code duplication inside this repository. krel patch-announce
is not used by the release engineering right now, whereas in the future we can utilize krel announce
for patch and minor releases in the same way.
I'm wondering how we should move forward with this kind of issue, since I'd like to move forward in removing parts of the bash scripts for sake of better maintainability.
/cc @hoegaarden