Skip to content

Rake task for changing the state of a Form#2839

Open
chao-xian wants to merge 3 commits into
mainfrom
update-report-total
Open

Rake task for changing the state of a Form#2839
chao-xian wants to merge 3 commits into
mainfrom
update-report-total

Conversation

@chao-xian

@chao-xian chao-xian commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

We have some forms that were fiddled with in the database to remove them from service. This was prior to having the Archive functionality we now have. As a consequence some of our metrics data is counting wrong.

Example:

XL Bully - the "live" version was deleted, but as it was once live it should be counted as being published some time ago.

This PR adds a method and accompanying rake task for switching a Form's state programatically, in the shortest number of steps.

In the case of XL Bully it would make it live and then immediately archive it. As it's done programatically, it would be much quicker than one of the admins clicking around to do the same thing. It also decreases the likelihood of a user finding the live form.

Trello card: https://trello.com/c/44SCirtT/3150-live-and-archived-forms-report-is-missing-2-forms

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?

@chao-xian chao-xian changed the title WIP Rake task for changing the state of a Form Jun 11, 2026
Spe'cing out the various expected event paths for changing the state of a Form.
Algorithmically determine the shortest event paths to change the state of a form to another state.
@chao-xian chao-xian force-pushed the update-report-total branch from 49bb26f to d3cedc4 Compare June 11, 2026 15:13
@github-actions

Copy link
Copy Markdown

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-2839.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.

@chao-xian chao-xian marked this pull request as ready for review June 11, 2026 15:21
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.

1 participant