GitHub PushEvent at 2014-10-02 12:13:09
Repository: content-store
Actor: rboulton
Payload: {"shas":[["3302789d6a91a9d068a7006eed3dec3bff7222f7","49625eb3d9ad3f30ca9199fb35d583c73709bf47@digital.cabinet-office.gov.uk","Add a pending integration test to start with.","David Thompson",false],["6fa2ac0b69b13a00b3547dff7d114d515a7e5253","49625eb3d9ad3f30ca9199fb35d583c73709bf47@digital.cabinet-office.gov.uk","Separate out presentation logic from ContentItem.\n\nUsing one `as_json` method for presentation on both side of the\npublic/private divide meant we were only presenting publicly-visible\nfields back in response to a `PUT` request, even if the errors we were\nreporting were in private fields. Pulling these two views apart should\nalso make it easier to pull in titles and public-facing fields for\nlinked items.","David Thompson",false],["53449504febf5c7a80514fe656c3384de7ba43cf","49625eb3d9ad3f30ca9199fb35d583c73709bf47@digital.cabinet-office.gov.uk","Use the private presenter for the message queue.\n\nAs it stands, the view we send back to the publishing tool and the view\nwe send out to other publishing apps are the same; if this changes,\nwe'll need a third presenter.\n\nThe messages we send out need the `update_type` field; there's no harm\nsending this back in responses to publishing tools, since they will have\nprovided it in the first place.","David Thompson",false],["fab36c7000a2354d4f121fde5bc62015860d91c0","49625eb3d9ad3f30ca9199fb35d583c73709bf47@digital.cabinet-office.gov.uk","Add a `links` field to content items.\n\nThis includes validation on the shape and type of the `links` structure,\nbecause Mongoid will only validate that the value is a hash: we need to\nspecify any further restrictions on the shape of that hash ourselves.","David Thompson",false],["9a072ca1258d181ad84fa9ed3e38e97301d9ff19","49625eb3d9ad3f30ca9199fb35d583c73709bf47@digital.cabinet-office.gov.uk","Add related links to the model.\n\nThis is intentionally over-simplified, to the point where it doesn't\ntake account of redirect items (or duplicate content IDs of any kind)\nand is going to perform horribly on any decent-sized data set, but it\ncovers the basic idea.","David Thompson",false],["12432a9a49e67b9359a3c6b01fe6a52ce35d1a94","49625eb3d9ad3f30ca9199fb35d583c73709bf47@digital.cabinet-office.gov.uk","Ignore redirects when looking up linked items.","David Thompson",false],["59a1bd1dcf98be795e60861df05929a7be5e648e","49625eb3d9ad3f30ca9199fb35d583c73709bf47@digital.cabinet-office.gov.uk","Pick the latest content item with a content ID.\n\nIt is possible (for instance, when setting up a redirect) to have\nmultiple items with the same content ID. In these cases, the\nlatest-published wins.","David Thompson",false],["cdf1d5fb62259639a862ee463f42ebe0538ebc1c","49625eb3d9ad3f30ca9199fb35d583c73709bf47@digital.cabinet-office.gov.uk","Show linked items in the public content view.","David Thompson",false],["041b6293f4e05472af98d0ac1d3cc5635397041d","49625eb3d9ad3f30ca9199fb35d583c73709bf47@digital.cabinet-office.gov.uk","Add API and web URLs to presented items.\n\nThis is in the simplest way that could possibly work, and doesn't yet\ntake advantage of Rails' path helpers to generate the API URLs.","David Thompson",false],["9c178545e82e8d84781a7ac27343aec2e8491570","49625eb3d9ad3f30ca9199fb35d583c73709bf47@digital.cabinet-office.gov.uk","Use Rails' helpers to generate API URLs.\n\nRails, given context from an application and a request, knows how to\ngenerate the URL for a content item, but the presenter doesn't have\naccess to this logic. Passing this in as a callable to the presenter\ngives us a very small interface to replicate in the tests, and lets us\nkeep the app's routing logic out of the presenter.\n\nThe app doesn't have any such context for the URLs as they're used on\nthe site, so there's no real benefit to pulling out the web URLs in the\nsame way.","David Thompson",false],["f6670e11d0d46089e9758e0b876951dfbf58106b","49625eb3d9ad3f30ca9199fb35d583c73709bf47@digital.cabinet-office.gov.uk","Make linked item lookups index-covered.\n\nBy adding an index with the fields we want to query on, including the\nfields we want to return and expose in the public presenter, we can make\nit so the linked item query never has to load the document itself.\n\nOnce we have 100,000 items in the content store, rather than the 100 or\nso we have at the moment, we'll need to take a closer look at this index\nand how well it performs. For now, it turns a query that does a scan\nover the entire collection into an index-covered query that should only\nneed to scan a single document.\n\nAs another performance consideration, we're currently doing a query for\neach linked item; we'll need to revisit that as we incorporate more link\ntypes and therefore more linked items.","David Thompson",false],["818e28f87295a17590a514ae29ecf3cc058e9d9e","6518d16a85396e511b329a97b21dda0c9acebabc@digital.cabinet-office.gov.uk","Improve link validation error message assertions","Alex Tomlins",false],["5319c6a073654d017022cbdd8d45a3f66bd3ce27","6518d16a85396e511b329a97b21dda0c9acebabc@digital.cabinet-office.gov.uk","Tighten up validation of links keys\n\nThis now requires that all keys in the links hash are underscored\nalphanumeric strings.\n\nThis work also exposed a bug where nil would be allowed as a key.  This\nis because when Enumerable#any? is used without a block, it returns true\nif any of the items in the array are truthy.  This means that an array\ncontaining nil returns false, so the validation was being skipped.","Alex Tomlins",false],["63f4a90ef63e773640ddb59646d46d120a10ebfc","6518d16a85396e511b329a97b21dda0c9acebabc@digital.cabinet-office.gov.uk","Split up message_queue_publishing_spec for clarity\n\nTo make it easier to follow the intent of this feature, this splits up\nthe specs for the content into 2 separate ones, and refines the\ndescriptions of them.","Alex Tomlins",false],["fa15a11995796ac6586c191da158196edb6f0bef","6518d16a85396e511b329a97b21dda0c9acebabc@digital.cabinet-office.gov.uk","Add an end-to-end spec for some of the behaviour.\n\nAdds some tests for the end-to-end behaviour.  These only hit the HTTP\nAPI, and do no DB level manipulation.  A high-level test of the\nblack-box behaviour...","Alex Tomlins",false],["be275fe1eca763adb00c8810d607acbe5be265f4","1960665b789a54413d9da7eaa93a0e5f5b4672af@tekin.co.uk","Consistent naming of variable/parameter\n\nThis matches the parameter name in PublicContentItemPresenter","Tekin Suleyman",false],["f48d0ee9a72d14814ddab5386edf0802323fa7b3","1960665b789a54413d9da7eaa93a0e5f5b4672af@tekin.co.uk","Make clearer the intent of the override\n\nThis makes it clearer why we are overriding the default JSON\nrepresentation (so that the internal \"_id\" field name is not exposed to\nthe outside world and \"base_path\" is used instead)","Tekin Suleyman",false],["c452befbc694e24d9671ebe939f0b31e4d01804e","1960665b789a54413d9da7eaa93a0e5f5b4672af@tekin.co.uk","Simplify JSON generation","Tekin Suleyman",false],["6489d333b310e524677352ecdc06bc28bdfba281","1960665b789a54413d9da7eaa93a0e5f5b4672af@tekin.co.uk","Merge pull request #51 from alphagov/related-items\n\nShow linked items in published content","Tekin Suleyman",false],["f90d5b28d39b868675c669e1de6ff58703d84963","2b6bbb4bffb950b0967cd3a1166c66cfcf859973@digital.cabinet-office.gov.uk","Enable publisher confirms when writing to rabbit\n\nWe want to make sure that things listening for publish events via a\nrabbit queue get notified of all publish events.  However, without\npublisher confirms (or transactions, which are much more expensive in\nterms of latency), there is no way to tell whether Rabbit has received a\nmessage and placed it on the appropriate queues.  This patch enables\npublisher confirm mode on the channel used to publish messages to\nrabbit, and waits for a confirmation for each message.\n\nIf no confirmation comes back (or a \"nack\" comes back indicating an\ninternal problem in Rabbit), this simply logs the error and the message\nto errbit.  Our usual action in this situation would be to republish\nmanually either the failed message or all documents modified since a\ngiven timestamp.\n\nUsually, it is desirable to either check for publisher confirms\nasynchronously, or to batch checks, because it can take a while for\nrabbit to send the ack (particularly if durable and persistent queues\nare being used, because then the message needs to be written to disk\nfirst).  However, for our current expected use, waiting for each message\ndirectly seems reasonable.  If this has unacceptable performance, we can\ninvestigate directly.\n\nIt is hard to test this patch; I've tested that the Bunny method gets\ncalled, and I've checked that the connection from publisher to Rabbit is\nin publish confirm mode by running the system on my dev VM and\ninspecting the connection in the Rabbit console.  I'm not sure how to\nbuild an integration test of this, though, because getting nacks after\npublish only happens when Rabbit is failing, and this is hard to\ntrigger.\n\nFor more information on publisher confirms, see\nhttps://www.rabbitmq.com/confirms.html; for information on Bunny's\nsupport, see\nhttp://rubybunny.info/articles/extensions.html#publisher_confirms_publisher_acknowledgements","Richard Boulton",true]],"size":21,"ref":"refs/heads/enable-publisher-confirms","head":"e97d22db8388ead4d794aa9bf611af6b315d6bd2"}