Skip to content

User config, with merge.always and --no-merge #111

Closed

Description

@JacobStephens2

Parent

#109

What to build

thirdshift reads a User config at ~/.thirdshift/config.toml (TOML, under $HOME) at the start of a Run. This ticket supports only [merge] always. The other sections ([email], [logs]) are added by later tickets.

  • merge.always = true makes every Run on the machine a Merge run without the merge word.
  • no-merge / --no-merge stops the Run at ready for review for that one Run.
  • With no config, or one that says nothing about merging, a Run is a Merge run only when merge is given, as today.

A config that can't be parsed, or that has an unknown key or section, stops the Run before any work, naming the file and the offending key. update, version and help never read the config, so a broken config can't block them.

This ticket also rewrites argument parsing so later flags drop in cleanly:

  • Run flags (merge/--merge, no-merge/--no-merge) may appear in any order before or after the Issue URL.
  • A repeated flag, or merge together with no-merge, is an argument error (exit 2, with the help text).
  • Any other extra token is still an argument error.

Help lists --no-merge and mentions the User config. The README documents the User config file and merge.always.

Acceptance criteria

  • With merge.always = true and no merge word, a Run ends with its pull request merged (a Merge run)
  • With merge.always = true, --no-merge and no-merge each make the Run end ready for review without merging
  • With no config file, and with a config that has no [merge] section, a Run without merge is not a Merge run
  • merge, --merge, no-merge and --no-merge are accepted before or after the Issue URL
  • merge with no-merge, or a repeated flag, exits 2 with an error and the help text, before any work
  • An unparsable config file stops the Run before any work, with an error naming the file
  • An unknown key (e.g. alway) or unknown section stops the Run before any work, with an error naming it
  • update, version and help succeed with a broken config file
  • Help text and README document --no-merge, the User config location and merge.always
  • Tests drive the compiled binary through the existing end-to-end harness, with a helper that writes the scenario's config.toml

Blocked by

None (can start immediately)

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions