Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update organisation fetcher with dry run version #1650

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

SamJamCul
Copy link
Contributor

The OrganisationFetcher now takes a dry_run argument, which will toggle between the dry run and actual fetch process. The dry run will not make any changes to the database, and instead will list out all the proposed changes.

When iterating over the organisations from the API, any new additions will be presented, and any changes to existing orgs will have their changes presented.

The rake task that makes use of this has also been updated to incorporate this

What problem does this pull request solve?

Trello card: https://trello.com/c/M81WBlnp/2021-update-organisations-table-in-forms-admin-database

Modifying the OrganisationFetcher so that it has a dry run variation. This doesn't result in any changes, but simply lists out any changes that would happen if it weren't a dry run.

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?
  • Has all relevant documentation been updated?

@SamJamCul SamJamCul force-pushed the add-dry-run-org-fetch-task branch from b18302f to b706d52 Compare December 4, 2024 12:42
lfdebrux
lfdebrux previously approved these changes Dec 4, 2024
Copy link
Member

@lfdebrux lfdebrux left a comment

Choose a reason for hiding this comment

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

Looks great, and it works on my machine 😁

lib/organisations_fetcher.rb Outdated Show resolved Hide resolved
lib/organisations_fetcher.rb Outdated Show resolved Hide resolved
The OrganisationFetcher now takes a `dry_run` argument, which will toggle between the dry run and actual fetch process. The dry run will not make any changes to the database, and instead will list out all the proposed changes.

When iterating over the organisations from the API, any new additions will be presented, and any changes to existing orgs will have their changes presented.

The rake task that makes use of this has also been updated to incorporate this
@SamJamCul SamJamCul force-pushed the add-dry-run-org-fetch-task branch from 3d83f2f to 3c086a2 Compare December 5, 2024 11:05
Copy link

sonarqubecloud bot commented Dec 5, 2024

@SamJamCul SamJamCul enabled auto-merge December 5, 2024 11:06
@SamJamCul SamJamCul merged commit b438482 into main Dec 5, 2024
4 checks passed
@SamJamCul SamJamCul deleted the add-dry-run-org-fetch-task branch December 5, 2024 11:10
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