Skip to content

model: refactor static build properies onto m.buildInfo.buildDetails [ch1136]#879

Merged
maiamcc merged 6 commits into
masterfrom
maiamcc/build-info
Dec 21, 2018
Merged

model: refactor static build properies onto m.buildInfo.buildDetails [ch1136]#879
maiamcc merged 6 commits into
masterfrom
maiamcc/build-info

Conversation

@maiamcc

@maiamcc maiamcc commented Dec 21, 2018

Copy link
Copy Markdown
Contributor

(in the interest of not having this be a single giant code review --
will do FastBuild properties in a different PR.)

Hello @jazzdan, @nicks,

Please review the following commits I made in branch maiamcc/build-info:

3c8c237 (2018-12-20 19:33:07 -0500)
static build properties

9be6b3c (2018-12-20 18:27:29 -0500)
staticDf

c2b01fa (2018-12-20 18:12:26 -0500)
move docker stuff into nested field on manifest

Code review reminders, by giving a LGTM you attest that:

  • Commits are adequately tested
  • Code is easy to understand and conforms to style guides
  • Incomplete code is marked with TODOs
  • Code is suitably instrumented with logging and metrics

@maiamcc
maiamcc requested review from jazzdan and nicks December 21, 2018 00:34
Comment thread internal/model/manifest.go Outdated

type DockerBuildArgs map[string]string
func (m Manifest) DockerInfo() DockerInfo {
switch info := m.buildInfo.(type) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this be simpler as a plain type cast? not sure what the extra machinery of a switch is getting you

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ha fair.

Comment thread internal/ospath/ospath_test.go Outdated
f.TouchFiles(paths)

f.assertChild("parent", "sibling/fileD", "")
fmt.Println("---")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh lol this wasn't supposed to be in here

Comment thread internal/ospath/ospath_test.go Outdated
"github.com/windmilleng/tilt/internal/testutils/tempdir"
)

func TestBullshit(t *testing.T) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this either -- was testing weird ospath.Child hanging

Comment thread internal/ospath/ospath.go Outdated
current := file
child := "."
for true {
fmt.Printf("checking dir '%s' for current '%s' (child = %s)\n", dir, current, child)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lol nor this 😳

Comment thread internal/model/manifest.go Outdated

// TODO(maia): buildInfo
// Info needed to build an image. Can be StaticBuild, FastBuild... etc.
buildInfo buildInfo

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there some reason why this isn't a DockerInfo? afaik, there are no other types of buildInfos. it seems like a meaningless interface

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair. Theoretically in future we might want to use different image builders, but i agree that we don't need that flexibility built in right now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

name := manifest.DockerRef()
if manifest.IsStaticBuild() {
dInfo := manifest.DockerInfo()
if dInfo.Empty() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder if ValidateDockerK8sManifest and this validation should be merged, so that ValidateDockerK8sManifest returns a guaranteed non-empty DockerInfo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well this is no longer in there so mreh.

@maiamcc
maiamcc merged commit 95b5322 into master Dec 21, 2018
@maiamcc
maiamcc deleted the maiamcc/build-info branch December 21, 2018 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants