Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Composer feed: metapackage is not saved as a local package

    Scheduled Pinned Locked Moved Support
    4 Posts 2 Posters 13 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V Offline
      vdubrovskyi_1854
      last edited by

      Hello.
      I keep trying to use composer feed in a real project.
      There are packages with the metapackage type in composer. If you install such a package from a feed that has a connector on packagest.org, then such a package is not saved in proget as a local package. There is no corresponding folder in vendors, although it is in composer.lock.

      For example:

      composer reinstall -vvv --prefer-dist --no-scripts symfony/polyfill-php70
      

      But if you try to download the zip of such a package directly, the package appears.

      I think this is a mistake. All packages that are in composer.lock must be stored in proget.

      Thank you.

      atrippA 1 Reply Last reply Reply Quote 0
      • atrippA Offline
        atripp inedo-engineer @vdubrovskyi_1854
        last edited by

        Hi @vdubrovskyi_1854 ,

        I'm not an expert on how Composer handles packages, but so far as I can tell the behavior you’re seeing is expected and is how metapackage types are handled.

        A metapackage does not contain any files and is not installed into the vendor/ directory. It exists only to define dependencies on other packages. There is no contents in the package and thus, there is nothing for Composer to fetch.

        Because of this:

        • It will appear in composer.lock as part of dependency resolution
        • It will not create a directory under vendor/
        • The content itself is not be fetched (downloaded) from Composer
        • Only the Composer API is queried

        ProGet can only cache a package when a download/fetch occurs. Since metapackages are not fetched, there is nothing to cache.

        When you downloaded manually, you are deviating from Composer’s normal install behavior for metapackages -- so that's why it appears.

        In summary, this behavior is expected and not an error in ProGet. Unfortunately there's no way for ProGet to cache these packages, since Composer never downloads them.

        Hope that helps,

        Alana

        1 Reply Last reply Reply Quote 0
        • V Offline
          vdubrovskyi_1854
          last edited by

          Yes, that's all logical. But it completely breaks the approach with promotion. I can't promote a package that doesn't exist.

          Why doesn't proget cache the metadata of a package without zip?

          atrippA 1 Reply Last reply Reply Quote 0
          • atrippA Offline
            atripp inedo-engineer @vdubrovskyi_1854
            last edited by

            Hi @vdubrovskyi_1854 ,

            Unfortunately this is just how composer works; it never requests the metapackage from the server (i.e. ProGet) nor does it upload the composer.lock file to ProGet.

            There is obviously no way for ProGet to "guess" what metapackages you may want. Obviously, ProGet does not automatically download/install every metapackage from the upstream repository. That's obviously not behavior anyone would want, and we will not add it to ProGet.

            You have two options:

            1. Modify the behavior of composer to request these packages from ProGet,
            2. Writing a script to parse your composer.lock and then download and/or promote those files within ProGet

            Hope that helps,

            Alana

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post
            Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation