Skip to content

[init refactor] introducing init analyzers#3533

Merged
balopat merged 2 commits intoGoogleContainerTools:masterfrom
balopat:init_refactor/analyzers
Jan 20, 2020
Merged

[init refactor] introducing init analyzers#3533
balopat merged 2 commits intoGoogleContainerTools:masterfrom
balopat:init_refactor/analyzers

Conversation

@balopat
Copy link
Copy Markdown
Contributor

@balopat balopat commented Jan 20, 2020

Refactoring - shouldn't change anything functionally.
Introducing analyzers in the initializer package.

An Analyzer is basically implementing a Visitor pattern, can react to EnterDir and ExitDir events and can be called on each file. This creates a more composable design that is open for extension but closed for modification.

Also added tests to cover config generation logic.

@balopat balopat changed the title introducing init analyzers [init refactor] introducing init analyzers Jan 20, 2020
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 20, 2020

Codecov Report

Merging #3533 into master will increase coverage by 0.24%.
The diff coverage is 62.65%.

Impacted Files Coverage Δ
pkg/skaffold/initializer/builders.go 92.85% <ø> (+8.3%) ⬆️
pkg/skaffold/initializer/init.go 0% <0%> (-29.13%) ⬇️
pkg/skaffold/initializer/prompt.go 0% <0%> (ø)
pkg/skaffold/initializer/config.go 100% <100%> (ø)
pkg/skaffold/initializer/analyze.go 89.09% <89.09%> (ø)

@balopat balopat force-pushed the init_refactor/analyzers branch 2 times, most recently from 98a28f7 to 15e12ca Compare January 20, 2020 07:33
Copy link
Copy Markdown
Contributor

@dgageot dgageot left a comment

Choose a reason for hiding this comment

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

Looks good to me with a few nits

)

type analysis struct {
kubectlAnalyzer *KubectlAnalyzer
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.

Do these three types need to be exposed?

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.

Actually, they don't!

@balopat balopat force-pushed the init_refactor/analyzers branch from 15e12ca to 7af6f16 Compare January 20, 2020 07:35
@dgageot dgageot self-assigned this Jan 20, 2020
@balopat
Copy link
Copy Markdown
Contributor Author

balopat commented Jan 20, 2020

Thanks for the quick review! I'll fix the nits tomorrow morning!:)

@balopat balopat merged commit 99870a8 into GoogleContainerTools:master Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants