Skip to content

v8.3.0#6751

Merged
misaka merged 115 commits intomainfrom
next
Apr 30, 2026
Merged

v8.3.0#6751
misaka merged 115 commits intomainfrom
next

Conversation

@misaka
Copy link
Copy Markdown
Collaborator

@misaka misaka commented Apr 30, 2026

No description provided.

jf-x-dev and others added 30 commits April 21, 2026 10:15
* Refactor existing navigation cookie and new careplus_tab_visible cookie into one

Jira-Issue: MAV-5325
* We'll keep this cookie present for now
* It will be removed once the reporting component is using the new cookie

Jira-Issue: MAV-5325
To `govuk_notify` to make it clearer what this refers to (particularly
if we migrate to NHS Notify in the future).

Jira-Issue: MAV-7107
This orders the job according to when they run with commented sections
to make it clearer.

Jira-Issue: MAV-7107
The flag doesn't do anything as the code to support it is commented out.
If we need to bring the flag back we can revert this commit.

Jira-Issue: MAV-7107
Jira-Issue: MAV-7110
Somehow we added the path to view cohort imports as '/cohort_imports'. Probably
my fault, as usual.

Jira-Issue: MAV-6734
If a patient is only associated with national reporting teams, then
a search is not completed for this patient. This causes 
`NHS::ImmunisationsAPI.search_immunisations` to return `nil`. This was
not being properly handled by the job, and was causing a noisy error in
production, and the job to fail.

The job failure has no impact on the data; these searches were intended
to return no results anyway.
…r-server

Remove `import_concurrency_per_server` feature flag
Commit 55bb078 wired `?wait=true` to
`EnqueueVaccinationsSearchInNHSJob.perform_now`,
but that job uses `perform_bulk` to fan out
per-patient `SearchVaccinationRecordsInNHSJob`s onto the
`immunisations_api_search` Sidekiq queue.
Those run async on workers, so the controller
returned 200 before any patient was actually searched —
defeating the point of the wait flag for end-to-end tests.

Poll the queue after `perform_now` returns and only
respond once it has drained (or after a 5-minute timeout).
…rch-job

Fix prematurely returning testing API (to hopefully fix flakey tests)
Bumps [ruby/setup-ruby](https://github.com/ruby/setup-ruby) from 1.303.0 to 1.305.0.
- [Release notes](https://github.com/ruby/setup-ruby/releases)
- [Changelog](https://github.com/ruby/setup-ruby/blob/master/release.rb)
- [Commits](ruby/setup-ruby@60ecfba...0cb964f)

---
updated-dependencies:
- dependency-name: ruby/setup-ruby
  dependency-version: 1.305.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6.3.0 to 6.4.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@53b8394...48b55a0)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: 6.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [aws-sdk-ec2](https://github.com/aws/aws-sdk-ruby) from 1.611.0 to 1.612.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-ec2/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

---
updated-dependencies:
- dependency-name: aws-sdk-ec2
  dependency-version: 1.612.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Poor performance has been noted when deleting records, particularly
in the bulk-remove parents flow and when bulk-deleting vaccination
records.

A likely cause is that some join tables are only indexed in one
direction, which can make deletion queries slower.

Jira-Issue: MAV-6735
…t-join-tables

Add indexes to improve join table performance
In 50b02d6 we moved the calls to `PatientTeamUpdater.call` and
`PatientStatusUpdater.call` inside the `post_commit!` method. However
we didn't move this call to `update_columns`.

Before this commit an import could appear "processed" to the user but
when they look at the patients and teams in that import they may not
have the correct details.

This was previously also an issue with the other steps inside
`post_commit!`. They also happened *after* the call to
`update_columns`.

I think it makes more sense to update the status of the import
when *all* the associated tasks are completed.

The exact execution order of these steps wasn't tested before and I
haven't attempted to add a test here either, relying instead on the
increased clarity of everything that needs to happen after the
transaction is commited running as the last call in `process!`.
…tatus-after-post-commit

Update ImmunisationImport status after post_commit!
This adds a class which handles updating the position of a location by
fetching the information from the Ordnance Survey Places API.

Jira-Issue: MAV-6379
This adds a job which calls the `LocationPositionUpdater` service class
for a location, allowing it's position to be updated in the background.

Jira-Issue: MAV-6379
This adds a job which enqueues a `LocationPositionUpdaterJob` for each
location with an address but without a position. It's set up to run at
midnight, in a low priority queue.

Jira-Issue: MAV-6379
alistair-white-horne-tng and others added 27 commits April 29, 2026 13:25
…reset-before-cutoff-date

Only delete national reporting objects created before a team's cutoff date
This avoids the need to fetch the key each time and should make the code
slightly more readable.
Store `hint[:exception]` in to a variable
This flag was being used to check whether the feature flag was enabled
to sync these records to the Imms API. This CLI tool has since been
rewritten so it can safely handle being run after the teams have
onboarded, making this check redundant.
…ntent-label

Add missing space in `safe_to_vaccinate_injection_without_gelatine_flu` text
…reset-remove-force

Remove `--force` flag on national reporting reset CLI tool
Bumps [aws-sdk-s3](https://github.com/aws/aws-sdk-ruby) from 1.219.0 to 1.220.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-s3/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

---
updated-dependencies:
- dependency-name: aws-sdk-s3
  dependency-version: 1.220.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [aws-actions/amazon-ecr-login](https://github.com/aws-actions/amazon-ecr-login) from 2.1.3 to 2.1.4.
- [Release notes](https://github.com/aws-actions/amazon-ecr-login/releases)
- [Changelog](https://github.com/aws-actions/amazon-ecr-login/blob/main/CHANGELOG.md)
- [Commits](aws-actions/amazon-ecr-login@376925c...19d944d)

---
updated-dependencies:
- dependency-name: aws-actions/amazon-ecr-login
  dependency-version: 2.1.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [aws-sdk-ec2](https://github.com/aws/aws-sdk-ruby) from 1.612.0 to 1.613.0.
- [Release notes](https://github.com/aws/aws-sdk-ruby/releases)
- [Changelog](https://github.com/aws/aws-sdk-ruby/blob/version-3/gems/aws-sdk-ec2/CHANGELOG.md)
- [Commits](https://github.com/aws/aws-sdk-ruby/commits)

---
updated-dependencies:
- dependency-name: aws-sdk-ec2
  dependency-version: 1.613.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This should fix an invalid foreign key error.

Sentry-Issue: 7449417734
…sdk-s3-1.220.0

Bump aws-sdk-s3 from 1.219.0 to 1.220.0
…xt/aws-actions/amazon-ecr-login-2.1.4

Bump aws-actions/amazon-ecr-login from 2.1.3 to 2.1.4
…sdk-ec2-1.613.0

Bump aws-sdk-ec2 from 1.612.0 to 1.613.0
Destroy `SchoolMoves` when destroying team locations
This renames the matches to be worded in the present tense
(`deliver_email` instead of `have_delivered_email`). This matches the
naming convention for `sidekiq-rspec` where the present tense version is
used with a block and the past tense version is used after the code has
executed.

Jira-Issue: MAV-7288
This is a small refactor to some tests to use the delivery matches
rather than checking for the presence of specific jobs. This will make
it easier to refactor these jobs to use Sidekiq as we'll only need to
change the matchers.

Jira-Issue: MAV-7288
This converts the specs from controller tests to request tests.
Generally request tests are preferred as they test the entire stack
including routing and query parameter parsing. Controller specs are not
recommended by RSpec: https://rspec.info/blog/2016/07/rspec-3-5-has-been-released/
This converts the specs from controller tests to request tests.
Generally request tests are preferred as they test the entire stack
including routing and query parameter parsing. Controller specs are not
recommended by RSpec: https://rspec.info/blog/2016/07/rspec-3-5-has-been-released/
Convert testing API specs to request specs
This refactors the `ApplicationJob` in to two variants,
`ApplicationJobActiveJob` and `ApplicationJobSidekiq`, according to how
the job is defined.

We're making this change to support migrating away from using Active Job
and instead using the Sidekiq API directly, which gives us a number of
benefits.

We can't just switch over in one go, as any Active Job jobs left in the
queue will fail to run once the job class has been converted. So
instead, we need two versions of each job, and then only once we no
longer have any Active Job jobs in the queue, we can remove the
Active Job variations.

Jira-Issue: MAV-7288
We are seeing severe performance issues with calling this class. This
logging will be the first step towards allowing us to diagnose these problems.

Jira-Issue: MAV-7304
These missing indexes were causing patient deletion queries to be
extremely slow.

Deleting a patient used to trigger sequential scans on each of these
tables, in order to enforce the FK constraint on `patient_id`.

Testing in data replication shows that patient delete queries reduce
from 100s of millisecs to 1s of ms; 2 orders of magnitude increase.

Jira-Issue: MAV-7304
For a large number of patients (>15,000), the `@patients.each(&:destroy)`
is causing memory issues. Changing this to `find_each` should mitigate
this issue.

This issue was also present when destroying `VaccinationRecord`s in
`bin/mavis teams reset-national-reporting`

Jira-Issue: MAV-7304
…-indexes

Add indexes to more patient join tables
@misaka misaka requested a review from a team as a code owner April 30, 2026 16:08
@misaka misaka merged commit 50ce533 into main Apr 30, 2026
108 of 111 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.