Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/future_proof.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- '3.2' # Latest ruby 3.2.x
- '3.2' # Latest ruby 3.2.x (no longer used, but preserve the option to rollback)
- '3.3' # Latest ruby 3.3.x
- '3.4' # Latest ruby 3.4.x

name: "Ruby ${{ matrix.ruby-version }} Smoke Tests"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- '3.2.8'
- '3.3.9'
test-group:
- "[a-b]"
- "[c]"
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- '3.2.8'
- '3.3.9'
test-group:
- "[a-z]"

Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.8
3.3.9
5 changes: 1 addition & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ gem 'rails', '~> 7.2.2', '>= 7.2.2.2'
# Fixes uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger on Rails 7.0x
# and earlier. See https://github.com/rails/rails/issues/54260.
gem 'concurrent-ruby', '1.3.4'
# Use old psych for YAML on Ruby 3.1 until we move to Rails 7.0.4
# so that we can continue to use aliases in config/locales/en.yml
# cf. https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias
gem 'psych', '4.0.4' # Exactly match the version on Ruby 3.1
gem 'stringio', '3.1.1' # psych dependency: exactly match the default version on Ruby 3.3

Expand Down Expand Up @@ -62,7 +59,7 @@ gem 'will_paginate'
# gem 'capistrano-rails', group: :development

# net-imap (via ndr_error) requires date. Puma needs us to stick to the ruby default version.
gem 'date', '3.1.3' # Lock to Ruby 3.0 version of gem for live service
gem 'date', '3.3.4' # Lock to Ruby 3.3 version of gem for live service

gem 'ndr_authenticate', '~> 0.3', '>= 0.3.3'
gem 'ndr_error', '~> 2.0'
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ GEM
crass (1.0.6)
csv (3.3.0)
daemons (1.4.1)
date (3.1.3)
date (3.3.4)
delayed_job (4.1.13)
activesupport (>= 3.0, < 9.0)
delayed_job_active_record (4.1.11)
Expand Down Expand Up @@ -273,7 +273,7 @@ GEM
net-ldap
rails (>= 7.0, < 7.3)
yubikey
ndr_dev_support (7.3.3)
ndr_dev_support (7.3.4)
activesupport (>= 6.1, < 8.1)
brakeman (>= 4.7.1)
bundler-audit
Expand Down Expand Up @@ -605,7 +605,7 @@ DEPENDENCIES
coffee-rails
concurrent-ruby (= 1.3.4)
daemons
date (= 3.1.3)
date (= 3.3.4)
delayed_job (~> 4.1)
delayed_job_active_record
devise (~> 4.7, >= 4.7.1)
Expand Down Expand Up @@ -656,4 +656,4 @@ DEPENDENCIES
will_paginate

