Skip to content

Improve seeds.rb with more workshops #2302

@mroderick

Description

@mroderick

In db/seeds.rb we are creating a small amount of workshops.

Rails.logger.info "Creating a lot of old workshops..."
past_workshops_since_n_months = 5 * 12
past_workshops_one_per_n_months = 6
past_workshops_count = past_workshops_since_n_months/past_workshops_one_per_n_months

past_workshops = past_workshops_count.times.map do |n|
  Fabricate(:workshop, title: 'Workshop',
                       chapter: chapters.sample,
                       date_and_time:  Time.zone.now - past_workshops_since_n_months.months + (past_workshops_one_per_n_months * n).months)
end

The calculation is a bit tricky to follow, but I think that the example above creates 10 (5*12/6) workshops, spaced out 6 (past_workshops_one_per_n_months ) months apart. That's not "a lot of old workshops".

In order to be able to notice issues, such as the one that caused an outage on 2025-08-23 (fixed in #2301), we should be generating a lot more data in the local and staging environments.

We should generate at least double the current volume of workshops as there are in production. Let's say 10k workshops, just to be on the safe side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions