Don't exclude resources/generator-config.json from package archives - #906
Merged
jlevers merged 1 commit intoJul 29, 2026
Merged
Conversation
Package::version() and Package::namespace() read this file at runtime (via the GENERATOR_CONFIG_FILE constant), and SellingPartnerApi::defaultUserAgent() calls Package::version() on every request to build the User-Agent header. jlevers#903 marked this file export-ignore alongside genuinely dev-only files (tests/, resources/models/, resources/apis.json, resources/metadata/), so every v7.4.9 install via Composer is missing a file the SDK requires at runtime, and every SP-API request fatals with: file_get_contents(.../resources/generator-config.json): Failed to open stream: No such file or directory
Owner
|
Jesus, thanks for the catch. Merging and cutting a new release now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#903 marked
resources/generator-config.jsonexport-ignorein.gitattributesalongside genuinely dev-only files (tests/,resources/models/,resources/apis.json,resources/metadata/). Unlike those, this file is read at runtime:and
SellingPartnerApi::defaultUserAgent()callsPackage::version()on every single request to build the User-Agent header:Since v7.4.9, anyone installing via Composer gets a package archive missing this file, so every SP-API request fatals:
I checked whether the other newly-excluded resource files (
apis.json,metadata/**,models/**) are also read outsidesrc/Generator/at runtime - they aren't (onlyresources/feeds.jsonandresources/reports.jsonare read at runtime, viaDownloadsDocument/UploadsDocument/RestrictedReport, and neither of those is in theexport-ignorelist), so this is the one file that needs to come back.Verified with
git archive HEAD --format=zipthat the file is included in the resulting archive after this change.Reports the same underlying issue as #906.