Skip to content

San 6078 - #2029

Open
damienrunnable wants to merge 13 commits into
masterfrom
SAN-6078
Open

damienrunnable wants to merge 13 commits into
masterfrom
SAN-6078

Conversation

@damienrunnable

Copy link
Copy Markdown
Contributor

Saving the image data on the context version.

* master: (134 commits)
  Replacing the npm tokens
  12.5.1
  update model
  Added catch to prevent keymaker from preventing build process
  12.5.0
  Revert "Revert "San 6200 add ssh keys""
  Remove session user from call
  Revert "San 6200 add ssh keys"
  Add a migrate-and-start command
  Use saveAsync()
  fix seedVersions for callback
  remove unused func param
  add migration stuff into readme
  fix migrate up again
  12.4.3
  add migrate-up to start
  12.4.2
  Added newlines and added comments
  Still messed up which functions went where
  Changing invalid mount type. r to ro
  ...
Comment thread lib/models/services/image-service.js Outdated
return portList
}

ImageService.getImageDataFromJob = function (job) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems that this method name can be changed. You are not getting image data from any job, you are getting from a particular one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, maybe we don't even need to put it in the service. Can we keep it in to the worker?

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 don't mind keeping this separate since the worker is already bloated.

@podviaznikov podviaznikov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good. Few minor questions

Comment thread lib/models/services/image-service.js Outdated

ImageService.getImageDataFromJob = function (job) {
const log = ImageService.logger.child({
method: 'getImageDataFromJob'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

add job to log data

Comment thread lib/models/services/image-service.js Outdated
return portList
}

ImageService.getImageDataFromJob = function (job) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, maybe we don't even need to put it in the service. Can we keep it in to the worker?

Comment thread lib/models/mongo/context-version.js Outdated
}
}

if (imageData) {

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 a case where we don't get image data? we should always have it here.

Comment thread lib/models/services/image-service.js Outdated
@@ -0,0 +1,56 @@
/**
* @module lib/models/services/image-service

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.

nit: rename to docker image service

Comment thread lib/models/services/image-service.js Outdated
*/
'use strict'

require('loadenv')('models/services/infracode-version-service')

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.

update name

Comment thread lib/models/services/image-service.js Outdated
return portList
}

ImageService.getImageDataFromJob = function (job) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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