GeoIP2-php icon indicating copy to clipboard operation
GeoIP2-php copied to clipboard

2.13.0 switches to git over SSH for Packagist source

Open jasongill opened this issue 3 years ago • 3 comments

For some reason (I don't see it in the codebase anywhere so I assume it's somewhere in the Packagist configuration?), 2.13.0 has changed the "source" parameter for this package to be an SSH git URL:

2.12.2

            "name": "geoip2/geoip2",
            "version": "v2.12.2",
            "source": {
                "type": "git",
                "url": "https://github.com/maxmind/GeoIP2-php.git",
                "reference": "83adb44ac4b9553d36b579a14673ed124583082f"
            },

2.13.0

            "name": "geoip2/geoip2",
            "version": "v2.13.0",
            "source": {
                "type": "git",
                "url": "[email protected]:maxmind/GeoIP2-php.git",
                "reference": "6a41d8fbd6b90052bc34dff3b4252d0f88067b23"
            },

which breaks our build and deployment process, as our build servers don't have the ability to SSH out. Every other package has an https URL which works fine, and the dist URL for this package is still https, but it's just odd that the source URL has changed.

Can you take a look and see if this is something that can be changed back to https (which should behave the exact same, but will fix source-based builds that can't SSH)? For now we've just forced 2.12.2 but would like to be able to track updates and build from source.

Thanks guys!

jasongill avatar Sep 16 '22 14:09 jasongill

Interesting. I don't think we have changed anything on Packagist for a very long time. I can't connect to their site at the moment, but I will take a look when I am able.

oschwald avatar Sep 16 '22 14:09 oschwald

thank you @oschwald , this was an odd one to figure out for sure - composer install started failing on build servers and spitting out errors about SSH; when I compared the diffs I was able to narrow it down to this one package - but I don't see anywhere in your 2.13.0 release (or in any other packages that rely on it like minfraud-api-php) which seemed to reference the path to the repo, so that is why I assume that it's gotta be something odd in Packagist with the 2.13.0 version.

Thanks for taking a look; we are just fine for now version locked to 2.12.2 but it was such an odd one that I'd be curious what the fix is!

jasongill avatar Sep 16 '22 14:09 jasongill

The only relevant setting that I see is the "repository", which is set to "https://github.com/maxmind/GeoIP2-php". I am not sure why it is preferring the SSH in this case. This might need to be escalated to the Packagist team.

oschwald avatar Sep 16 '22 14:09 oschwald

I can confirm @jasongill's observation. Just tested it locally (Win10, PHP 7.3, Composer 2.4.4).

The reason seems to be the Composer package data on Packagist https://repo.packagist.org/p2/geoip2/geoip2.json. Only the new 2.13.0 release has a SSH-based source URL, all others have a HTTPS one. Interestingly, only the source URL but not the dist(ribution) URL.

@jasongill does it help to explicitly use "prefer dist"?

For composer install

--prefer-dist                                    Forces installation from package dist (default behavior).

For composer require

--prefer-dist                                    Forces installation from package dist (default behavior).
--prefer-install=PREFER-INSTALL                  Forces installation from package dist|source|auto (auto chooses source for dev versions, dist for the rest).
    "geoip2/geoip2": [
      {
        "name": "geoip2/geoip2",
        "description": "MaxMind GeoIP2 PHP API",
        // snip
        "homepage": "https://github.com/maxmind/GeoIP2-php",
        "version": "v2.13.0",
        "version_normalized": "2.13.0.0",
        // snip
        "source": {
          "url": "[email protected]:maxmind/GeoIP2-php.git",
          "type": "git",
          "reference": "6a41d8fbd6b90052bc34dff3b4252d0f88067b23"
        },
        "dist": {
          "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/6a41d8fbd6b90052bc34dff3b4252d0f88067b23",
          "type": "zip",
          "shasum": "",
          "reference": "6a41d8fbd6b90052bc34dff3b4252d0f88067b23"
        },
        // snip
      },
      {
        "version": "v2.12.2",
        "version_normalized": "2.12.2.0",
        "source": {
          "url": "https://github.com/maxmind/GeoIP2-php.git",
          "type": "git",
          "reference": "83adb44ac4b9553d36b579a14673ed124583082f"
        },
        "dist": {
          "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/83adb44ac4b9553d36b579a14673ed124583082f",
          "type": "zip",
          "shasum": "",
          "reference": "83adb44ac4b9553d36b579a14673ed124583082f"
        },
        // snip
      },
      // snip
    ]
  },
  // snip
}
Line   31: "url": "[email protected]:maxmind/GeoIP2-php.git",
Line   36: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/6a41d8fbd6b90052bc34dff3b4252d0f88067b23",
Line   65: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line   70: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/83adb44ac4b9553d36b579a14673ed124583082f",
Line   85: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line   90: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/d25660633755f3f064ca647cd916c5c65074e408",
Line  105: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  110: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/a320c2c3b7498c83bf9b2a670af6888c73e29f50",
Line  125: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  130: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/d01be5894a5c1a3381c58c9b1795cd07f96c30f7",
Line  150: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  155: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/419557cd21d9fe039721a83490701a58c8ce784a",
Line  188: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  193: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/a807fbf65212eef5d8d2db1a1b31082b53633d77",
Line  214: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  219: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/63b0d87d47ee8c9431bff70244401db5ced82bd9",
Line  245: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  250: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/ca9f9a244474d97eac1ef542aaced7cc944bafbe",
Line  265: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  270: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/9f6f1edf9901fed5cd692dd260333bf52091acd3",
Line  285: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  290: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/87602e1c9f5014291b06e126847123360cb6c2db",
Line  315: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  320: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/b28a0ed0190cd76c878ed7002a5d1bb8c5f4c175",
Line  335: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  340: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/57e0384a83d0935db4c4cdb3f411aa131481ae80",
Line  355: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  360: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/93eafde9b6e9b97415152daf23967b6bff756fb2",
Line  375: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  380: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/24b278b0195d7067e930b844c44faf8fae5bdbc7",
Line  395: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  400: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/241e4442e0469d70043805ef699290616d53ce41",
Line  420: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  425: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/2edce6957126399039124459174d5dce24edfdae",
Line  445: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  450: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/ee15b2e466dd09fd2246cf64efa1aa9eca988b86",
Line  468: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  473: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/56da4bd576880d437d92c28cb376b337a5daa08f",
Line  488: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  493: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/8bd919d9d829a1f25e01895cdead97c5247aacb7",
Line  514: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  519: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/0d28ca5bb5a96e950651751a87fd4009be89e3d1",
Line  539: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  544: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/de769ca61dc088ebb5329de179ee8f03953b407d",
Line  559: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  564: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/a877c919a4652da62ff0013656e571a146df86c5",
Line  584: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  589: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/5b1741e19fd4c61ee7b7b44ef438b8fbc6565125",
Line  605: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  610: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/01f58d749b715f30c99d1b19a965ce5b93813656",
Line  640: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  645: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/64f226209342c4a2f54b82ba3f0707db944f7d70",
Line  660: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  665: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/c58034524e0d20e9bcff16b5f9f8f2633f921ab5",
Line  686: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  691: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/94f4f9d5e66413a56dc2631b29a0ca8a78e02a5e",
Line  717: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  722: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/36624ae87a6977450c13cb91fec42c06b89d3b45",
Line  737: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  742: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/920a92f35214c4d32aacf790153bcc532efa4c13",
Line  757: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  762: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/1925936b263b9fcafae1c980b956a2074e761e5f",
Line  786: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  791: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/9f0c743afdd637f92db97c76defb96c3faeb2ae9",
Line  810: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  815: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/543a8c07d0c14b928f5fb7932d524c7616a305d7",
Line  830: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  835: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/cb9c024699e7c4e7c2cd74d371e8bd01000b01f4",
Line  855: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  860: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/ee2124b699c16abda171d3e78ec71ad71b333ab9",
Line  885: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  890: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/7fa971aef8e8a434d00aa23019e85594c635cb7e",
Line  915: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  920: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/8febab1fe4868922e90c3d8b692ac40d0f73dae5",
Line  940: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  945: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/c898f76a508c6102f987471b9becdb81b02e66d1",
Line  964: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  969: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/1c37dcac035f07c73e499e8e71824710832ecb00",
Line  989: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line  994: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/b45b3c1ed52854c80697ef6aad3ade7cf27478ef",
Line 1009: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line 1014: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/472ec1ae56ee515abc674a8254f65ac21735e7fb",
Line 1028: "url": "https://github.com/maxmind/GeoIP2-php.git",
Line 1033: "url": "https://api.github.com/repos/maxmind/GeoIP2-php/zipball/b0e12428d12e07b8fa944d60696d8f4e4c273f18",

ravage84 avatar Nov 15 '22 19:11 ravage84

@jasongill does it help to explicitlyuse "prefer dist"?

Yes, prefer dist works, but since that isn't saved in the composer.json / composer.lock, it's really just a local option. I suppose I could modify composer.json and specify a specific repository using the dist https url for the latest version, but in general this just seemed to be a very odd thing to appear. Pinning the package to the last working version is fine (for now at least).

Glad I am not crazy and someone else saw the same behavior!

jasongill avatar Nov 15 '22 20:11 jasongill

I am hoping this will go away on the next release. I don't really have an explanation for why it happened.

oschwald avatar Nov 28 '22 17:11 oschwald

Any update on this?

jakublabno avatar Mar 08 '23 09:03 jakublabno

This seems to have happened with the 3.0.0 release as well. I don't have any insight into why Packagist is doing this. An issue against them might be more successful.

oschwald avatar Dec 04 '23 17:12 oschwald

I ended up opening this issue: https://github.com/composer/packagist/issues/1425.

oschwald avatar Mar 01 '24 23:03 oschwald

Packagist fixed this issue and updated the URLs for the previous releases. Thank you for reporting it.

oschwald avatar Mar 06 '24 20:03 oschwald