Skip to content

Errors loading config larger than 1MB #227

Open
@bluekeyes

Description

@bluekeyes

I think this has been broken since we introduced the appconfig package, but it's also possible that GitHub's API changed. The GetContents method returns content if the file is less than 1MB and an empty content field in the JSON for content between 1MB and 100MB. The endpoint returns an error for content over 100MB.

We handle the case where the content is larger than 100MB, but do not handle the case where the content is larger than 1MB. Instead, we return an error when we try to decode content with the none encoding.

When the content field is empty, I think there are two options:

  1. Make another request to the "Get repository contents" API, but provide the raw media type
  2. Switch to using the DownloadContents method, like we do when the file is larger than 100MB

The reason to not use DownloadContents every time is that it makes two API calls: one to list the directory containing the file, and then one to download the file. Since most apps perform configuration lookups all the time, minimizing requests here is a good idea.

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