Skip to content

Commit

Permalink
Merge pull request #252 from epimorphics/preprod
Browse files Browse the repository at this point in the history
Release v1.7.9 to Production
  • Loading branch information
bogdanadrianmarc authored Oct 1, 2024
2 parents f4b63d5 + ebfdde5 commit bed09fc
Show file tree
Hide file tree
Showing 37 changed files with 397 additions and 450 deletions.
48 changes: 39 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,51 @@
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore vscode config
.vscode

## Ignore bundler configuration:
/.bundle
/vendor/bundle
/lib/bundler/man/

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore Byebug command history file.
.byebug_history
.github-token
.tags
/.bundle
/db/*.sqlite3
/db/*.sqlite3-journal
/log/*.log
/tmp

# Ignore node_modules
node_modules/

# Ignore precompiled javascript packs
/public/packs
/public/packs-test
/public/assets/
coverage/
/public/assets

# Ignore uploaded files in development
/storage/*
!/storage/.keep
/public/uploads

### Rails specific ###
.byebug_history
/public/system
/coverage/
tmp

# Ignore files specific to the development environment
fc.json
fc_simple.json
index-names.txt
index.json
tags

# Ignore dot files used by environment or IDE tools
.tags
.tool-versions
.github-token
.npmrc
29 changes: 19 additions & 10 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,42 @@ Layout/LineLength:
- config/**/*
- test/**/*

Metrics/ClassLength:
Lint/ConstantDefinitionInBlock:
Exclude:
- test/**/*

Lint/DuplicateBranch:
Enabled: false

Metrics/AbcSize:
Max: 30
Exclude:
- test/**/*
- lib/tasks/**/*

Metrics/BlockLength:
Max: 30
Exclude:
- test/**/*
- lib/tasks/**/*

Metrics/ClassLength:
CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
Exclude:
- test/**/*

Metrics/MethodLength:
CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
Exclude:
- test/**/*
- lib/tasks/location.rake

Style/FormatStringToken:
Enabled: false

Style/Documentation:
Exclude:
- test/**/*

Style/OptionalBooleanParameter:
Style/FormatStringToken:
Enabled: false

Lint/ConstantDefinitionInBlock:
Exclude:
- test/**/*

Lint/DuplicateBranch:
Style/OptionalBooleanParameter:
Enabled: false
55 changes: 52 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,54 @@ This app allows the user to explore HMLR price-paid open linked data.

## Changelog

## 1.7.9 - 2024-09

