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

Redirect support #21

Open
ostrolucky opened this issue Aug 7, 2020 · 5 comments
Open

Redirect support #21

ostrolucky opened this issue Aug 7, 2020 · 5 comments

Comments

@ostrolucky
Copy link

I'm getting some error related to redirect

  mtdowling/jmespath.php 52168cb9..42dae2cb
dantleech/whatchanged: ERROR: Unexpected response from Github: "{
    "message": "Moved Permanently",
    "url": "https:\/\/api.github.com\/repositories\/8300763\/compare\/52168cb9472de06979613d365c7f1ab8798be895...42dae2cbd13154083ca6d70099692fef8ca84bfb",
    "documentation_url": "https:\/\/docs.github.com\/v3\/#http-redirects"
}"

composer.lock related section (after update):

        {
            "name": "mtdowling/jmespath.php",
            "version": "2.6.0",
            "source": {
                "type": "git",
                "url": "https://github.com/jmespath/jmespath.php.git",
                "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/42dae2cbd13154083ca6d70099692fef8ca84bfb",
                "reference": "42dae2cbd13154083ca6d70099692fef8ca84bfb",
                "shasum": ""
            },
            "require": {
                "php": "^5.4 || ^7.0 || ^8.0",
                "symfony/polyfill-mbstring": "^1.17"
            },
            "require-dev": {
                "composer/xdebug-handler": "^1.4",
                "phpunit/phpunit": "^4.8.36 || ^7.5.15"
            },
            "bin": [
                "bin/jp.php"
            ],
            "type": "library",
            "extra": {
                "branch-alias": {
                    "dev-master": "2.6-dev"
                }
            },
            "autoload": {
                "psr-4": {
                    "JmesPath\\": "src/"
                },
                "files": [
                    "src/JmesPath.php"
                ]
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "MIT"
            ],
            "authors": [
                {
                    "name": "Michael Dowling",
                    "email": "mtdowling@gmail.com",
                    "homepage": "https://github.com/mtdowling"
                }
            ],
            "description": "Declaratively specify how to extract elements from a JSON document",
            "keywords": [
                "json",
                "jsonpath"
            ],
            "time": "2020-07-31T21:01:56+00:00"
        }
@dantleech
Copy link
Owner

Could maybe be a simple as enabling rediect in CuRL?

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

@ostrolucky
Copy link
Author

ostrolucky commented Aug 8, 2020

Looks like it will be more complicated than that. Doing such change now results into

mtdowling/jmespath.php 52168cb9..42dae2cb


  [DTL\WhatChanged\Exception\WhatChangedRuntimeException]
  Unexpected response from Github: "{
      "message": "Not Found",
      "documentation_url": "https:\/\/docs.github.com\/rest\/reference\/repos#compare-two-commits"
  }"


what-changed [--merge-commits] [-F|--full-message]

Curl confirms

❯ curl -L  https://api.github.com/repos/jmespath/jmespath/compare/52168cb9472de06979613d365c7f1ab8798be895...42dae2cbd13154083ca6d70099692fef8ca84bfb
{
  "message": "Not Found",
  "documentation_url": "https://docs.github.com/rest/reference/repos#compare-two-commits"
}

So I wonder how composer/packagist handles this.

@dantleech
Copy link
Owner

dantleech commented Aug 16, 2020

So not sure if we can fix this (I'm assuming the url in the response should be the "new" one, and it doesn't exist), maybe it's enough to tolerate the error?

@ostrolucky
Copy link
Author

I mean composer did handle this properly so there must be a way. But tolerating the error might also be an option

@dantleech
Copy link
Owner

Also encounted this:

  webmozart/glob 3cbf63d4..06358faf
dantleech/whatchanged: ERROR: Unexpected response from Github: "{
    "message": "Moved Permanently",
    "url": "https:\/\/api.github.com\/repositories\/28594822\/compare\/3cbf63d4973cf9d780b93d2da8eec7e4a9e63bbe...06358fafde0f32edb4513f4fd88fe113a40c90ee",
    "documentation_url": "https:\/\/docs.github.com\/v3\/#http-redirects"
}

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

2 participants