Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Clone

Read only, no credentials:

https://rodent.software/git/vole.git

Write over SSH with a registered key:

git clone ssh://git@0.0.0.0:2222/vole.git

A free and open-source forge that lives in your Git repo.

refactor

c5902451905acdaa478f8476844ccd4a510d9ca9 · Keenan Nemetz · 16d ago · parent ec2aba4b

internal/sshserver/runner.go → server/ssh/runner.go +9−9

@@ -1,14 +1,14 @@
1 package sshserver
1 package ssh
2 2
3 3 import (
4 4 "encoding/json"
5 5 "fmt"
6 6 "time"
7 7
8 "github.com/rodent-software/vole/internal/id"
9 "github.com/rodent-software/vole/internal/issues"
10 "github.com/rodent-software/vole/internal/runs"
11 "golang.org/x/crypto/ssh"
8 "github.com/rodent-software/vole/ci/runs"
9 "github.com/rodent-software/vole/core/id"
10 "github.com/rodent-software/vole/metadata"
11 xssh "golang.org/x/crypto/ssh"
12 12 )
13 13
14 14 // The runner protocol.
@@ -99,7 +99,7 @@ type runnerJob struct {
99 99 ReleaseArtifacts []string `json:"release_artifacts,omitempty"`
100 100 // Pages is the site deploy this run performs, if any. The branch comes from
101 101 // instance configuration, which is why it is in the payload rather than in the
102 // workflow.
102 // ci.
103 103 Pages *runnerPages `json:"pages,omitempty"`
104 104 }
105 105
@@ -127,7 +127,7 @@ type runnerReply struct {
127 127 }
128 128
129 129 // serveRunner answers one runner session until it disconnects.
130 func (s *Server) serveRunner(ch ssh.Channel, user, accountID string) {
130 func (s *Server) serveRunner(ch xssh.Channel, user, accountID string) {
131 131 defer ch.Close()
132 132 cfg := s.cfg
133 133 if cfg.Runs == nil {
@@ -285,7 +285,7 @@ func (s *Server) serveRunner(ch ssh.Channel, user, accountID string) {
285 285 _ = enc.Encode(runnerReply{Op: "finish", Error: fmt.Sprintf("cannot open %s: %v", run.Repo, err)})
286 286 continue
287 287 }
288 rec, err := runs.ReadRecord(m.Git(), issues.Ref, run.ID)
288 rec, err := runs.ReadRecord(m.Git(), metadata.Ref, run.ID)
289 289 if err != nil {
290 290 _ = enc.Encode(runnerReply{Op: "finish", Error: fmt.Sprintf("cannot read the record for %s: %v", run.ID, err)})
291 291 continue
@@ -294,7 +294,7 @@ func (s *Server) serveRunner(ch ssh.Channel, user, accountID string) {
294 294 case rec == nil:
295 295 _ = enc.Encode(runnerReply{Op: "finish", Error: fmt.Sprintf(
296 296 "no record for run %s on %s: a runner reports a result by pushing %s, and nothing is recorded without one",
297 run.ID, issues.Ref, runs.RecordPath(run.ID, run.Attempts))})
297 run.ID, metadata.Ref, runs.RecordPath(run.ID, run.Attempts))})
298 298 continue
299 299 case rec.Attempt != run.Attempts:
300 300 _ = enc.Encode(runnerReply{Op: "finish", Error: fmt.Sprintf(