Skip to content

Add build tasks to split and build data/team.yml

Alex Kalderimis requested to merge ajk-split-data-yml into master

This MR sets lays the foundations for us to split up the monolithic data/team.yml file, and move to having one file per person. The aim is to move to a workflow where we edit individual files and then build the larger data/team.yml file from them, treating the team.yml file as a generated artifact.

This MR does not change any existing behavior. It merely adds the tools to allow us to split/build the DB file. A subsequent MR splits the team, commits the new files, and makes them as the SSOT.

Later we can clean up by removing the build:split_team task.

Changes

To do this we add some new rake tasks, and a new CI job.

Rake tasks:

  • build:split_team

    Takes the data/team.yml file and splits it into subfiles. This task is intended to be a temporary addition to allow us to move away from the monolithic team file. Each team member will be placed in a separate file in data/team_members/{type}/{slug}.yml. for example: data/team_members/person/alex-kalderimis.yml

  • build:build_team

    Takes the individual files in the data/team_members directory and builds a new data/team.yml file, that can be consumed by existing tools.

  • build:verify_team

    This loads the individual files on disk, and the combined file on disk and compares them. If they differ, the task aborts with an informative message.

CI job:

  • verify-team

    This new Job runs bundle exec rake build:split_team build:verify_team and so verifies that the split preserves information.

    When we move to have the split files be the SSOT, we will change this job to: bundle exec rake build:verify_team

Rationale:

The data/team.yml file is too large to comfortably edit, it is a focus of contention and makes for a confused git history.

A workflow where we have single files that are edited individually, each with their own git history, is a more sustainable and scalable one.

This MR is the first step.

Anticipated Downsides:

Since we plan to keep the data/team.yml file around as a generated artifact, it will be necessary to keep it up-to-date by generating it. The plan is to have authors run the build task to update the file whenever an edit has been made, which adds friction to the editing process. In particular, it makes it impossible to make changes simply by editing files in the Web IDE, since the rake task also needs to be run.

Manual QA instructions

To QA this MR, developers are encouraged to run the three different Rake tasks added here.

  • to begin with, the build:verify_team task. This should fail, and display a long list of users who are in the combined file, but not in the team directory. It should end with:
The team files (under data/team_members/) are not consistent with the
team database (data/team.yml).

The team files are the SSOT! Please do not edit data/team.yml manually.

Perhaps you need to run:

  bundle exec build:team_yml
  • Then run build:split_team. Take a look at the data/team_members/person directory and check out a few of the files. Do they seem sane? Does your own one seem correct?

  • Run build:verify_team. It should now pass.

  • Remove data/team.yml. Run build:verify_team. It should now fail, complaining about the opposite problem (a long list of names that are not in the team.yml file).

  • Run build:team_yml. Take a look at the generated file. It should begin with a header that explains that this file should not be edited. Check out a few of the entries, including your own. Does it look correct?

  • Run build:verify_team. It should now pass.

Edited by Alex Kalderimis

Merge request reports