BUNDLED WITH
2.4.19
2.5.22
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Data Management System [![Build Status](https://github.com/publichealthengland/data_management_system/workflows/Test/badge.svg)](https://github.com/publichealthengland/data_management_system/actions?query=workflow%3Atest)

* Rails version 6.1.7
* Ruby version is 3.0.4
* Rails version 7.2.x
* Ruby version is 3.3.x

## System dependencies

* ndr_dev_support ~> 6.0
* ndr_dev_support '~> 7.0'
* ndr_error '~> 2.0'
* ndr_support '~> 5.9'
* ndr_ui (3.3.1)
* ndr_ui '~> 3.3'

## Configuration

Expand Down
2 changes: 1 addition & 1 deletion app/models/project_dataset_level.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ProjectDatasetLevel < ApplicationRecord
validates :status, uniqueness: { scope: %i[access_level_id project_dataset_id] },
if: proc { |pdl| %w[request approved renewable].include?(pdl.status) }

enum status: { request: 1, approved: 2, rejected: 3, renewable: 4, closed: 5 }
enum :status, { request: 1, approved: 2, rejected: 3, renewable: 4, closed: 5 }

scope :same_access_level_levels, lambda { |pdl|
where(project_dataset_id: pdl.project_dataset_id, access_level_id: pdl.access_level_id).
Expand Down
5 changes: 3 additions & 2 deletions config/deploy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,16 @@
# deploying user, rather than the application user.
# You can override the path using e.g. set :pg_conf_path, '/usr/pgsql-9.5/bin/pg_config'
# otherwise the latest installed version will be used.
# Note that the relevant postgresql-devel package is required, not just postgresql
run <<~SHELL
set -e;
cd #{release_path};
pg_conf_path="#{fetch(:pg_conf_path, '')}";
if [ -z "$pg_conf_path" ]; then
pg_conf_path=`ls -1d /usr/pgsql-{9,[1-8]*}/bin/pg_config 2> /dev/null | tail -1`;
pg_conf_path=`ls -1d /usr/pgsql-{9*,[1-8]*}/include 2> /dev/null | sed -e 's:/include$:/bin/pg_config:' | tail -1`;
fi;
if [ -n "$pg_conf_path" ]; then
echo Using pg_conf_path=\"$pg_conf_path\";
echo Using pg_conf_path=\\"$pg_conf_path\\";
bundle config --local build.pg --with-pg-config="$pg_conf_path";
fi
SHELL
Expand Down
4 changes: 2 additions & 2 deletions config/deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
---
beta:
branch: 'main'
ruby: 3.2.8
ruby: 3.3.9
live:
branch: 'main'
ruby: 3.2.8
ruby: 3.3.9
2 changes: 1 addition & 1 deletion lib/tasks/seed_cas_dataset.rake
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace :cas do
fname = Rails.root.join('lib', 'tasks', 'xsd', 'nodes_cas.yml')

Node.transaction do
YAML.safe_load(File.open(fname), [Symbol]).each do |row|
YAML.safe_load(File.open(fname), permitted_classes: [Symbol]).each do |row|
version = row['dataset_version']
dataset = row['name']
print "Building nodes for #{version}\n"
Expand Down
22 changes: 11 additions & 11 deletions lib/tasks/xsd_seed.rake
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace :xsd do
fname = Rails.root.join('lib', 'tasks', 'xsd', 'nodes.yml')

Node.transaction do
YAML.safe_load(File.open(fname), [Symbol]).each do |row|
YAML.safe_load(File.open(fname), permitted_classes: [Symbol]).each do |row|
version = row['dataset_version']
dataset = row['name']
print "Building nodes for #{version}\n"
Expand Down Expand Up @@ -103,7 +103,7 @@ namespace :xsd do
fname = Rails.root.join('lib', 'tasks', 'xsd', 'xml_types.yml')
before = XmlType.count
XmlType.transaction do
YAML.safe_load(File.open(fname), [Symbol]).each do |row|
YAML.safe_load(File.open(fname), permitted_classes: [Symbol]).each do |row|
row.delete(:pattern) if row[:pattern].blank?
row.delete(:decimal_places) if row[:decimal_places].blank?
ignore = %w[xml_attribute_for_value enumeration_values attribute_names]
Expand Down Expand Up @@ -142,7 +142,7 @@ namespace :xsd do
fname = Rails.root.join('lib', 'tasks', 'xsd', 'datasets.yml')
before = Dataset.count
Dataset.transaction do
YAML.safe_load(File.open(fname), [Symbol]).each_value do |row|
YAML.safe_load(File.open(fname), permitted_classes: [Symbol]).each_value do |row|
d = Dataset.new(row)
d.dataset_type = DatasetType.find_by(name: 'XML Schema')
d.save!(validate: false)
Expand All @@ -157,7 +157,7 @@ namespace :xsd do
fname = Rails.root.join('lib', 'tasks', 'xsd', 'dataset_versions.yml')
before = DatasetVersion.count
DatasetVersion.transaction do
YAML.safe_load(File.open(fname), [Symbol]).each_value do |row|
YAML.safe_load(File.open(fname), permitted_classes: [Symbol]).each_value do |row|
d = DatasetVersion.new(row.except('dataset'))
d.dataset = Dataset.find_by(name: row['dataset'])
d.save!
Expand All @@ -172,7 +172,7 @@ namespace :xsd do
attrs = Rails.root.join('lib', 'tasks', 'xsd', 'xml_attributes.yml')
counter = 0
Nodes::DataItem.transaction do
YAML.safe_load(File.open(attrs), [Symbol]).each_value do |row|
YAML.safe_load(File.open(attrs), permitted_classes: [Symbol]).each_value do |row|
x = XmlAttribute.new(row)
x.save!
counter += 1
Expand All @@ -187,7 +187,7 @@ namespace :xsd do
fname = Rails.root.join('lib', 'tasks', 'xsd', 'categories.yml')
before = Category.count
Category.transaction do
YAML.safe_load(File.open(fname), [Symbol]).each_value do |row|
YAML.safe_load(File.open(fname), permitted_classes: [Symbol]).each_value do |row|
ignored_fields = %w[dataset_name dataset_version]
e = Category.new(row.except(*ignored_fields))
e.dataset_version = version_for_dataset(row['dataset_name'], row['dataset_version'])
Expand All @@ -203,7 +203,7 @@ namespace :xsd do
fname = Rails.root.join('lib', 'tasks', 'xsd', 'data_dictionary_element.yml')
before = DataDictionaryElement.count
DataDictionaryElement.transaction do
YAML.safe_load(File.open(fname), [Symbol]).each do |row|
YAML.safe_load(File.open(fname), permitted_classes: [Symbol]).each do |row|
dde = DataDictionaryElement.new(row.except('xml_type'))
dde.xml_type = XmlType.find_by(name: row['xml_type']) unless row['xml_type'].nil?
dde.save!
Expand Down Expand Up @@ -238,7 +238,7 @@ namespace :xsd do
# Task for updating fixtures
task upp: :environment do
fname = Rails.root.join('lib', 'tasks', 'xsd', 'nodes.yml')
x = YAML.safe_load(File.open(fname), [Symbol]).each do |row|
x = YAML.safe_load(File.open(fname), permitted_classes: [Symbol]).each do |row|
child_up(row)
end
puts x.to_yaml
Expand Down Expand Up @@ -373,7 +373,7 @@ namespace :xsd do
fname = Rails.root.join('lib', 'tasks', 'xsd', 'categories.yml')
before = Category.count
Category.transaction do
YAML.safe_load(File.open(fname), [Symbol]).each_value do |row|
YAML.safe_load(File.open(fname), permitted_classes: [Symbol]).each_value do |row|
next unless row['dataset_version'] == '4-1-1'

ignored_fields = %w[dataset_name dataset_version]
Expand All @@ -392,7 +392,7 @@ namespace :xsd do
fname = Rails.root.join('lib', 'tasks', 'xsd', 'nodes.yml')

Node.transaction do
YAML.safe_load(File.open(fname), [Symbol]).each do |row|
YAML.safe_load(File.open(fname), permitted_classes: [Symbol]).each do |row|
version = row['dataset_version']
next unless version == '4-1-1'

Expand Down Expand Up @@ -457,7 +457,7 @@ namespace :xsd do

fname = Rails.root.join('lib', 'tasks', 'xsd', 'COSDv9.0.1.yml')

YAML.safe_load(File.open(fname), [Symbol]).each do |row|
YAML.safe_load(File.open(fname), permitted_classes: [Symbol]).each do |row|
print "Building nodes for #{v9_0_1.semver_version}\n"
node = build_node(row, v9_0_1)
if row['children'].present?
Expand Down
Binary file removed vendor/cache/date-3.1.3.gem
Binary file not shown.
Binary file added vendor/cache/date-3.3.4.gem
Binary file not shown.
Binary file removed vendor/cache/ndr_dev_support-7.3.3.gem
Binary file not shown.
Binary file added vendor/cache/ndr_dev_support-7.3.4.gem
Binary file not shown.
Binary file not shown.
Binary file modified vendor/rbenv/rbenv.tar.gz
Binary file not shown.
Binary file modified vendor/rbenv/ruby-build.tar.gz
Binary file not shown.
Loading