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

Fix user seeding not creating user groups #1048

Merged
merged 1 commit into from
May 23, 2024
Merged

Fix user seeding not creating user groups #1048

merged 1 commit into from
May 23, 2024

Conversation

Cruikshanks
Copy link
Member

https://eaflood.atlassian.net/browse/WATER-3981

The water-abstraction-service has a mechanism for seeding data for testing that relies on loading in YAML fixture files, sort of. Some content comes from these, but other stuff is hard-coded into the 'loaders'.

Long story short we're going to replace it with something simpler yet more flexible. We initially were going to use [Knex's seeding functionality] (https://knexjs.org/guide/migrations.html#seed-files) to generate the data.

But we've had a change of mind (look out for /data/load coming in a future change!) We still need users though and we can simplify things in our acceptance tests if they can assume the different types of users have been created.

That's when we spotted this isn't actually working! 🤦

It is creating the users but not linking them to the groups that give them the permissions needed. This change fixes the user seed.

https://eaflood.atlassian.net/browse/WATER-3981

The [water-abstraction-service](https://gitub.com/DEFRA/water-abstraction-service) has a mechanism for seeding data for testing that relies on loading in YAML fixture files, sort of. Some content comes from these but other stuff is hard-coded into the 'loaders'.

Long story short we're going to replace it with something simpler yet more flexible. We initially were going to use [Knex's seeding functionality](https://knexjs.org/guide/migrations.html#seed-files) to generate the data.

But we've had a change of mind (look out for `/data/load` coming in a future change!) We still need users though and we can simplify things in our acceptance tests if they can assume the different types of users have been created.

That's when we spotted this isn't actually working! 🤦

It is creating the users but not linking them to the groups that give them the permissions needed. This change fixes the user seed.
@Cruikshanks Cruikshanks added the bug Something isn't working label May 23, 2024
@Cruikshanks Cruikshanks self-assigned this May 23, 2024
@Cruikshanks Cruikshanks marked this pull request as ready for review May 23, 2024 16:06
@Cruikshanks Cruikshanks merged commit 756babd into main May 23, 2024
6 checks passed
@Cruikshanks Cruikshanks deleted the fix-seed-users branch May 23, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant