Skip to content

triagebot.toml caching is troublesome #1875

Description

@ehuss

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?

Activity

  1. Kobzol commented on Jan 4, 2025

    @Kobzol
    Member

    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.

  2. apiraino commented on Jun 24, 2025

    @apiraino
    Contributor

    I tried using the git Rest APIs in #2088 but I couldn't make it work reliably. I think I give up unless someone has a better idea 🤷‍♂ The code is there, anyone is free to take it further.

  3. Kobzol commented on Jun 24, 2025

    @Kobzol
    Member

    What issues did you encounter with it?

  4. Kobzol commented on Jun 24, 2025

    @Kobzol
    Member

    Ah, I didn't notice the comment (#2088 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions