8000 Allow global config file to be fetched from an HTTP endpoint · Issue #299 · runs-on/runs-on · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow global config file to be fetched from an HTTP endpoint #299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
crohr opened this issue May 15, 2025 · 7 comments
Open

Allow global config file to be fetched from an HTTP endpoint #299

crohr opened this issue May 15, 2025 · 7 comments
Assignees

Comments

@crohr
Copy link
Contributor
crohr commented May 15, 2025

Instead of using the .github-private repository to host the RunsOn global configuration file, add a stack parameter that makes RunsOn pull the config file from an HTTP endpoint.

Use cases:

  • manage the global config file from a non-git repository
  • allow custom strategies like progressively rolling out a new config file to a subset of repositories

When retrieving the config file for a job, also send:

  • the repository name
  • the workflow file name
  • the runs-on: labels
  • the value of the custom GitHub property runs-on-custom-tag (if any)

Add caching (1min), and fallback to cached value (or error) after at most 5s.

Open questions:

  • if the http endpoint is enabled, make all repositories inherit from the global config file automatically, without the need to define a repo-local config file with an explicit _extends directive? This is most likely what users expect.
@crohr crohr self-assigned this May 15, 2025
@dgolombek
Copy link

I like having the runs-on.yml living in git alongside the rest of my configuration so that people can reference it. I think what would make more sense for our needs would be to fetch it from the same branch the workflow is running on, instead of from the same commit that the pull-request is coming from. But I can definitely see other people wanting more dynamic configuration (time-of-use, availability of spot instances, etc) where a design like this would be really powerful.

@nick-fields
Copy link

We have little need for a non-git global config, especially if the stack parameter needs to point at the config. This would make testing difficult without having to build out infra to test changes. Maybe if it supported pulling from a specific ref in another private repo, and we could point the local runs-on.yml at that via an extends key, then it might get used.

We would much rather just have runs-on.yml read the config from the sha of the current/triggering event. This would alleviate all of our pain. We stopped using the local runs-on.yml config because every config change that merged to our default branch was breaking CI for existing PRs until they were updated with the latest.

@crohr
Copy link
Contributor Author
crohr commented May 20, 2025

I think what would make more sense for our needs would be to fetch it from the same branch the workflow is running on, instead of from the same commit that the pull-request is coming from.

@dgolombek Not sure what you mean by the same branch the workflow is running on. Could you share an example? Thanks!

@crohr
Copy link
Contributor Author
crohr commented May 20, 2025

We have little need for a non-git global config, especially if the stack parameter needs to point at the config. This would make testing difficult without having to build out infra to test changes. Maybe if it supported pulling from a specific ref in another private repo, and we could point the local runs-on.yml at that via an extends key, then it might get used.

We would much rather just have runs-on.yml read the config from the sha of the current/triggering event. This would alleviate all of our pain. We stopped using the local runs-on.yml config because every config change that merged to our default branch was breaking CI for existing PRs until they were updated with the latest.

@nick-fields just to be sure: are you talking from the perspective of public repos here? Where the config is taken from the default branch and not the current branch of the PR?

@nick-fields
Copy link

We have little need for a non-git global config, especially if the stack parameter needs to point at the config. This would make testing difficult without having to build out infra to test changes. Maybe if it supported pulling from a specific ref in another private repo, and we could point the local runs-on.yml at that via an extends key, then it might get used.
We would much rather just have runs-on.yml read the config from the sha of the current/triggering event. This would alleviate all of our pain. We stopped using the local runs-on.yml config because every config change that merged to our default branch was breaking CI for existing PRs until they were updated with the latest.

@nick-fields just to be sure: are you talking from the perspective of public repos here? Where the config is taken from the default branch and not the current branch of the PR?

@crohr No, we have a private repo. If I add a new runner config to runs-on.yml and merge it into the default branch, all open PRs that do not yet have that change result in errors such as:

invalid runner spec: <runner alias from runs-on.yml>. If you are using a configuration file, make sure the file is present. This could also be due to an error when fetching the file from the GitHub API.

If I update the PR with the latest change from the default branch, then the error goes away and everything works. If I only configure runners via repo variables or job outputs in the workflow, then it works as I expect where the runner config for the given commit is what the PR uses.

@crohr
Copy link
Contributor Author
crohr commented May 21, 2025

@nick-fields thanks. In your case I suppose the change you are doing in the default branch removes a runner spec that was still used by the other PRs? Or do you mean that it breaks all PRs irrespective of the change?

@dgolombek
Copy link

I think what would make more sense for our needs would be to fetch it from the same branch the workflow is running on, instead of from the same commit that the pull-request is coming from.

@dgolombek Not sure what you mean by the same branch the workflow is running on. Could you share an example? Thanks!

I was thinking of github.base_ref or github.head_ref, but those only work for PRs, and wouldn't work with more complicated branching strategies either. So that's sadly harder than I thought.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0