chore: update forgejo-runner exec defaults and reword the help #1004

Closed
earl-warren wants to merge 1 commit from earl-warren/runner:wip-exec into main
Contributor

The help is trimmed to a subset of options that are implemented. The unsupported options are made less visible in this way while still being available to avoid a breaking change. They can then be deprecated one by one at a later time.

Refs forgejo/runner#619
Refs forgejo/runner#577

  • other
    • PR: chore: update forgejo-runner exec defaults and reword the help
The help is trimmed to a subset of options that are implemented. The unsupported options are made less visible in this way while still being available to avoid a breaking change. They can then be deprecated one by one at a later time. Refs forgejo/runner#619 Refs forgejo/runner#577 <!--start release-notes-assistant--> <!--URL:https://code.forgejo.org/forgejo/runner--> - other - [PR](https://code.forgejo.org/forgejo/runner/pulls/1004): <!--number 1004 --><!--line 0 --><!--description Y2hvcmU6IHVwZGF0ZSBmb3JnZWpvLXJ1bm5lciBleGVjIGRlZmF1bHRzIGFuZCByZXdvcmQgdGhlIGhlbHA=-->chore: update forgejo-runner exec defaults and reword the help<!--description--> <!--end release-notes-assistant-->
earl-warren force-pushed wip-exec from 65339d685c
All checks were successful
cascade / forgejo (pull_request_target) Has been skipped
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Has been skipped
issue-labels / release-notes (pull_request_target) Successful in 6s
checks / validate mocks (pull_request) Successful in 36s
checks / build and test (pull_request) Successful in 46s
checks / runner exec tests (pull_request) Successful in 25s
checks / runner integration tests (pull_request) Successful in 4m18s
/ example-lxc-systemd (pull_request) Successful in 6m18s
checks / integration tests (pull_request) Successful in 11m2s
to d26e633b71
All checks were successful
checks / validate mocks (pull_request) Successful in 35s
checks / build and test (pull_request) Successful in 45s
checks / runner exec tests (pull_request) Successful in 29s
checks / runner integration tests (pull_request) Successful in 4m24s
/ example-lxc-systemd (pull_request) Successful in 6m14s
checks / integration tests (pull_request) Successful in 10m48s
issue-labels / release-notes (pull_request_target) Successful in 6s
cascade / debug (pull_request_target) Has been skipped
cascade / end-to-end (pull_request_target) Successful in 6s
cascade / forgejo (pull_request_target) Successful in 1m48s
2025-09-16 16:27:49 +00:00
Compare
earl-warren 2025-09-16 16:29:42 +00:00
@ -478,1 +478,4 @@
// Trim the help to a subset of options that are supported. The unsupported options
// are made less visible in this way while still being available to avoid a breaking change.
// They can then be deprecated one by one.
First-time contributor

Not sure about deprecating some of them.
Are they deprecated because of known issues? If so, I'm not aware of them.

  • --forgejo-instance is still necessary to get the origin parsing working
  • A feature like --dryrun is a huge help in not having to manually add if: false lines again and again. If it doesn't fully work, I'd rather it be kept with a warning like "Experimental, might not work in all cases" and an issue somewhere to collect the cases where it needs improvement
  • --list is extremely helpful when you aren't entirely sure how the runner finds workflows, and is much easier than to ls a bunch of different directories
  • --insecure-secrets is actually very helpful for security: If I wanted to check whether my custom action accidentally logs a secret, I can set that to a known value, then grep the log. It's much harder to grep for the replacement value
  • I can imaging how --pull and --rebuild could be helpful, even if just for something like "let's make absolutely sure the runner has the newest image, so I can rule out that and look elsewhere"
  • --network is probably helpful in certain environments, e.g. when the hosted runner would also have access to some shared resources and you want to simulate that locally
