Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Cleanup launcher source #10

Closed
markdryan opened this issue Apr 7, 2016 · 2 comments
Closed

Cleanup launcher source #10

markdryan opened this issue Apr 7, 2016 · 2 comments

Comments

@markdryan
Copy link
Contributor

The launcher source needs to be cleaned up a little

  1. There are some functions which are too long, particularly in instance.go
  2. The payloads.go file needs to go and to be split up over the other files that implement commands.
  3. It would be nice to rename some of the files that implement commands, e.g., start to indicate that these commands run in the instance go routine context.
@markdryan markdryan self-assigned this Apr 7, 2016
markdryan pushed a commit that referenced this issue Apr 15, 2016
This data structure is needed to allow us to refactor the instanceLoop.
Without this data structure splitting the instance loop into multiple
functions would require passing a huge number of parameters to those
functions.

Partial fix for issue:

#10

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
markdryan pushed a commit that referenced this issue Apr 15, 2016
Partial fix for issue:

#10

The code is much less indented and easier to read now.

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
markdryan pushed a commit to markdryan/ciao that referenced this issue May 4, 2016
ciao/ciao-launcher/main.go
 Line 529: warning: cyclomatic complexity 17 of function main() is
   high (> 15) (gocyclo)

main() has now been split in two.

This is also a partial fix for

ciao-project#10

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
markdryan pushed a commit to markdryan/ciao that referenced this issue May 4, 2016
Fix the following gocyclo warning:

ciao/ciao-launcher/instance.go
 Line 231: warning: cyclomatic complexity 17 of function (*instanceData).instanceLoop()
  is high (> 15) (gocyclo)

The switch statement that processes instance commands has been moved to its own method,
instanceCommand.

This is also a partial fix for

ciao-project#10

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
markdryan pushed a commit to markdryan/ciao that referenced this issue May 4, 2016
Fix the following gocyclo error:

ciao/ciao-launcher/qemu.go
 Line 568: warning: cyclomatic complexity 22 of function qmpConnect()
  is high (> 15) (gocyclo)

This is also a partial fix for

ciao-project#10

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
markdryan pushed a commit to markdryan/ciao that referenced this issue May 4, 2016
ciao/ciao-launcher/main.go
 Line 529: warning: cyclomatic complexity 17 of function main() is
   high (> 15) (gocyclo)

main() has now been split in two.

This is also a partial fix for

ciao-project#10

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
markdryan pushed a commit to markdryan/ciao that referenced this issue May 4, 2016
Fix the following gocyclo warning:

ciao/ciao-launcher/instance.go
 Line 231: warning: cyclomatic complexity 17 of function (*instanceData).instanceLoop()
  is high (> 15) (gocyclo)

The switch statement that processes instance commands has been moved to its own method,
instanceCommand.

This is also a partial fix for

ciao-project#10

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
markdryan pushed a commit to markdryan/ciao that referenced this issue May 4, 2016
Fix the following gocyclo error:

ciao/ciao-launcher/qemu.go
 Line 568: warning: cyclomatic complexity 22 of function qmpConnect()
  is high (> 15) (gocyclo)

This is also a partial fix for

ciao-project#10

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
@amyleeland amyleeland added this to the Sprint 1.0 milestone Jun 2, 2016
@markdryan
Copy link
Contributor Author

The first bullet point has been implemented.

@markdryan markdryan added the P2 label Jun 6, 2016
@markdryan
Copy link
Contributor Author

In the end I decided not to implement the second bullet point, i.e., split up payloads. The reason is that payloads.go contains parses and generators for the various yaml payloads that launcher processes. I was planning to move these functions into the files that use them but, it turns out that they're used by different files whose code runs in different go routines. Splitting up payloads would then require splitting up the yaml parsing and generating code.

markdryan pushed a commit to markdryan/ciao that referenced this issue Jun 27, 2016
The code for the instance go routine is split over a number of
different files.  These files have been renamed to make it
obvious in which context their code runs.  Code that is not
unique to the instance go routine, i.e., the error types for
specific commands has been moved to new files.

Fixes: ciao-project#10

Signed-off-by: Mark Ryan <mark.d.ryan@intel.com>
@sameo sameo removed the ready label Jun 27, 2016
kaccardi added a commit to kaccardi/ciao that referenced this issue Aug 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants