fix: don't prepend server URL with https:// if it's an empty string #1083
No reviewers
Labels
No labels
FreeBSD
Kind/Breaking
Kind/Bug
Kind/Chore
Kind/DependencyUpdate
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Windows
linux-powerpc64le
linux-riscv64
linux-s390x
run-end-to-end-tests
run-forgejo-tests
run-multi-platform-tests
No milestone
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
forgejo/runner!1083
Loading…
Reference in a new issue
No description provided.
Delete branch "drewcassidy/runner:empty-server-url-fix"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
An attempt to address #1074 in a way that makes everyone happy
Right now, any server URL that doesnt start with
http://orhttps://automatically getshttps://prepended to it. When no instance is set while runningforgejo-runner execthis results in the{FORGEJO,GITHUB}_SERVER_URLenvironment variables being set to simply "https://". Any action using the GitHub actions toolkit chokes on this as an invalid URL and fails the run with a nondescript error. This PR instead leaves empty strings alone, which the actions toolkit seems much happier withAlternate fixes:
--forgejo-instanceflag to a valid but unresolved url like 'http://example.com' so the actions don't crashThis change looks good to me. Could you please add an automated test to the sibling file
run_context_test.gowhich covers the expected behaviour?Fix: Don't prepend server URL with https:// if its an empty stringto fix: Don't prepend server URL with https:// if its an empty stringfix: Don't prepend server URL with https:// if its an empty stringto fix: Don't prepend server URL with https:// if it's an empty string@ -1362,4 +1356,0 @@set("SERVER_URL", instance)set("API_URL", instance+"/api/v1")}I removed this since getGithubContext is doing the exact same transformation (twice...) and withGithubEnv is always run with rc.getGithubContext
can you explain with references to code why this is redundant? I think you are correct but it would help me make sure there is not a weird situation where this is actually doing something different 🙏
The two usages of
withGithubEnvaredrewcassidy/runner@1ef1b8323b/act/runner/action.go (L256)anddrewcassidy/runner@1ef1b8323b/act/runner/step.go (L268)All implementations of
step.getGithubContextultimately callrc.getGithubContextdrewcassidy/runner@1ef1b8323b/act/runner/step_action_local.go (L96)drewcassidy/runner@1ef1b8323b/act/runner/step_action_remote.go (L195)drewcassidy/runner@1ef1b8323b/act/runner/step_docker.go (L43)drewcassidy/runner@1ef1b8323b/act/runner/step_run.go (L58)Plus it just makes more sense for the context variables to get the same treatment as the environment variables
Crystal clear. Thanks for making it easy for me to follow your footsteps 🙏
cascading-pr updated at actions/setup-forgejo#720
@drewcassidy set the
run-end-to-end-testfor triggering additional tests at https://code.forgejo.org/forgejo/end-to-end/src/branch/main/actionsfix: Don't prepend server URL with https:// if it's an empty stringto fix: don't prepend server URL with https:// if it's an empty string