Not sure about deprecating some of them. Are they deprecated because of known issues? If so, I'm not aware of them. - `--forgejo-instance` is still necessary to get the origin parsing working - A feature like `--dryrun` is a huge help in not having to manually add `if: false` lines again and again. If it doesn't fully work, I'd rather it be kept with a warning like "Experimental, might not work in all cases" and an issue somewhere to collect the cases where it needs improvement - `--list` is extremely helpful when you aren't entirely sure how the runner finds workflows, and is much easier than to `ls` a bunch of different directories - `--insecure-secrets` is actually very helpful for security: If I wanted to check whether my custom action accidentally logs a secret, I can set that to a known value, then grep the log. It's much harder to grep for the replacement value - I can imaging how `--pull` and `--rebuild` could be helpful, even if just for something like "let's make absolutely sure the runner has the newest image, so I can rule out that and look elsewhere" - `--network` is probably helpful in certain environments, e.g. when the hosted runner would also have access to some shared resources and you want to simulate that locally
Author
Contributor

When running within a repository with the origin remote set, here is what I get:

$ forgejo-runner-11.0.0 exec -W /tmp/f.yml -j test -d
| FORGEJO_REPOSITORY=forgejo/runner
| FORGEJO_REPOSITORY_OWNER=forgejo
| FORGEJO_SHA=2e2e084613442e73d895c726673b24f1f943ffd9
| FORGEJO_REF=refs/heads/wip-validate

What specifically --forgejo-instance provides in addition to this?

When running within a repository with the origin remote set, here is what I get: ```sh $ forgejo-runner-11.0.0 exec -W /tmp/f.yml -j test -d | FORGEJO_REPOSITORY=forgejo/runner | FORGEJO_REPOSITORY_OWNER=forgejo | FORGEJO_SHA=2e2e084613442e73d895c726673b24f1f943ffd9 | FORGEJO_REF=refs/heads/wip-validate ``` What specifically `--forgejo-instance` provides in addition to this?
First-time contributor

The inconsistencies detailed at #619 are still happening.

The inconsistencies detailed at https://code.forgejo.org/forgejo/runner/issues/619 are still happening.
Author
Contributor

Yes, I closed this pull request: fixing --forgejo-instance should be handled in another pull request.

Yes, I closed this pull request: fixing `--forgejo-instance` should be handled in another pull request.
@ -479,0 +488,4 @@
-d, --debug enable debug log.
--default-actions-url string Defines the default base url of the action. (default "https://data.forgejo.org")
-C, --directory string working directory. (default ".")
--env stringArray env to make available to actions with optional value (e.g. --env myenv=foo or --env myenv).
First-time contributor

Why not -e as well?

Why not `-e` as well?
Author
Contributor

because it is not implemented currently

because it is not implemented currently
earl-warren marked this conversation as resolved
@ -479,0 +490,4 @@
-C, --directory string working directory. (default ".")
--env stringArray env to make available to actions with optional value (e.g. --env myenv=foo or --env myenv).
--env-file string environment file to read and use as env in the containers. (default ".env")
-E, --event string run a event name (e.g push, pull_request, ...).
First-time contributor

Should probably mention that the default is what --detect-event did.

Should probably mention that the default is what `--detect-event` did.
Author
Contributor

good point

good point
@ -479,0 +495,4 @@
-i, --image string Docker image to use. (default "node:20-bookworm")
-j, --job string run a specific job ID.
-s, --secret stringArray secret to make available to actions with optional value (e.g. -s mysecret=foo or -s mysecret).
--var stringArray variable to make available to actions with optional value (e.g. --var myvar=foo or --var myvar).
First-time contributor

Why not -v as well?

Why not `-v` as well?
Author
Contributor

because it is not implemented currently

because it is not implemented currently
earl-warren marked this conversation as resolved
earl-warren closed this pull request 2025-09-17 16:02:10 +00:00
Some checks are pending
checks / validate mocks (pull_request) Successful in 35s
checks / build and test (pull_request) Successful in 45s
checks / runner exec tests (pull_request) Successful in 29s
checks / runner integration tests (pull_request) Successful in 4m24s
/ example-lxc-systemd (pull_request) Successful in 6m14s
checks / integration tests (pull_request) Successful in 10m48s
issue-labels / release-notes (pull_request_target) Successful in 6s
cascade / debug (pull_request_target) Has been skipped
Required
Details
cascade / end-to-end (pull_request_target) Successful in 6s
Required
Details
cascade / forgejo (pull_request_target) Successful in 1m48s
Required
Details
checks / Build Forgejo Runner *
Required
checks / Run exec tests *
Required
checks / Run integration tests with *
Required

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
forgejo/runner!1004
No description provided.