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

Support Composer Mirrors #27

Open
sprankhub opened this issue May 13, 2024 · 0 comments
Open

Support Composer Mirrors #27

sprankhub opened this issue May 13, 2024 · 0 comments

Comments

@sprankhub
Copy link

We use captainhook/captainhook-phar, which uses phar-io/composer-distributor. We wondered why sometimes, in CI, we get a GitHub timeout even though we use Private Packagist as a mirror. What we've seen:

- Installing captainhook/captainhook-phar (5.22.2): Extracting archive
WARNING
No GPG installation found! Use installed PHARs with care.
Consider installing GnuPG to verify PHAR authenticity.
If you need help installing GnuPG visit http://phar.io/install-gnupg
- Downloading artifact from https://github.com/captainhookphp/captainhook/releases/download/5.22.2/captainhook.phar
In Download.php line 26:

fopen(https://github.com/captainhookphp/captainhook/releases/download/5.22.
2/captainhook.phar): Failed to open stream: Connection timed out

However, our composer.lock file clearly defines a mirror for this package:

    {
        "name": "captainhook/captainhook-phar",
        "version": "5.22.2",
        "source": {
            "type": "git",
            "url": "https://github.com/captainhookphp/captainhook-phar.git",
            "reference": "055e6e109170a1d79353f9c94a6099e08bab15cd"
        },
        "dist": {
            "type": "zip",
            "url": "https://api.github.com/repos/captainhookphp/captainhook-phar/zipball/055e6e109170a1d79353f9c94a6099e08bab15cd",
            "reference": "055e6e109170a1d79353f9c94a6099e08bab15cd",
            "shasum": "",
            "mirrors": [
                {
                    "url": "https://repo.packagist.com/company/project/dists/%package%/%version%/r%reference%.%type%",
                    "preferred": true
                }
            ]
        },
        "require": {
            "composer-plugin-api": "^1.1||^2.0",
            "ext-json": "*",
            "ext-spl": "*",
            "phar-io/composer-distributor": "^1.0",
            "php": "^8.0 || ^8.1 || ^8.2"
        },
        "require-dev": {
            "composer/composer": "^1.1 || ^2.0"
        },
        "type": "composer-plugin",
        "extra": {
            "class": "CaptainHook\\Composer\\Plugin"
        },
        "autoload": {
            "psr-4": {
                "CaptainHook\\Composer\\": "src/"
            }
        },
        "notification-url": "https://repo.packagist.com/company/project/downloads/",
        "license": [
            "MIT"
        ],
        "authors": [
            {
                "name": "Sebastian Feldmann",
                "email": "sf@sebastian-feldmann.info"
            }
        ],
        "description": "PHP git hook manager",
        "homepage": "https://github.com/captainhookphp/captainhook",
        "keywords": [
            "commit-msg",
            "git",
            "hooks",
            "post-merge",
            "pre-commit",
            "pre-push",
            "prepare-commit-msg"
        ],
        "support": {
            "issues": "https://github.com/captainhookphp/captainhook/issues",
            "source": "https://github.com/captainhookphp/captainhook-phar/tree/5.22.2"
        },
        "funding": [
            {
                "url": "https://github.com/sponsors/sebastianfeldmann",
                "type": "github"
            }
        ],
        "time": "2023-12-13T23:08:05+00:00"
    }

Since the mirror is defined, the package should be downloaded from repo.packagist.com and not from github.com.

Would you be able to support this? 🫣 🙏

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

1 participant