Giter VIP home page Giter VIP logo

Comments (7)

francoispluchino avatar francoispluchino commented on May 23, 2024

With the Github driver, the redirection does not work, because the driver uses the API v3 of Github.com.

An automatic redirection exists for navigation with the browser or using GIT (https://github.com/blog/1508-repository-redirects-are-here), but they does not work with the API.

I contacted the support of Github.com, and am awaiting a response.

However the issue Github API returns 404, but default http request returns 301 on Stackoverflow, tells me that it's not going to be fixed quickly (+6 months).

from composer-asset-plugin.

francoispluchino avatar francoispluchino commented on May 23, 2024

To summarize the response of support: use the solution described in the question Github API returns 404, but default http request returns 301.

from composer-asset-plugin.

cebe avatar cebe commented on May 23, 2024

Looks like this is a general problem of composer then too, right? So when renaming repos, the original author has to take care about renaming the repo Urls in the bower repo. I'd suggest to report this problem to the library authors instead of building unreliable workarounds or waiting for github to change it.

from composer-asset-plugin.

francoispluchino avatar francoispluchino commented on May 23, 2024

@cebe The subject is very interesting, and I just spent a good part of the afternoon talking to guys of support of Github. The problem with redirects of Github, it's that they are only available for the classic HTTP access and GIT, but that the API does not have this capability.

For the support of Github, it is true that this impossibility is problematic, but it's not tomorrow that the APIs will have the automatic redirects, and they advised me to take this analysis directly into my tool.

Given that the redirects work for GIT and classic HTTP access, the owner of the repository does not feel compelled to change the URL in the dependency manager, because it is still functional (for example, I created an issue for hammerjs, and my issue went unanswered for several months, and the URL has not changed).

I made a prototype for the fallback directly into Composer for Github driver (given that this is an issue of service Github). The prototype is functional for the public repositories, but not for the private repositories (because of the inability to authenticate with the token on github.com, and this is confirmed by the support). The support must yet to get back to me, for to suggest me an alternative way to find the new URL for the private repositories, but at first glance, it's not possible. It is true that it is only the public repositories that pose a problem.

However, for them, the principle of my implementation is the more appropriate.

from composer-asset-plugin.

francoispluchino avatar francoispluchino commented on May 23, 2024

@cebe I asked to the support if I could get the new URLs using raw.github.com, and the response is simple: it's not possible. But on the other hand, the content is recoverable with the old or the new URL, and this is compatible with private repositories (I have not still tested).

In this case, we just have to change the URL api.github.com to raw.github.com.

from composer-asset-plugin.

francoispluchino avatar francoispluchino commented on May 23, 2024

@cebe But ultimately, it's not possible to use raw.github.com, because we need get the list of tags and branchs. It remains that the first solution: usable only with public repositories (and it is them that pose problem).

from composer-asset-plugin.

francoispluchino avatar francoispluchino commented on May 23, 2024

Fixed by b9fb567.

from composer-asset-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.