pgxn / pgxn-api

Maintain and serve a REST API to search PGXN mirrors
http://pgxn.org/
15 stars 2 forks source link

Version Bug in amqp.json #8

Closed theory closed 13 years ago

theory commented 13 years ago

This looks wrong. Note that version 0.2.0 is listed in pg_amqp 0.3.0. This is wrong. There is no amqp 0.2.0 extension, only pg_amqp 0.2.0 and amqp 0.3.0. Might have been broken somehow when I reindexed with a new zip file that had a broken META.json with amqp 0.2.0. So probably the reindexing needs to properly delete an extension that was listed in the previous indexing and not in the new one.

theory commented 13 years ago

I'm going to fix that JSON file now, so for reference, its broken form was:

{
   "extension": "amqp",
   "latest": "stable",
   "stable": {
      "abstract": "AMQP protocol support for PostgreSQL",
      "dist": "pg_amqp",
      "docpath": "doc/amqp",
      "sha1": "4c7112a28584ecd2ac9607cf62274a0ec9d586cf",
      "version": "0.3.0"
   },
   "versions": {
      "0.2.0": [
         {
            "date": "2011-05-19T21:47:12Z",
            "dist": "pg_amqp",
            "version": "0.3.0"
         }
      ],
      "0.3.0": [
         {
            "date": "2011-05-19T21:47:12Z",
            "dist": "pg_amqp",
            "version": "0.3.0"
         }
      ]
   }
}
theory commented 13 years ago

The code I suspect is the root of the problem is update_extensions in PGXN::API::Indexer. It seems that it somehow thinks that there was an amqp 0.2.0 but there never was. Or…well, maybe there was. Before the reindex there was 0.2.0, but afterward there was only 0.3.0. So there needs to be a check to make sure that all the versions listed in the file are also in the mirror copy.