Skip to content

Simplify file loading in appconfig package#540

Merged
bluekeyes merged 3 commits intodevelopfrom
bkeyes/simplify-config-loading
May 1, 2026
Merged

Simplify file loading in appconfig package#540
bluekeyes merged 3 commits intodevelopfrom
bkeyes/simplify-config-loading

Conversation

@bluekeyes
Copy link
Copy Markdown
Contributor

@bluekeyes bluekeyes commented May 1, 2026

In an older version of the GitHub API, getting the contents of a large file returned a 422 response. This is no longer the case. Instead, you get back a standard JSON response with an empty content field. Simplify the logic for loading config by making a single call to the contents API, then using the response content to determine if we need to use the direct download URL or not.

I verified the API behavior against GitHub Enterprise 3.17, so I believe it will be the same on GitHub.com (this also matches the API docs.)

I discovered this as part of trying to upgrade to go-github v85, which refactored the DownloadContents function in a way that broke our tests.

I think this also fixes #227, although that wasn't the initial motivation.

In an older version of the GitHub API, getting the contents of a large
file returned a 422 response. This is no longer the case. Instead, you get
back a standard JSON response with an empty content field. Simplify the
logic for loading config by making a single call to the contents API,
then using the response content to determine if we need to use the
direct download URL or not.

I verified the API behavior against GitHub Enterprise 3.17, so I believe
it will be the same on GitHub.com (this also matches the API docs.)

I discovered this as part of trying to upgrade to go-github v85, which
refactored the DownloadContents function in a way that broke our tests.
@changelog-app
Copy link
Copy Markdown

changelog-app Bot commented May 1, 2026

Generate changelog in changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

Fix loading configuration files larger than 1MB with the appconfig package

Check the box to generate changelog(s)

  • Generate changelog entry

@changelog-app
Copy link
Copy Markdown

changelog-app Bot commented May 1, 2026

Successfully generated changelog entry!

Need to regenerate?

Simply interact with the changelog bot comment again to regenerate these entries.

🔄 Changelog entries were re-generated at Fri, 01 May 2026 20:59:11 UTC!


📋Changelog Preview

🐛 Fixes

  • Fix loading configuration files larger than 1MB with the appconfig package (#540)

@bluekeyes bluekeyes requested a review from a team May 1, 2026 20:23
Copy link
Copy Markdown

@alankpatel alankpatel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice find!

@bluekeyes bluekeyes merged commit 07ba8d2 into develop May 1, 2026
6 checks passed
@bluekeyes bluekeyes deleted the bkeyes/simplify-config-loading branch May 1, 2026 21:00
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

Successfully merging this pull request may close these issues.

Errors loading config larger than 1MB

2 participants