{"push_id":1428255815,"size":22,"distinct_size":4,"ref":"refs/heads/feature/list-first-25-content-items-org","head":"21ebcd4bc33bd7ba098a7f29811c64bead999f59","before":"7a1e65591d56012b82d404647aeeef6257e83f24","commits":[{"sha":"8e4a2fa3d110295c9a6a9d244b87798e5e7f537e","author":{"name":"Anika Henke","email":"daff0ff63c3cf3bc4d55d4b41bc43d164b9a8207@digital.cabinet-office.gov.uk"},"message":"Add gov.uk frontend\n\n* Add frontend gems.\n  (We need to swap `govuk_template` with `slimmer` at some point.)\n* Use gov.uk Elements styling in CSS.\n* Change application layout to inherit from `govuk_template`.","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/8e4a2fa3d110295c9a6a9d244b87798e5e7f537e"},{"sha":"406b01fa8f8e9662e756dcfd7a67d67c5bf91ca2","author":{"name":"Anika Henke","email":"daff0ff63c3cf3bc4d55d4b41bc43d164b9a8207@digital.cabinet-office.gov.uk"},"message":"Set default styling for headings and lists\n\nThis sets default styling for headings, lists and forms\nwhile inheriting it from the relevant Gov.uk Elements classes\nbecause otherwise those elements wouldn't be styled at all.","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/406b01fa8f8e9662e756dcfd7a67d67c5bf91ca2"},{"sha":"5df4c793bfd0470a45a05d629bfc27c16a2a486b","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Merge pull request #5 from alphagov/add-frontend\n\nPreparations to use gov.uk style frontend","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/5df4c793bfd0470a45a05d629bfc27c16a2a486b"},{"sha":"58ecd31901d1fb9f8670011f08a287731acb2bd9","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Add endpoint to list organisations\n\nThe endpoint lists the Organisations and the number of content items\nwithin an organisation. Exercises the controller and the routing.","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/58ecd31901d1fb9f8670011f08a287731acb2bd9"},{"sha":"f206664b62f0ea05df798789d548fe82fcba56bf","author":{"name":"Leena Gupte","email":"08125b01361425dc82f9e1df0a802d21e35f0cbe@digital.cabinet-office.gov.uk"},"message":"Add application root route\n\nWe have decided to add a temporary root route to organisations#index as\na way to exercise some app code when the application is first accessed.\n\nThis route will change in future commits one the application continues\nshaping up.","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/f206664b62f0ea05df798789d548fe82fcba56bf"},{"sha":"aee8c44e6e1e7e6ceabe6e44ea98b4e9a61aed41","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Return JSON with the organisation slugs\n\nExercises the creation of the Organisation model along with its\ncontroller. We keep the scope of this commit small, and will add the\nContentItems model in future commits.\n\nWe are using a very basic mechanism to serialise to JSON the\norganisations .\nThis is because most of this code will go away once we expose\nan API to other apps. We will need to rely on ApiSerializers[2] or\nusing libraries like Grape[1]. No need to complicate things further.\n\n[1]: https://github.com/ruby-grape/grape\n[2]: https://github.com/rails-api/active_model_serializers","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/aee8c44e6e1e7e6ceabe6e44ea98b4e9a61aed41"},{"sha":"8e71673748042ce7ea81edf48cf31d1c8e370ac4","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Add number of content items to Organisation JSON\n\nTo count the number of content items per organisation we need to create\nthe model (ContentItem) along with setting up the associations.\n\nTo facilitate testing we are including the library Shoulda[1]\n\nWe are using a very basic mechanism to serialise to JSON the\norganisations and the requested number of Content Items.\nThis is because most of this code will go away once we expose\nan API to other apps. We will need to rely on ApiSerializers[3] or\nusing libraries like Grape[2]\n\nIt is not ideal either the way we are mocking the HTTP requests, as we\nare not webmoking the get request, but the library. Again, this is\nsomething that will go away in a few weeks, so no need to work any\nfurther.\n\n[1]: https://github.com/thoughtbot/shoulda-matchers\n[2]: https://github.com/ruby-grape/grape\n[3]: https://github.com/rails-api/active_model_serializers","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/8e71673748042ce7ea81edf48cf31d1c8e370ac4"},{"sha":"3a24346c2e5c2cf15e871043c99cf15ef4e45fb0","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Refactor test with FactoryGirl\n\nThere are some duplications when setting up the tests, so we have\ndecided to go with FactoryGirl[1] as a way to have a expressive way\nto setup our tests.\n\nThis approach seems compliant with other GOV.UK apps.\n\n[1]: https://github.com/thoughtbot/factory_girl","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/3a24346c2e5c2cf15e871043c99cf15ef4e45fb0"},{"sha":"5b2f82302d97e9dc9bb88f7cf1e0a878d2f41cbc","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Add rake task to import organisation\n\nThe task receives the slug of the organisation and import the Content\nItems. It delegates the importing process to Importers::Organisations,\nas the rake task is mainly a way to import the data, but there can be\nother ways, for example, using `rails console` directly.\n\n**Developer Note:**\n\n `Reenable` rake task before each tests run.\n\nInvoke does not run the task twice, for example if you invoke the\nsame task in a previous test it won't run again.\n\nSo reenable call is required to allow tasks to run if the task\nis invoked again.\n\nSee this url for confirmation [1]\n\n[1] http://apidock.com/ruby/v1_9_3_392/Rake/Task/reenable","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/5b2f82302d97e9dc9bb88f7cf1e0a878d2f41cbc"},{"sha":"53be95ae00b1631de5e0cff52e9115ac9d82f52a","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Import an organisation and ContentItems via SearchAPI\n\nCreates the Organisation with the provided slug. It queries the\nsearchAPI with and filters all ContentItems per organisation.\n\nFor each ContentItem it stores its `content_id`. This is, so far, the\nonly attribute that we need to store in the model for current story. In\nfuture stories we will evolve it to include other attributes.\n\nWe temporarily rely on [HTTParty][1] to query SearchAPI; this is a\ntemporary solution as we will use GDS  Adapters as a way to communicate\nwith other applications. The task to upgrade to use GDS adapters is\ntracked in a [Trello Card][2]\n\nIt is not ideal either the way we are mocking the HTTP requests, as we\nare not webmoking the get request, but the library. Again, this is\nsomething that will go away in a few weeks, so no need to work any further.\n\nRaises a \"No result for slug\" exception so the caller understands when\nand why the organisation has not been loaded: Every Organisation should\nhave, at least, a ContentItem. If during the migration process, we found\n an organisation with no Content Items we raise an exception as there is\na content problem that need to be fixed for that organisation.\n\n[1]: https://github.com/jnunemaker/httparty\n[2]: https://trello.com/c/mn8JPHYR/78-use-gds-adapter-to-retrieve-content-items-for-an-organisation","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/53be95ae00b1631de5e0cff52e9115ac9d82f52a"},{"sha":"32932fa4d7898f823fc94ef7cdcbbd7140b64310","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Add pagination to retrieve the list of content_items\n\nOrganisations might have thousands of pages, and the SearchAPI has\na page limit of 1000 elements when querying data. So we should iterate\nthrough all the pages of the query results so we iterate through the\nwhole collection of content items that belong to that organisation.","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/32932fa4d7898f823fc94ef7cdcbbd7140b64310"},{"sha":"5b6e795929fa2b40c8553fbf47fa0e1e9ae368df","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Prevent failure when last page has 0 results\n\nWe might get an unexpected error if the last page has 0 results; this\ncould happen if the number of Content Items is a multiple of the page\nsize.\n\nThis commit prevent raising an exception in this situation by checking\nthat the Organisation has ContentItems before raising the exception.","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/5b6e795929fa2b40c8553fbf47fa0e1e9ae368df"},{"sha":"731381f0017c74d2c4d867c63243458cc1973c4d","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Add RSpec contexts to improve tests readability\n\nBy adding contexts to RSepc we get better insights of the class\nbehaviour. For example, when we run\n\n```bash\nrspec spec --format documentation\n```\n\nWe get the following output\n\nImporters::Organisation\n  queries the search API with the organisation's slug\n  Content Items\n    imports a `content_id` for every content item\n    imports all content items for the organisation\n  Organisation\n    raises an exception with an organisation that does not exist\n    imports an organisation with the provided slug\n  Pagination\n    handles last page with 0 results\n    paginates through all the content items for an organisation","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/731381f0017c74d2c4d867c63243458cc1973c4d"},{"sha":"5e0cb25ef0cd400e6aa8662c26c9bd942460f384","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"DRY-UP RSpec tests to import organisations\n\nA few refactorings to simplify the way the tests are setup.\nWe are using `let` to setup the test fixture, and a method:\n`build_response` to build a SearchAPI response for the expected payload.","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/5e0cb25ef0cd400e6aa8662c26c9bd942460f384"},{"sha":"1101d65f3a09a5dae9623cd4343b79606afe34d7","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Use instance methods method for Importers::Organisation\n\nIn preparation to refactor `Importers::Organisation` we convert the\nclass methods into instance methods so we can store state:\n- start\n- batch\n- slug\n\nOnce we have the instance methods and the state it is much easier to\nextract method and decompose the main function `run`","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/1101d65f3a09a5dae9623cd4343b79606afe34d7"},{"sha":"b796aac74439d83fa4cbcf21d75caeb6f0fd479e","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Refactor Organisation importer: improve readability\n\nExtract methods in `Importers::Organisation` using the instance variables\ncreated in the previous commit.\nWe extract methods with meaningful names that describe the behaviour.","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/b796aac74439d83fa4cbcf21d75caeb6f0fd479e"},{"sha":"a09be10e36fe10333415e9c833547b29aeccb845","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Fixes lint errors\n\nRemoves ~50 lint errors within previous commits. Ideally I should\nfixup all the updates into their commits, but it feels like a big task\nwhich might not worth the time.\n\nI have created a Trello card[1] to automate Lint when running all tests\nin each commit so we prevent this situations from happening again.\n\n[1]: https://trello.com/c/O6wNOS9N/79-run-lint-validator-when-running-rspec-tests","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/a09be10e36fe10333415e9c833547b29aeccb845"},{"sha":"c928a79fb23bad47d57eb1e06443d81b83c3d8be","author":{"name":"Pablo Manrubia","email":"0135dcad04957dc37e942d031bc793dd210bbc84@gmail.com"},"message":"Merge pull request #7 from alphagov/number-of-content-items-per-organisation-supersede\n\nEndpoint for Organisations and ContentItems per organisation","distinct":false,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/c928a79fb23bad47d57eb1e06443d81b83c3d8be"},{"sha":"3b1ad3799c50937a4c9c09cb34012017e8d93190","author":{"name":"Leena Gupte","email":"08125b01361425dc82f9e1df0a802d21e35f0cbe@digital.cabinet-office.gov.uk"},"message":"Point the root of the application to the organisations page","distinct":true,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/3b1ad3799c50937a4c9c09cb34012017e8d93190"},{"sha":"0980f996a493fe12405adb3d7b1c10a5081f42c1","author":{"name":"Ikenna Okpala","email":"b4a5ea001e047040e8c9075b67a268293138da2c@ikennaokpala.com"},"message":"Define endpoint for an org’s content items\n\nThe defined endpoint here will form the basis for fetching and listing\ncontent items belonging to an organisation, where the organisation’s\nid has been provided.","distinct":true,"url":"https://api.github.com/repos/alphagov/content-performance-manager/commits/0980f996a493fe12405adb3d7b1c10a5081f42c1"}]}
{"actor":{"display_login":"ikennaokpala"}}