Skip to content

Updated seeds.rb #103

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

emergenitro
Copy link
Contributor

Hey!

This should help improve the dev env seeding of the db! It works much better now :))

@maxwofford
Copy link
Member

@emergenitro this is great we're adding more details to this! I want to push you a little further though. right now this does a lot of manual work like creating leaderboard entries. We should probably be calling stuff like UpdateLeaderboardJob.perform_now directly in there to DRY up the code

@emergenitro
Copy link
Contributor Author

Oh yup, fair enough. I'll get this done tomorrow!

@emergenitro
Copy link
Contributor Author

Hey! I've made some minor changes:

  • switched over to the jobs
  • avoid duplicate heartbeats being created if it already exists; this is in case db:seed is ran again

lemme know if there's any other way we could push this even further!

@maxwofford
Copy link
Member

I'm looking at how you're doing the heartbeats & I think it's just going to generate noise. What if instead of random generation the seed always generates the same project & language & heartbeats?

@maxwofford
Copy link
Member

You could even download your own heartbeats or something and put it in a sample_heartbeats.csv or something

@emergenitro
Copy link
Contributor Author

I see your concern, but I think right now, it works decently. It chooses 3-5 projects and then generates the heartbeats over 30 days iirc. This will lead to something which looks realistic:
image

I can definitely switch over to generation of something constant using, for example, my own heartbeats but I think the current one works equally as well! Lemme know what you think

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