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

3729 wider spread of dates in the seed #4114

Merged

Conversation

isidzukuri
Copy link
Contributor

@isidzukuri isidzukuri commented Feb 17, 2024

Resolves #3729

Description

Wider spread of dates on requests, distributions, purchases, donations in the seed, including some more than 1 week ago.

An initial suggestion to use date ranges from the past (days ago):

  • 0 - 6
  • 7 - 30
  • 31 - 300
  • 350 - 700

Generated dates will look like:

"donations"."issued_at"
Sat, 10 Feb 2024
Tue, 13 Feb 2024
Sun, 11 Feb 2024
Fri, 09 Feb 2024
Wed, 14 Feb 2024
Mon, 15 Jan 2024
Sat, 27 Jan 2024
Wed, 31 Jan 2024
Mon, 15 Jan 2024
Sat, 27 Jan 2024
Tue, 14 Nov 2023
Fri, 13 Oct 2023
Fri, 19 May 2023
Mon, 19 Jun 2023
Fri, 09 Jun 2023
Wed, 02 Nov 2022
Fri, 12 Aug 2022
Thu, 24 Nov 2022
Sun, 22 May 2022
Tue, 26 Apr 2022

"purchases"."issued_at"
Wed, 14 Feb 2024
Mon, 12 Feb 2024
Mon, 12 Feb 2024
Fri, 09 Feb 2024
Mon, 12 Feb 2024
Tue, 13 Feb 2024
Wed, 14 Feb 2024
Tue, 23 Jan 2024
Tue, 23 Jan 2024
Mon, 22 Jan 2024
Sat, 27 Jan 2024
Mon, 05 Feb 2024
Fri, 02 Feb 2024
Tue, 06 Feb 2024
Fri, 17 Nov 2023
Fri, 28 Jul 2023
Fri, 04 Aug 2023
Sat, 03 Jun 2023
Tue, 03 Oct 2023
Sun, 06 Aug 2023
Fri, 20 Oct 2023
Wed, 14 Sep 2022
Mon, 31 Oct 2022
Sat, 23 Apr 2022
Sat, 16 Jul 2022

"distributions"."issued_at"
Thu, 15 Feb 2024
Tue, 13 Feb 2024
Thu, 15 Feb 2024
Fri, 02 Feb 2024
Tue, 30 Jan 2024
Mon, 05 Feb 2024
Mon, 18 Jul 2022

"account_requests"."confirmed_at"
nil, 
nil, 
nil, 
Wed, 14 Feb 2024
Wed, 07 Feb 2024
Mon, 17 Jul 2023

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • all automated tests should pass
  • truncate database (rails db:truncate_all)
  • call rails db:seed
  • make sure all required tables are populated

Screenshots

@isidzukuri isidzukuri force-pushed the 3729_wider_spread_of_dates_in_the_seed branch from 4cf08c5 to 3f5fde5 Compare February 17, 2024 06:01
@isidzukuri
Copy link
Contributor Author

@dorner sorry for force push, this is how rebase main branch works, will use merge next time

Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

This looks good to me, but I'm not sure I understand some of @cielf 's concerns with the overall idea. Over to her for a once-over.

@cielf cielf self-requested a review February 20, 2024 19:10
@cielf
Copy link
Collaborator

cielf commented Feb 20, 2024

@isidzukuri Thanks for this -- it will make my testing life significantly better. Not a full review yet -- I'll want to 'kick the tires' -- but the one thing that leaps out is that "Requests" in the issue didn't mean Account Requests, but Requests. When looking at that, from a "the data makes sense" pov, any Requests would happen before any associated Distributiosn in real life.

@isidzukuri
Copy link
Contributor Author

isidzukuri commented Feb 20, 2024

" in the issue didn't mean Account Requests, but Requests." no problem, updated

@isidzukuri
Copy link
Contributor Author

any Requests would happen before any associated Distribution in real life.

sounds reasonable. But at first glance, I didn't see the connection between Distribution and Request in the seed

@cielf
Copy link
Collaborator

cielf commented Feb 22, 2024

(nods) You can make a distrbution without a request, so it's quite possible that the seed was created without any of those connections.

@cielf
Copy link
Collaborator

cielf commented Feb 22, 2024

As for my concerns, it was 8 months ago -- I don't really remember!

There are a number of things that are dependent on date created rather than the dates that are shown. In many cases that is exactly what we want to happen, but it may be confusing to people who aren't aware of it.

The inventory history is one of those things, obviously.

And in some cases, having the seed like this will make things that might not be quite right more obvious (I am questioning the default sort on the donations, for example, Should it be by creation date (as it is now), or by date of donation?).

So it's helpful in that regard, and makes it a lot easier to test anything around the date filtering.

We might want to amend the text on the staging warning to make it explicit that everything is created anew every day, and some things depend on that -- but that would be a separate issue (a Good First Issue for someone, perhaps)

Copy link
Collaborator

@cielf cielf left a comment

Choose a reason for hiding this comment

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

LGTM - @dorner do you have anything to add based on the last commits and my commentary?

@dorner
Copy link
Collaborator

dorner commented Feb 22, 2024

Nope, I think we'll have to see the data to find out if there are any issues.

In general I feel like the codebase relies way too heavily on randomization... both here and in testning. There is really no reason to try to randomize the number of things created if we know what a "good starting data set" is. Obviously not going to fix the world here, but if it turns out some of the data isn't helpful, that might be a good road to start going down.

Copy link
Collaborator

@cielf cielf left a comment

Choose a reason for hiding this comment

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

Onward and upward then. This is, to my mind, definitely a step in the right direction.

@cielf cielf merged commit 3841e1f into rubyforgood:main Feb 22, 2024
19 checks passed
@isidzukuri
Copy link
Contributor Author

@cielf
If dates will grow sequentially in natural order of id grow(for example: 1: 21.01.2022, 2: 10.01.2023... N: 22.02.2024) will it makes any usefull difference?

Will it help if every distribution will have assigned request with date one day before?

@cielf
Copy link
Collaborator

cielf commented Feb 22, 2024

There are always exceptions -- some banks have specific pickup days for different partners, so you could end up with the dates being in a different order than creation.
I think we're ok for now. What we have will address the need to be able to manually test date spread aspects without having to enter a lot of data.

Copy link
Contributor

@isidzukuri: Your PR 3729 wider spread of dates in the seed is part of today's Human Essentials production release: 2024.02.25.
Thank you very much for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants