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

Update failed, invalid composer.json metadata [Composer\Repository\InvalidRepositoryException] #1389

Open
remarkablemark opened this issue Aug 6, 2023 · 5 comments

Comments

@remarkablemark
Copy link

remarkablemark commented Aug 6, 2023

I submitted a package and it failed with the error:

Screen Shot 2023-08-05 at 9 14 44 PM

Here's the copied error:

Update of remarkablemark/php-composer-test failed, invalid composer.json metadata [Composer\Repository\InvalidRepositoryException] Some branches contained invalid data and were discarded, it is advised to review the log and fix any issues present in branches
Reading composer.json of remarkablemark/php-composer-test (v1.0.0)
Importing tag v1.0.0 (1.0.0.0)
Reading composer.json of remarkablemark/php-composer-test (master)
Importing branch master (dev-master)
Skipped branch master, Invalid package information: 
funding.7.url : invalid value (['link1), must be an http/https URL
funding.8.url : invalid value (link2), must be an http/https URL

I believe this is caused by a parsing error from .github/FUNDING.yml.

I ran composer validate and didn't get any errors:

./composer.json is valid, but with a few warnings
See https://getcomposer.org/doc/04-schema.md for details on the schema
# General warnings
- The version field is present, it is recommended to leave it out if the package is published on Packagist.

Related to #1097

@stof
Copy link
Contributor

stof commented Aug 7, 2023

Try removing the comments in that file. This will avoid confusing the extractor.

@remarkablemark
Copy link
Author

Makes sense! Is that a bug with the extractor?

@stof
Copy link
Contributor

stof commented Aug 8, 2023

Yeah. The logic is at https://github.com/composer/composer/blob/95dca79fc2e18c3a4e33f207c1fcaa7d5b559400/src/Composer/Repository/Vcs/GitHubDriver.php#L204

It does not use an actual Yaml parser to avoid introducing that as a dependency of composer.

@remarkablemark
Copy link
Author

Gotcha, thanks for the context!

@Seldaek
Copy link
Member

Seldaek commented Oct 11, 2023

I think the problem might be the empty lines like open_collective: # .... Not sure 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

3 participants