Skip to content

alphagov/datagovuk_find

Code Climate Test Coverage

data.gov.uk Find

This repository contains the beta-stage frontend component of data.gov.uk

main-mvp Branch CI/CD Pipeline

Overview

This repository contains an automated CI/CD pipeline for the main-mvp branch that enables rapid development and deployment of MVP features to the Integration environment.

What it does:

  • Runs automated security scans and tests on every PR
  • Builds Docker images when code is merged
  • Automatically updates deployment configurations
  • Deploys to Integration environment via ArgoCD

Branch Structure

datagovuk_find repository:
├── main            → Production deployments
└── main-mvp        → MVP/Integration deployments

Pipeline Flow

Developer creates PR → main-mvp
         ↓
    CI Checks Run
    ├─ Security Analysis
    ├─ CodeQL SAST
    ├─ Dependency Review
    └─ Test Suite
         ↓
    PR Approved & Merged
         ↓
    Docker Image Built
    (ghcr.io/alphagov/datagovuk_find:main-mvp-<SHA>)
         ↓
    Charts Updated
    (charts/datagovuk/images/integration/find.yaml)
         ↓
    ArgoCD Detects Change
         ↓
    Deployed to Integration! 

GitHub Actions Workflows

Located in .github/workflows/:

1. ci-mvp.yaml

Purpose: Runs CI checks on every PR to main-mvp

Triggers:

  • Pull requests to any branch
  • Pushes to main-mvp

Jobs:

  • Security Analysis - Brakeman security scanning
  • CodeQL SAST - Semantic code analysis
  • Dependency Review - Checks for vulnerable dependencies
  • Test Suite - Full RSpec tests with Redis

2. build-image-mvp.yaml

Purpose: Builds and pushes Docker image on merge

Triggers:

  • Merges to main-mvp branch
  • Manual workflow dispatch

Process:

  • Builds Docker image
  • Tags with commit SHA
  • Pushes to ghcr.io/alphagov/datagovuk_find:<SHA>

3. update-charts-mvp.yaml

Purpose: Updates deployment configuration automatically

Triggers:

  • After build-image-mvp.yaml completes successfully

Process:

  • Runs update-find-sha-mvp.sh script
  • Updates image SHA in govuk-dgu-charts
  • Pushes directly to main-mvp branch

Scripts

Located in docker/:

update-find-sha-mvp.sh

Purpose: Updates Find application image SHA in deployment charts

What it does:

  1. Clones govuk-dgu-charts repository
  2. Checks out main-mvp branch
  3. Updates charts/datagovuk/images/integration/find.yaml
  4. Commits change with detailed message
  5. Pushes directly to main-mvp branch
  6. Cleans up temporary files

Environment Variables Required:

  • GH_TOKEN - GitHub token with write access to govuk-dgu-charts
  • GH_REF - Source branch reference (main-mvp)

File Updated and this path is on the govuk-dgu-charts repo:

# charts/datagovuk/images/integration/find.yaml
repository: ghcr.io/alphagov/datagovuk_find
tag: <SHA>
branch: main-mvp

Creating a Feature

# 1. Create feature branch from main-mvp
git checkout main-mvp
git pull origin main-mvp
git checkout -b feature/jira-ticket-requirement

# 2. Make your changes
# ... code, commit, etc.

# 3. Push and create PR
git push origin feature/jira-ticket-requirement

Run markdown rendering rake task locally

This is useful to see the changes you made to markdown content. It will parse the markdown files, read the front matter, body and create or update the corresponding content in app/views/generated/collections directory.

bundle exec rake markdown:render

Creating a Pull Request

  1. Go to GitHub and create PR targeting main-mvp
  2. CI checks will run automatically:    - Security Analysis    - CodeQL SAST scan    - Dependency Review    - Tests
  3. All checks must pass before merging
  4. Request review from national-data-library team
  5. Once approved, merge the PR

How to run this repo locally

There are currently 3 ways to run this repo locally:

  1. Via govuk-dgu-charts - An end to end setup from ckan to Solr to Find. This is the closest stack to the Find app running on EKS. Instructions for how to setup and run Find this way available on the linked repo.
  2. Via docker stack in ckanext-datagovuk - This will be the fastest way to see your changes deployed and interact with a stack containing some seeded test data. It is also possible to run tests on it and debug issues within the containers.
  3. Manual installation - this will give the fastest way to run the tests. Instructions for this below.

Manual installation

Prerequisites

You will need to install the following for development.

  • rbenv or similar to manage ruby versions
  • bundler to manage gems
  • yarn to manage node packages

Most of these can be installed with Homebrew on a Mac.

Getting Started

1. Run the rake task

bundle exec rake markdown:render

⚠️ This is a required step to see content in the app. This is a one time setup step and you can run it again whenever you make changes to the markdown files located at app/content.

2. Build the dependencies

yarn

yarn installs the node dependencies and builds the assets for the app.

bin/setup

This will install the ruby dependencies and start the server on http://localhost:3000 and you can view the app in your browser.

3. Run the server

bundle exec rails s

Or

yarn && bundle exec rails s

Markdown rendering

The markdown rendering executed by the rake task markdown:render is a two step process:

  1. The markdown files located at app/content are parsed and the content is extracted.

  2. The content is then used to create or update the corresponding content in the app/views/generated/collections directory.

⚠️ The generated files are ignored by git and are not meant to be edited directly. Any changes to the content should be made in the markdown files and the rake task should be run again to see the changes reflected in the app.

This rake task is also used in the CI pipeline to ensure that any changes to the markdown files are reflected in the app when deployed.

Deployment

See the developer docs on data.gov.uk deployment

Example application URLs

About

Beta version of Find Data

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors