detached 4d5e5f8

feat(executor): docker actions join the job network; container: and services: are no longer refused

commit
4d5e5f860710eca872f4f25675ea1a09f0399a47
author
brice · · 2026-10-14 05:53 UTC
parent
3a3049c
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +16 -6
M internal/executor/actions_docker.go +11 -0
@@ -224,6 +224,17 @@ func (j *job) runDocker(s *stepRun, def *actionDef, in *inputSet, env *ordered,
224224 if entry != "" {
225225 parts = append(parts, entrypointOpt(entry))
226226 }
227+ // A docker action joins the network of the job's containers, so that it
228+ // reaches the services by their aliases (ContainerActionHandler.cs:172-175
229+ // reads job.container.network; the read creates job.container, which is why
230+ // the context of any job that ran a docker action has "container": {}).
231+ j.mu.Lock()
232+ j.state.TouchJobContainer()
233+ network := j.state.JobContainerNetwork()
234+ j.mu.Unlock()
235+ if network != "" {
236+ parts = append(parts, raw("--network", network))
237+ }
227238 parts = append(parts,
228239 volumeOpt("/var/run/docker.sock", "/var/run/docker.sock"),
229240 volumeOpt(temp, "/github/runner_temp"),
@@ -224,6 +224,17 @@ func (j *job) runDocker(s *stepRun, def *actionDef, in *inputSet, env *ordered,
224 if entry != "" {224 if entry != "" {
225 parts = append(parts, entrypointOpt(entry))225 parts = append(parts, entrypointOpt(entry))
226 }226 }
227+ // A docker action joins the network of the job's containers, so that it
228+ // reaches the services by their aliases (ContainerActionHandler.cs:172-175
229+ // reads job.container.network; the read creates job.container, which is why
230+ // the context of any job that ran a docker action has "container": {}).
231+ j.mu.Lock()
232+ j.state.TouchJobContainer()
233+ network := j.state.JobContainerNetwork()
234+ j.mu.Unlock()
235+ if network != "" {
236+ parts = append(parts, raw("--network", network))
237+ }
227 parts = append(parts,238 parts = append(parts,
228 volumeOpt("/var/run/docker.sock", "/var/run/docker.sock"),239 volumeOpt("/var/run/docker.sock", "/var/run/docker.sock"),
229 volumeOpt(temp, "/github/runner_temp"),240 volumeOpt(temp, "/github/runner_temp"),
M internal/executor/job_test.go +5 -6
@@ -192,13 +192,12 @@ jobs:
192192 _ = rec
193193 }
194194
195-func TestNotSupportedYet(t *testing.T) {
195+// Reusable workflows stay refused; container: and services: are supported.
196+func TestReusableWorkflowNotSupportedYet(t *testing.T) {
196197 needTools(t, "bash")
197- for _, f := range []string{"container: alpine", "services:\n s:\n image: x"} {
198- rec2, res2 := runLocal(t, wfHead+" "+f+"\n steps:\n - run: echo hi\n", "j", nil)
199- if res2.Conclusion != ConclusionFailure || res2.Error == "" || !strings.Contains(logOf(rec2.steps[0]), "not supported yet") {
200- t.Errorf("%q: %+v %v", f, res2, rec2.names())
201- }
198+ rec, res := runLocal(t, "on: push\njobs:\n j:\n uses: ./.github/workflows/x.yml\n", "j", nil)
199+ if res.Conclusion != ConclusionFailure || !strings.Contains(logOf(rec.steps[0]), "not supported yet") {
200+ t.Errorf("%+v %v", res, rec.names())
202201 }
203202 }
204203
@@ -192,13 +192,12 @@ jobs:
192 _ = rec192 _ = rec
193 }193 }
194 194
195-func TestNotSupportedYet(t *testing.T) {195+// Reusable workflows stay refused; container: and services: are supported.
196+func TestReusableWorkflowNotSupportedYet(t *testing.T) {
196 needTools(t, "bash")197 needTools(t, "bash")
197- for _, f := range []string{"container: alpine", "services:\n s:\n image: x"} {198+ rec, res := runLocal(t, "on: push\njobs:\n j:\n uses: ./.github/workflows/x.yml\n", "j", nil)
198- rec2, res2 := runLocal(t, wfHead+" "+f+"\n steps:\n - run: echo hi\n", "j", nil)199+ if res.Conclusion != ConclusionFailure || !strings.Contains(logOf(rec.steps[0]), "not supported yet") {
199- if res2.Conclusion != ConclusionFailure || res2.Error == "" || !strings.Contains(logOf(rec2.steps[0]), "not supported yet") {200+ t.Errorf("%+v %v", res, rec.names())
200- t.Errorf("%q: %+v %v", f, res2, rec2.names())
201- }
202 }201 }
203 }202 }
204 203

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 4

Tags 11

↑↓ moveenter openesc close