Skip to content

[BUG] utilities/add_*.sh scripts have drifted from the current repo layout #16150

Description

@mattstratton

The organizer helper scripts in utilities/ have accumulated several bugs as the repo layout changed. None of them are fatal on a good day, but each one produces a silent wrong result or an abort partway through, which is a rough experience for the non-developer organizers these scripts exist to help.

Found while documenting the repo for AI coding assistants. Each is independently fixable.

  • add_speakers.sh and add_organizers.sh create the image directory in the wrong tree. Both run mkdir -p ../static/events/$event_slug/{speakers,organizers} but then cp the image into ../assets/events/.... Since both scripts run under set -e, the cp fails and the whole script dies partway through a record if the assets/ directory does not already exist.

  • The nav-uncomment substitutions are silent no-ops. add_speakers.sh and add_program.sh look for # - name: speakers / # - name: program (two spaces after the #), but the template in utilities/examples/data/events/main.yml has # - name: speakers (leading space, one space after the #). Nothing matches, nothing is replaced, and string_replace returns 0 either way — so the nav entry stays commented out and the organizer has no idea.

  • add_sponsors.sh has a malformed test. Line reads if [ ! -d ../assets/sponsors/$sponsor_initial/]; then — no space before the ]. Bash prints [: missing ']', the test returns non-zero, the mkdir -p is skipped, and the following cp fails if the shard directory does not exist. It works today only because assets/sponsors/{0-9,a-z} all happen to exist already.

  • add_program.sh appends blindly. It does cat examples/templates/program.yml >> main.yml, so a second run produces a file with two program: keys.

  • add_new_event.sh can leave static/_redirects half-edited. The content-directory duplicate check runs before _redirects is modified, but the data-directory check runs after. A rerun that trips only the second check has already mutated _redirects.

  • add_speakers.sh hardcodes .png. Both the "does this image already exist" check and the destination filename assume PNG, so handing it a JPEG writes JPEG bytes to a .png filename. utilities/README.md says headshots may be .png or .jpg, and real events contain both (plus .webp now).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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