Page MenuHomePhabricator

Use real types for build instructions
ClosedPublic

Authored by dduvall on Aug 8 2017, 12:29 AM.

Details

Reviewers
thcipriani
mmodell
Group Reviewers
Release-Engineering-Team
Commits
rGBLBRa0ece14e6e34: Use real types for build instructions
Patch without arc
git checkout -b D741 && curl -L https://phabricator.wikimedia.org/D741?download=true | git apply
Summary

Refactored build instructions to use concrete types and
build.Instruction as an interface instead of relying on a simple enum
and arbitrary string arguments. The formal types result in:

  1. Clearer internal data structures
  2. Partial compilation and proper argument quoting for all instructions moved into the common build package
  3. Higher order instructions like build.RunAll that easily reduce to compiler specific output
Test Plan

Run arc unit or go test ./...

Diff Detail

Repository
rGBLBR Blubber
Branch
refactor-build-instructions
Lint
Lint Passed
SeverityLocationCodeMessage
Advicebuild/instructions.go:10GOLINTGOLINT
Advicebuild/instructions.go:14GOLINTGOLINT
Advicebuild/instructions.go:19GOLINTGOLINT
Advicebuild/instructions.go:30GOLINTGOLINT
Advicebuild/instructions.go:34GOLINTGOLINT
Advicebuild/instructions.go:44GOLINTGOLINT
Advicebuild/instructions.go:49GOLINTGOLINT
Advicebuild/instructions.go:53GOLINTGOLINT
Advicebuild/instructions.go:57GOLINTGOLINT
Unit
Tests Passed
Build Status
Buildable 2088
Build 3384: arc lint + arc unit

Event Timeline

Restricted Application added a reviewer: Release-Engineering-Team. · View Herald Transcript
Restricted Application added a project: Release-Engineering-Team. · View Herald Transcript

minor nit + the golint errors, but overall lgtm!

config/apt.go
23

Wish there were a nicer way to instantiate than having to supply an empty arg.

This revision is now accepted and ready to land.Aug 28 2017, 6:48 PM
This revision was automatically updated to reflect the committed changes.