Making WordPress.org

Changeset 15290


Ignore:
Timestamp:
10/05/2026 09:50:18 PM (2 weeks ago)
Author:
obenland
Message:

FreeScout: Add sample data to the local environment

Closes ​https://github.com/WordPress/wordpress.org/pull/1015.

Location:
sites/trunk/environments
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/environments/README.md

    r15289 r15290  
    294294| `mock-api` | Stands in for `api.wordpress.org/dotorg/freescout/`: checks request signatures, answers sidebar requests with panels recorded from the real endpoints for a real account (`obenland`'s), and logs webhook events (`npm run freescout:logs`). Also stands in for login.wordpress.org's SAML identity provider at http://127.0.0.1:8892/idp, signing with a key that's only for local development. |
    295295
    296 `freescout.wordpress.net/Modules/` is mounted as FreeScout's `Modules/` folder, like production's checkout. Every start switches all modules on and runs `freescout:after-app-update`, as production does after a deploy. To try another module, like a premium one, copy it into `freescout.wordpress.net/Modules/` and restart; don't commit it. After switching branches, run `npm run freescout:setup`: FreeScout errors on every page while it still has a removed module cached.
     296`freescout.wordpress.net/Modules/` is mounted as FreeScout's `Modules/` folder, like production's checkout. Every start switches all modules on and runs `freescout:after-app-update`, as production does after a deploy. After switching branches, run `npm run freescout:setup`: FreeScout errors on every page while it still has a removed module cached.
     297
     298Setup also adds sample data, set up like the HelpScout helpdesk but with made-up people and conversations. It adds the **Learn WordPress** mailbox, without incoming email. It also adds four made-up agents and 34 made-up conversations in Plugins, Themes and Learn WordPress from the last eight weeks, with replies, notes, and closed, pending, and spam conversations. It only adds what's missing, and only to a FreeScout on 127.0.0.1 or localhost.
     299
     300**Premium modules:** to try them, copy them in from a clone of the private [freescout-paid-modules](https://github.com/WordPress/freescout-paid-modules) repository. They must never be committed here, so exclude each one first. From `environments/`:
     301
     302```bash
     303paid=~/path/to/freescout-paid-modules
     304exclude="$(git rev-parse --path-format=absolute --git-common-dir)/info/exclude"
     305for module in "$paid"/Modules/*/; do
     306        target="freescout.wordpress.net/Modules/$(basename "$module")"
     307        grep -qxF "$target/" "$exclude" || echo "$target/" >> "$exclude"
     308        rsync -a --delete "$module" "../$target/"
     309done
     310npm run freescout:setup
     311```
     312
     313Setup switches them on, and adds sample data for each one that's there, with HelpScout's names:
     314
     315- **Tags:** some of HelpScout's tags and colors, on conversations.
     316- **Custom Fields:** the Learn WordPress fields, with values. Plugins and Themes have none.
     317- **Saved Replies:** some of HelpScout's saved replies in Plugins and Themes, with short made-up texts.
     318- **Teams:** the Plugin, Themes and Learn teams, with conversations assigned to some. Names longer than FreeScout's 20 characters are shortened.
     319- **Custom Folders:** "New WordPress" in Plugins, for replies to new WordPress version emails.
     320- **Mentions:** a note in which one agent mentions another.
     321- **Workflows:** some of HelpScout's workflows, with made-up rules. Automatic ones only run for new email with matching subjects, or a tag an agent adds; none run for the sample conversations.
     322- **Reports:** response and resolution times, ready right away.
     323- **API & Webhooks:** a read-only API key for the admin, and a webhook for new conversations to the mock API, which turns it away.
     324
     325Slack stays unconfigured: it needs a Slack app.
    297326
    298327To send more mail in:
  • sites/trunk/environments/freescout/bin/setup.sh

    r15251 r15290  
    11#!/usr/bin/env bash
    22#
    3 # Prepares the local FreeScout: app key, database, admin, mailboxes, modules, and sample email.
     3# Prepares the local FreeScout: app key, database, admin, mailboxes, modules, sample data, and sample email.
    44# Idempotent; runs inside the app container as www-data on every `npm run freescout:start`.
    55
    … …  
    6060php "$app/artisan" --no-interaction freescout:after-app-update
    6161
     62# After the modules: it adds sample data for premium modules that are copied in. Without it, FreeScout still works.
     63php /srv/env/bin/sample-data.php || echo "Could not add all sample data; run setup again to retry." >&2
     64
    6265# The admin logs in as $WPORG_USERNAME at the mock WordPress.org login; against the mock API, as its "admin".
    6366username="${WPORG_USERNAME:-}"
Note: See TracChangeset for help on using the changeset viewer.