Skip to content

dev/ci: try to make pipeline generator more predictable

Warren Gifford requested to merge ci/generator-refactor into main

Created by: bobheadxi

Attempt to address https://github.com/sourcegraph/sourcegraph/discussions/24552#discussioncomment-1287805

  • Add RunType: a run can only be one at a time. With the various isXYZ this is only implied at the moment (most cases check for branch prefixes or matches that can't collide), but this makes it explicit
    • Make profiling flag a submatch on a branch so that it can be toggled on arbitrary branches
    • Removed Quick which seems unused (no recently pushed quick/ branches)
    • Attempted to document the current types (previously undocumented)
  • Reduce instances of sporadic no-ops/mystery steps when adding an operation - push more conditional steps cases upfront so that it's clearer what's going on by removing Config as an argument in step constructors.
    • Looking to enforce a policy of "add variants of operations but don't conditionally add operations"
  • Create type ChangedFiles []string to give change-based conditions a clearer home. Encourage its use in generating pipelines for PRs
    • Looking to create a dilineation between onlyXYZ (replace-ive) and affectsXYZ (additive)
  • Random streamlining
    • Changed strangely out of place copyEnv which copies from os.Getenv even though we have another thing (commonEnv) which also copies from os.Getenv to copy from the latter

Some other things I'm contemplating (maybe another PR):

  • sg pipeline plan
  • debug output
  • tests???

Merge request reports

Loading