Publishes mainstream content on GOV.UK
Switch branches/tags
Clone or download
Permalink
Failed to load latest commit information.
app Append GA tracking ID to check-state-pension urls Sep 17, 2018
bin Files modified after bundle exec rake rails:update Jun 2, 2017
config Refactor a redirect_to to please Brakeman Aug 2, 2018
data Remove temporary rake task Mar 24, 2017
db Revert "Fix GSS codes for two councils in Scotland with recent border… Jul 23, 2018
doc Update screenshots on README Jan 16, 2018
lib EID-970: Update change log lines in YAML files Sep 25, 2018
log Add log directory Apr 4, 2017
public Remove some compiled assets Oct 12, 2012
reports Write CSV reports to folder within the app Jun 30, 2015
script Upgrade from Errbit to Sentry for error logging Sep 13, 2017
spec/javascripts Change GOVUKAdmin.trackEvent analytics method call Apr 17, 2018
test Append GA tracking ID to check-state-pension urls Sep 17, 2018
vendor/assets/javascripts Remove old HTML5 shim Nov 6, 2014
.generators Added tests to ensure that a publication cannot be destroyed if it is… Nov 1, 2011
.gitignore Remove database.yml and schema.rb Sep 30, 2016
.rubocop.yml Disable some Rubocop checks Jun 26, 2018
.ruby-version Change .ruby-version to 2.5.1 (from 2.4.4) Jun 26, 2018
.simplecov Merge coverage reports so that unit tests contribute towards coverage. Dec 8, 2011
CONTRIBUTING.md Define contributing guide Nov 29, 2013
Dockerfile Change .ruby-version to 2.5.1 (from 2.4.4) Jun 26, 2018
Gemfile Bump govuk_app_config from 1.8.0 to 1.9.2 Sep 26, 2018
Gemfile.lock Bump govuk_app_config from 1.8.0 to 1.9.2 Sep 26, 2018
Jenkinsfile Enable Brakeman Aug 2, 2018
LICENCE.txt Add licence information to LICENCE.txt Apr 13, 2016
Procfile Use foreman to run application in docker environment Feb 16, 2018
README.md Update screenshots on README Jan 16, 2018
Rakefile Create test indexes when running Rake Jun 20, 2017
config.ru Bring ancillary files up to date with Rails 4. Apr 25, 2016
startup.sh Add startup script. Mar 31, 2012

README.md

Publisher

Publisher is the primary content design app for GOV.UK. It provides the user interface for entering all the key editorial formats and an API so other apps (primarily frontend) can access that data for display. It is sometimes referred to as "mainstream publisher".

Screenshots

alt tag alt tag alt tag

Live examples

Retired formats

  • Campaign
  • Programme
  • Video

Removed formats

  • Business Support - used to be retired, and the documents remained visible, now they're fully removed as editions and no longer visible in the app (although the artefacts do still exist). They have been fully migrated to specialist-publisher.

Working with Service Sign In pages

These pages do not have an admin interface and are instead managed through rake tasks.

See the README for more details.

Nomenclature

  • Artefact: a document on GOV.UK.

Technical documentation

This is a Ruby on Rails application that publishes the content for mainstream document formats to the shared mongo database. The frontend app reads this content from the Content Store.

Dependencies

  • imminence - provides geographical search tools
  • content-store - new central storage of published content on GOV.UK
  • publishing-api - will provide workflow for all content published to GOV.UK - creating a new document, publishing it, etc. Content published here will end up in the content-store
  • govuk-content-schemas - defines the schemas for new-style document formats. Required to run the tests.
bundle exec rake local_transactions:import SOURCE=/path/to/local_authority_service_details.CSV
  • statsd - this application uses statsd-ruby to send metrics to statsd. If a statsd process isn't present on the server it won't matter as statsd-ruby sends metrics over UDP. If a statsd process is present then it'll send strings with the respective increment/decrement/gauge function to use.
  • asset-manager - manages uploaded assets (images, PDFs, videos etc.). Publisher needs an OAuth bearer token in order to authenticate with Asset Manager. By default, this is loaded from the PUBLISHER_ASSET_MANAGER_BEARER_TOKEN environment variable in config/initializers/gds_api.rb, which is automatically provided if using the development VM. Otherwise, to obtain this bearer token you should create an API user in the signonotron2 application. In the signonotron2 directory, to generate the bearer token you need, run:
rake api_clients:create[publisher,publisher@example.com,asset-manager,signin]
  • calendars - provides bank holiday information to feed into working days calculator. Working days calculator is used to generate deadlines for fact checks.
  • link-checker-api - checks all the links in an edition on request from the edition show page.

Running the application

If you're just interested in running the Publisher locally, with a minimum of interaction with other apps, here's how. This assumes you're using this development setup.

cd /var/govuk/development
bowl publisher

Running the test suite

bundle exec rake

The test suite relies on the presence of the govuk-content-schemas repository. If should be at the same directory level as the government-frontend repository.

Or to specify the location explicitly:

GOVUK_CONTENT_SCHEMAS_PATH=/some/dir/govuk-content-schemas bundle exec rake

State machine

Maps out the transitions between states for the Edition class. These transitions are defined in the workflow module. A diagram of the current state machine can be seen here: state machine diagram. The diagram can be (re)generated using the state_machines-graphviz gem, by doing:

bundle exec rake state_machines:draw CLASS=Edition

This will generate a diagram in the doc/state_machines folder.

LinkCheckerAPI

The link-checker-api has been integrated on the show page for editions. It extracts all links from within any GovSpeak fields and sends them to the /batch endpoint of the API. In this request it also sends across a webhook_callback which then populates any information about broken/warning links. More reading about the endpoints can be found here

Licence

MIT License