Improve the explanation of workdir_parent config #519

Merged
wolfogre merged 3 commits from Zettat123/act_runner:improve-workdir-parent into main 2024-03-22 02:30:31 +00:00
Member

Fix #512

act_runner adds a '/' before the path (see

Workdir: filepath.FromSlash(fmt.Sprintf("/%s/%s", r.cfg.Container.WorkdirParent, preset.Repository)),
) . So workdir_parent doesn't need to have the prefix '/'.

If workdir_parent has the prefix '/', errors will occur when reading files from the job container.

Fix #512 act_runner adds a '/' before the path (see https://gitea.com/gitea/act_runner/src/commit/5977042b86f22454d51c8027a009cb0a40337e52/internal/app/run/runner.go#L186) . So `workdir_parent` doesn't need to have the prefix '/'. If `workdir_parent` has the prefix '/', errors will occur when reading files from the job container.
Zettat123 added 1 commit 2024-03-19 09:06:58 +00:00
update comment
All checks were successful
checks / check and test (pull_request) Successful in 50s
494c23db81
Zettat123 added the
kind
bug
label 2024-03-19 09:07:11 +00:00
Owner

Maybe we can simply fix the code to handle it instead of requesting it in the configuration.

Maybe we can simply fix the code to handle it instead of requesting it in the configuration.
Author
Member

I considered changing the code from

fmt.Sprintf("/%s/%s", r.cfg.Container.WorkdirParent, preset.Repository)

to

fmt.Sprintf("%s/%s", r.cfg.Container.WorkdirParent, preset.Repository)

My concern is that maybe some users are using this configuration. Should we introduce a BREAKING change?

I considered changing the code from ``` fmt.Sprintf("/%s/%s", r.cfg.Container.WorkdirParent, preset.Repository) ``` to ``` fmt.Sprintf("%s/%s", r.cfg.Container.WorkdirParent, preset.Repository) ``` My concern is that maybe some users are using this configuration. Should we introduce a BREAKING change?
Owner

I mean:

fmt.Sprintf("/%s/%s", strings.TrimLeft(r.cfg.Container.WorkdirParent, "/"), preset.Repository)
I mean: ```go fmt.Sprintf("/%s/%s", strings.TrimLeft(r.cfg.Container.WorkdirParent, "/"), preset.Repository) ```
Zettat123 added 1 commit 2024-03-22 02:11:58 +00:00
fix workdir
All checks were successful
checks / check and test (pull_request) Successful in 1m12s
77f290c888
Zettat123 added 1 commit 2024-03-22 02:15:11 +00:00
update workdir_parent comment
All checks were successful
checks / check and test (pull_request) Successful in 1m9s
4314e5f7a4
Zettat123 requested review from wolfogre 2024-03-22 02:17:27 +00:00
wolfogre approved these changes 2024-03-22 02:30:18 +00:00
wolfogre merged commit a1fc2b3ca7 into main 2024-03-22 02:30:31 +00:00
Sign in to join this conversation.
No description provided.