Page MenuHomePhabricator

Simplify Docker instruction compilation
ClosedPublic

Authored by dduvall on Feb 28 2018, 12:46 AM.

Details

Reviewers
thcipriani
demon
hashar
mmodell
Group Reviewers
Release-Engineering-Team
Commits
rGBLBR8fa191f03d34: Simplify Docker instruction compilation
Patch without arc
git checkout -b D990 && curl -L https://phabricator.wikimedia.org/D990?download=true | git apply
Summary

After adding a number of new instructions, it seemed there was a lot of
redundant implementation between concrete types. This refactor uses just
one concrete unexported type and a few options for determining the
output format instead of one struct type per possible Docker
instruction.

The exported docker.Instruction interface and signature of
docker.NewInstruction is unchanged with this refactor. Unit tests for
Docker instruction compilation were simplified to not make type
assertions but were otherwise left to ensure no regression.

Depends on D984

Test Plan

Run go test ./....

Diff Detail

Repository
rGBLBR Blubber
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dduvall created this revision.Feb 28 2018, 12:46 AM
Restricted Application added a reviewer: Release-Engineering-Team. · View Herald TranscriptFeb 28 2018, 12:46 AM
Restricted Application added a project: Release-Engineering-Team. · View Herald Transcript
dduvall requested review of this revision.Feb 28 2018, 12:46 AM
dduvall requested review of this revision.Feb 28 2018, 12:46 AM
dduvall updated this revision to Diff 2597.Feb 28 2018, 12:50 AM

Finished documenting internal docker.instruction fields

thcipriani accepted this revision.Mar 5 2018, 11:31 PM
This revision is now accepted and ready to land.Mar 5 2018, 11:31 PM
This revision was automatically updated to reflect the committed changes.