Implement merge request comments.

This commit is contained in:
Maximilian Paß
2023-02-19 00:53:59 +00:00
committed by Sebastian Serth
parent cc0c425197
commit 4fb6ab980b
4 changed files with 78 additions and 45 deletions

View File

@@ -89,6 +89,7 @@ func (nc *nomadAPIClient) Execute(runnerID string,
ctx context.Context, command []string, tty bool,
stdin io.Reader, stdout, stderr io.Writer,
) (int, error) {
log.WithField("command", command).Trace("Requesting Nomad Exec")
var allocations []*nomadApi.AllocationListStub
var err error
logging.StartSpan("nomad.execute.list", "List Allocations for id", ctx, func(_ context.Context) {
@@ -111,7 +112,10 @@ func (nc *nomadAPIClient) Execute(runnerID string,
var exitCode int
logging.StartSpan("nomad.execute.exec", "Execute Command in Allocation", ctx, func(ctx context.Context) {
exitCode, err = nc.client.Allocations().Exec(ctx, allocation, TaskName, tty, command, stdin, stdout, stderr, nil, nil)
debugWriter := NewSentryDebugWriter(stdout, ctx)
exitCode, err = nc.client.Allocations().
Exec(ctx, allocation, TaskName, tty, command, stdin, debugWriter, stderr, nil, nil)
debugWriter.Close(exitCode)
})
switch {
case err == nil: