Skip to content

Add rake task to retrieve live and draft for docs#2940

Merged
SamJamCul merged 1 commit into
mainfrom
add-task-to-retrieve-form-document
Jul 16, 2026
Merged

Add rake task to retrieve live and draft for docs#2940
SamJamCul merged 1 commit into
mainfrom
add-task-to-retrieve-form-document

Conversation

@SamJamCul

@SamJamCul SamJamCul commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

As part of investigating issues with a draft form document, this task will make it easier to compare the form's current state in the db. I've kept this as a task under the forms namespace as it's easy to work out a form's ID, and get the form documents for that form using it.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

@SamJamCul
SamJamCul force-pushed the add-task-to-retrieve-form-document branch from 87f8ef6 to 123bbce Compare July 16, 2026 11:19
stephencdaly
stephencdaly previously approved these changes Jul 16, 2026

@stephencdaly stephencdaly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a suggestion but nothing to stop this going in as it is to use for the support task

Comment thread lib/tasks/forms.rake Outdated
@SamJamCul
SamJamCul force-pushed the add-task-to-retrieve-form-document branch from 123bbce to 2521a9c Compare July 16, 2026 12:11
Comment thread lib/tasks/forms.rake Outdated

@stephencdaly stephencdaly left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can simplify by using the find_by ActiveRecord query method

Comment thread lib/tasks/forms.rake Outdated
Comment thread lib/tasks/forms.rake Outdated
Comment thread lib/tasks/forms.rake Outdated
@SamJamCul
SamJamCul force-pushed the add-task-to-retrieve-form-document branch 2 times, most recently from 0c8a9d9 to e4056c5 Compare July 16, 2026 13:18
Comment thread lib/tasks/forms.rake Outdated
@SamJamCul
SamJamCul force-pushed the add-task-to-retrieve-form-document branch from e4056c5 to 7b27fc4 Compare July 16, 2026 13:41
stephencdaly
stephencdaly previously approved these changes Jul 16, 2026
@SamJamCul
SamJamCul force-pushed the add-task-to-retrieve-form-document branch from 7b27fc4 to 25dd8e3 Compare July 16, 2026 14:00
The task retrieves form documents for a given form based on the provided
form_id, tag and language. One form document is retrieved at a time so
that the output is always limited to a single JSON form document.

If no language is provided, it defaults to using 'en'.
@SamJamCul
SamJamCul force-pushed the add-task-to-retrieve-form-document branch from 25dd8e3 to 90c5b26 Compare July 16, 2026 14:10
@github-actions

Copy link
Copy Markdown

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-2940.admin.review.forms.service.gov.uk/

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@SamJamCul
SamJamCul added this pull request to the merge queue Jul 16, 2026
Merged via the queue into main with commit b3d5889 Jul 16, 2026
3 checks passed
@SamJamCul
SamJamCul deleted the add-task-to-retrieve-form-document branch July 16, 2026 14:34
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.

2 participants