- (Jon) Updated the application exceptions controller to instrument the
`ActiveSupport::Notifications` for internal errors
[GH-244](https://github.com/epimorphics/ppd-explorer/issues/244)
- (Jon) Updated `config/initializers/prometheus.rb` to include the `Middleware
instrumentation` fix for the 0 memory bug by notifying Action Dispatch
subscribers on Prometheus initialise
[GH-244](https://github.com/epimorphics/ppd-explorer/issues/244)
- (Jon) Updated `config/puma.rb` to include metrics plugin and port information
for the metrics endpoint as environment variable, with default, to enable
running multiple sibling HMLR apps locally if needed without port conflicts
[GH-244](https://github.com/epimorphics/ppd-explorer/issues/244)
- (Jon) Updated the `lr_common_styles` gem to the latest 1.9.9 patch release.
- (Jon) Moved all mirrored configuration settings from individual environments
into the application configuration to reduce the need to manage multiple
sources of truth
- (Jon) Implemented improved boilerplate metrics integration to offer analysis
of current application usage stats
- (Jon) Additional metrics from the Puma server to be exposed in the /metrics
endpoint via the puma-metrics gem
- (Jon) Tweaked the application controller to improve error handling and
ensuring additional filtering for specific errors completes when able
- (Jon) Reorganised makefile targets alphabetically as well as mirrored other
improvements from the other applications in the suite
- (Jon) Updated .gitignore file to mirror the current approach in the other HMLR
apps
- (Jon) Updated .rubocop.yml file with rules to reduce the need to set overrides
inline
- (Jon) Updated the `lr_common_styles` gem to the latest 1.9.6 patch release.
- (Dan) Fixes the bug search results not displaying
[232](https://github.com/epimorphics/ppd-explorer/issues/232)
- (Dan) Adds page titles to download page and error page. Improves code dryness
[220](https://github.com/epimorphics/ppd-explorer/issues/220)
- (Dan) Updates gemfile to use v1.9.5 lr_common_styles
- (Dan) Adds more descriptive page titles
[220](https://github.com/epimorphics/ppd-explorer/issues/220)
- (Dan) Adds search actions buttons to the top of the page
[226](https://github.com/epimorphics/ppd-explorer/issues/226)
- (Dan) Increases target size of clickable elements to meet accessibility
requirments [GH-225](https://github.com/epimorphics/ppd-explorer/issues/225)
- (Dan) updates the search results modal focus flow to meet accessibility
requirments [GH-216](https://github.com/epimorphics/ppd-explorer/issues/216)
- (Dan) updates the form to meet various accessibility requirments
[GH-217](https://github.com/epimorphics/ppd-explorer/issues/217)
- (Dan) updates the help modal focus flow to meet accessibility requirments
[GH-218](https://github.com/epimorphics/ppd-explorer/issues/218)

## 1.7.8 - 2024-09

- (Jon) Updated the type check for the current search terms to only sanitise
Expand Down Expand Up @@ -37,7 +85,8 @@ This app allows the user to explore HMLR price-paid open linked data.

- (Jon) Updated the `app/controllers/application_controller.rb` to include the
`before_action` for the `change_default_caching_policy` method to ensure the
default `Cache-Control` header for all requests is set to 5 minutes (300 seconds).
default `Cache-Control` header for all requests is set to 5 minutes (300
seconds).

## 1.7.3 - 2023-06-07

Expand All @@ -64,8 +113,8 @@ This app allows the user to explore HMLR price-paid open linked data.
Epimorphics specific gems locally during the development of those gems.
- (Jon) Updated the production `data_services_api` gem version to be at least
the current version`~>1.3.3` (this is to cover out of sync release versions)
- (Jon) Updated the production `json_rails_logger` gem version to be at least the
current version `~>1.3.5` (this is to cover out of sync release versions)
- (Jon) Updated the production `json_rails_logger` gem version to be at least
the current version `~>1.3.5` (this is to cover out of sync release versions)
- (Jon) Updated the production `lr_common_styles` gem version to be at least the
current version `~>1.9.1` (this is to cover out of sync release versions)
- (Jon) Refactored better guards in `entrypoint.sh` to ensure the required env
Expand Down
7 changes: 5 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,20 @@ gem 'prometheus-client', '~> 4.0'
gem 'sentry-rails', '~> 5.2'
gem 'yajl-ruby', require: 'yajl'

gem 'puma-metrics'


# rubocop:disable Layout/LineLength
# TODO: While running the rails app locally for testing you can set gems to your local path
# ! These "local" paths do not work with a docker image - use the repo instead
# gem 'data_services_api', '~> 1.3.3', path: '~/Epimorphics/shared/data_services_api/'
# gem 'json_rails_logger', '~>1.0.0', path: '~/Epimorphics/shared/json-rails-logger/'
# gem 'lr_common_styles', '~> 1.9.3', path: '~/Epimorphics/clients/land-registry/projects/lr_common_styles/'
# gem 'lr_common_styles', '~> 1.9.0', path: '~/Epimorphics/clients/land-registry/projects/lr_common_styles/'
# rubocop:enable Layout/LineLength

# TODO: In production you want to set this to the gem from the epimorphics package repo
source 'https://rubygems.pkg.github.com/epimorphics' do
gem 'data_services_api', '~> 1.3.3'
gem 'json_rails_logger', '~>1.0.0'
gem 'lr_common_styles', '~> 1.9.3'
gem 'lr_common_styles', '~> 1.9.0' # set as this version as bundler breaks otherwise
end
10 changes: 7 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ GEM
public_suffix (5.0.0)
puma (5.6.7)
nio4r (~> 2.0)
puma-metrics (1.2.5)
prometheus-client (>= 0.10)
puma (>= 5.0)
racc (1.6.2)
rack (2.2.8)
rack-test (1.1.0)
Expand Down Expand Up @@ -345,14 +348,14 @@ GEM
json
lograge
railties
lr_common_styles (1.9.3)
lr_common_styles (1.9.9)
bootstrap-sass (~> 3.4.0)
font-awesome-rails (~> 4.7.0.1)
govuk_elements_rails (~> 2.0.0)
govuk_frontend_toolkit (~> 4.18.1)
govuk_template (~> 0.18.1)
haml-rails (~> 2.0.0)
jquery-rails (~> 4.3.5)
jquery-rails (>= 4.3.5, < 4.7.0)
lodash-rails (~> 4.17.14)
modernizr-rails (~> 2.7.1)
modulejs-rails (~> 2.2.0.0)
Expand Down Expand Up @@ -386,7 +389,7 @@ DEPENDENCIES
json_expressions
json_rails_logger (~> 1.0.0)!
libv8-node (>= 16.10.0.0)
lr_common_styles (~> 1.9.3)!
lr_common_styles (~> 1.9.0)!
memory_profiler
minitest-rails
minitest-reporters
Expand All @@ -395,6 +398,7 @@ DEPENDENCIES
mocha
prometheus-client (~> 4.0)
puma
puma-metrics
rails (< 6.0.0)
rb-readline
rubocop
Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ BUNDLER_VERSION?=$(shell tail -1 Gemfile.lock | tr -d ' ')
ECR?=${ACCOUNT}.dkr.ecr.eu-west-1.amazonaws.com
GPR_OWNER?=epimorphics
NAME?=$(shell awk -F: '$$1=="name" {print $$2}' deployment.yaml | sed -e 's/[[:blank:]]//g')
SHORTNAME?=$(shell echo ${NAME} | cut -f2 -d/)
PAT?=$(shell read -p 'Github access token:' TOKEN; echo $$TOKEN)
PORT?=3001
RUBY_VERSION?=$(shell cat .ruby-version)
Expand All @@ -29,14 +28,14 @@ REPO?=${ECR}/${IMAGE}
GITHUB_TOKEN=.github-token
BUNDLE_CFG=.bundle/config

all: image

${BUNDLE_CFG}: ${GITHUB_TOKEN}
@./bin/bundle config set --local rubygems.pkg.github.com ${GPR_OWNER}:`cat ${GITHUB_TOKEN}`

${GITHUB_TOKEN}:
@echo ${PAT} > ${GITHUB_TOKEN}

all: image

assets: auth
@./bin/bundle config set --local without 'development test'
@./bin/bundle install
Expand All @@ -49,6 +48,7 @@ check: lint test

clean:
@[ -d public/assets ] && ./bin/rails assets:clobber || :
@@ rm -rf bundle coverage log node_modules

image: auth
@echo Building ${REPO}:${TAG} ...
Expand Down Expand Up @@ -112,7 +112,6 @@ vars:
@echo "ECR = ${ECR}"
@echo "GPR_OWNER = ${GPR_OWNER}"
@echo "NAME = ${NAME}"
@echo "SHORTNAME = ${SHORTNAME}"
@echo "RUBY_VERSION = ${RUBY_VERSION}"
@echo "SHORTNAME = ${SHORTNAME}"
@echo "STAGE = ${STAGE}"
Expand Down
Loading

0 comments on commit bed09fc

Please sign in to comment.