Skip to content

Show if a package is retired in hex.info #480

Closed

Description

@supersimple

When using mix.info packagename version it would be useful to show an alert that the version has been retired (and possibly also the reason for retirement.)

When using mix.info packagename perhaps just color the retired versions in red.

Activity

  1. supersimple commented on Jan 7, 2018

    @supersimple
    ContributorAuthor

    I am happy to submit a PR for this as soon as it is determined to be valuable.

  2. ericmj commented on Jan 7, 2018

    @ericmj
    Member

    Yeah, that would be a great addition.

  3. supersimple commented on Jan 7, 2018

    @supersimple
    ContributorAuthor

    @ericmj I have opened a PR for the hex.info packagename version
    For the hex.info packagename version, I think it would be best to change the response from the API.

     "releases" => [%{"url" => "https://hex.pm/api/packages/alphabetify/releases/1.0.2",
         "version" => "1.0.2"},
       %{"url" => "https://hex.pm/api/packages/alphabetify/releases/1.0.1",
         "version" => "1.0.1"},
       %{"url" => "https://hex.pm/api/packages/alphabetify/releases/1.0.0",
         "version" => "1.0.0"},
       %{"url" => "https://hex.pm/api/packages/alphabetify/releases/0.1.0",
         "version" => "0.1.0"}]
    

    I would propose adding a retired flag to the map. The only other way to get retired info on a version would be to iterate over each version returned in this call and check it's info. That could mean a lot more network requests.

    Please advise what you think the best course of action would be.

  4. wojtekmach commented on Jan 7, 2018

    @wojtekmach
    Member

    we initially decided to keep retirement information out of /api/packages/:name payload to keep it smaller (a bit more context in hexpm/hexpm#454 (comment)), but I agree that in this particular case it would be useful. Yet another way would be to somewhat mimic the registry and have it under a separate key, so:

    # GET /api/packages/foo
    {
      "releases": [
        {"version": "1.0.0", "url": "..."},
        {"version": "1.0.1", "url": "..."},
      ],
      "retirement": {
        "1.0.0": {"reason": "other", "message": "bad"}
      }
    }

    wdyt @ericmj?

  5. wojtekmach commented on Jan 11, 2018

    @wojtekmach
    Member

    @supersimple let us know if you'd like to finishing up this issue by handling mix hex.info pkg version mix hex.info pkg :) (requires hexpm/hexpm#607)

  6. supersimple commented on Jan 11, 2018

    @supersimple
    ContributorAuthor

    @wojtekmach I am not familiar with how/where to make those changes in teh API. If those are made (i assume in hexpm) I am happy to implement the use of them in hex.

  7. supersimple commented on Jan 11, 2018

    @supersimple
    ContributorAuthor

    Great. I'll look at it today.

  8. supersimple commented on Jan 12, 2018

    @supersimple
    ContributorAuthor

    @wojtekmach I was able to get a lot of it dont yesterday, I should be able to finish it up today and submit a PR for review.

  9. wojtekmach commented on Jan 15, 2018

    @wojtekmach
    Member

    Done in #487

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions