GitHub: get API url and server URL from env#498
Conversation
|
So, if we add this functionality into CompatHelper itself, it'll be a little difficult for us to test it. Instead, could you modify your For example, if you look at the recommended CompatHelper.jl/.github/workflows/CompatHelper.yml Lines 37 to 41 in 97e9dcd You could instead modify your - name: "Run CompatHelper"
run: |
import CompatHelper
my_ci_cfg = CompatHelper.GitHubActions(;
username = "...",
email = "...",
api_hostname = "...",
clone_hostname = "...",
)
CompatHelper.main(ENV, my_ci_cfg)
shell: julia --color=yes {0}Where you'd fill in the relevant values in the That way, you can specify the exact values you need, without us needed to modify the source code of CompatHelper.jl (and thus needing to figure out a way to test it). |
|
I've already fixed it in my file (see below). If you prefer, I could fix it in the If it's hard to test, I think it's fine to not test it. Since it doesn't break existing tests, it can't be worse than the current failure behavior. But whether it's tested or not, it should be fixed or the documentation should be corrected. What do you think? Should I remove this fix and update the documentation instead? Or update the template - name: "Run CompatHelper"
run: |
import CompatHelper
ci = CompatHelper.GitHubActions(;
api_hostname = ENV["GITHUB_API_URL"],
clone_hostname = replace(ENV["GITHUB_SERVER_URL"], r"^(https?://)?" => ""),
)
CompatHelper.main(ENV, ci) |
I encountered difficulties trying to use CompatHelper.jl on an Enterprise server, but it turns out I just needed to set the API url and the hostname correctly.
This pull request updates
auto_detect_ci_serviceto automatically handle non-GitHub.com GitHub servers.I am not sure how to add tests for this.
@DilumAluthge I see you are probably the most active here. Can you take a look at this and advise on tests?