Skip to content
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

triagebot.toml caching is troublesome #1875

Open
ehuss opened this issue Jan 4, 2025 · 1 comment
Open

triagebot.toml caching is troublesome #1875

ehuss opened this issue Jan 4, 2025 · 1 comment

Comments

@ehuss
Copy link
Contributor

ehuss commented Jan 4, 2025

triagebot.toml is cached fairly aggressively. This can cause difficulty, particularly during development. When updating the file, it can take a long time for that update to be reflected.

There are two aspects to this:

  1. triagebot caches the file for at least two minutes. This cannot be overridden. The only way to stop this is to restart the server.
  2. GitHub's https://raw.githubusercontent.com/ endpoint seems to cache for several minutes, too. I do not understand how that caching works, or if there is some header we need to set to fix that. In my investigation, I found odd behavior where triagebot would receive the old content, but running curl on the command-line would get the new content, which was very confusing.

Some random thoughts:

  • Can triagebot invalidate its own internal cache when it gets a webhook indicating that triagebot.toml has been updated? I believe we can get this list of files from the PushEvent commit list (there are limits, but shouldn't be an issue here).
  • Are there headers we can include to https://raw.githubusercontent.com/ to bust its cache? Or is there an alternate endpoint for getting the raw file that doesn't have this behavior?
@Kobzol
Copy link
Contributor

Kobzol commented Jan 4, 2025

FWIW, in new bors I use GitHub's API to download the contents of the bors config file from the default branch (https://github.com/rust-lang/bors/blob/main/src/github/api/client.rs#L56). That hopefully shouldn't be cached at all, since it reads git state directly.

Other than that, I also reload the config only periodically though.

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

2 participants