Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

light refactor of engine.go #3084

Merged
merged 3 commits into from
Jun 1, 2018

Conversation

jackfrancis
Copy link
Member

@jackfrancis jackfrancis commented May 25, 2018

What this PR does / why we need it:

  • moves all constants under acsengine package to pkg/acsengine/const.go
  • ditto for types to pkg/acsengine/types.go
  • eliminates unnecessary exportable (uppercase first letter) package references
  • slight reorganization of func placements in engine.go (exportable at top, private below)
  • ARM parameters-specific foo is now in pkg/acsengine/params.go and pkg/acsengine/params_k8s.go (broken out from engine.go)
  • ARM template generation-specific foo is now in pkg/acsengine/template_generator.go (broken out from engine.go)

The obvious practical benefits are to reduce engine.go by ~1700 lines and to make unit test // TODO work a little more approachable.

There is no functional intent of this PR, any such observations would disqualify it.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Special notes for your reviewer:

If applicable:

  • documentation
  • unit tests
  • tested backward compatibility (ie. deploy with previous version, upgrade with this branch)

Release note:

light refactor of engine.go

@acs-bot
Copy link

acs-bot commented May 25, 2018

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: jackfrancis

Assign the PR to them by writing /assign @jackfrancis in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ghost ghost assigned jackfrancis May 25, 2018
@ghost ghost added the in progress label May 25, 2018
@jackfrancis jackfrancis force-pushed the 20180524-flight-2674h branch from b07f2d4 to b69da7b Compare May 25, 2018 03:19
@codecov
Copy link

codecov bot commented May 25, 2018

Codecov Report

Merging #3084 into master will increase coverage by 0.01%.
The diff coverage is 57.57%.

@@            Coverage Diff             @@
##           master    #3084      +/-   ##
==========================================
+ Coverage   51.85%   51.87%   +0.01%     
==========================================
  Files          99      102       +3     
  Lines       15193    15197       +4     
==========================================
+ Hits         7879     7883       +4     
  Misses       6590     6590              
  Partials      724      724

@CecileRobertMichon
Copy link
Contributor

"light" 😛

@jackfrancis jackfrancis force-pushed the 20180524-flight-2674h branch from b69da7b to f65a114 Compare May 29, 2018 16:22
@jackfrancis
Copy link
Member Author

@jim-minter @pweil- For your consideration. There is some shared surface area here and will wait for your sign-off. This PR is of the "eat your spinach" variety: a little bit of tech-debt payback within the confines of an easily reviewable PR. (basically the length of a flight between PDX and SEA, which is not long enough to allow for too much change :) )

@jackfrancis jackfrancis requested review from jim-minter and pweil- May 29, 2018 20:09
@jackfrancis jackfrancis force-pushed the 20180524-flight-2674h branch from f65a114 to 742f534 Compare May 31, 2018 19:42
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

lgtm

- breakout params to params.go
  - k8s-specific in params_k8s.go
- breakout template generator to template_generator.go
- move constants to const.go
- move type definitions to types.go
- make unnecessary exportable properties non-exportable
@jackfrancis jackfrancis force-pushed the 20180524-flight-2674h branch from 6d5d672 to 4b355c4 Compare June 1, 2018 19:33
@jackfrancis jackfrancis merged commit 541a0fe into Azure:master Jun 1, 2018
@ghost ghost removed the in progress label Jun 1, 2018
@jackfrancis jackfrancis deleted the 20180524-flight-2674h branch June 1, 2018 20:29
@serbrech
Copy link
Member

serbrech commented Jun 6, 2018

As much as I wanted to take on this, I don't think it was possible for someone else than you guys to tackle it. Awesome 🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants