Skip to content

Sealights integration fix#443

Merged
arjun024 merged 3 commits intocloudfoundry:developfrom
RoniSegal:master
May 9, 2022
Merged

Sealights integration fix#443
arjun024 merged 3 commits intocloudfoundry:developfrom
RoniSegal:master

Conversation

@RoniSegal
Copy link
Copy Markdown
Contributor

@RoniSegal RoniSegal commented Apr 25, 2022

Thanks for contributing to the buildpack. To speed up the process of reviewing your pull request please provide us with:

  • A short explanation of the proposed change:

  • An explanation of the use cases your change solves

  • I have viewed signed and have submitted the Contributor License Agreement

  • I have made this pull request to the develop branch

  • I have added an integration test

@trigunam
Copy link
Copy Markdown

@RoniSegal our team has confirmed that the changes work fine when we use the buildpack URL as https://github.com/victor-katsovsky/nodejs-buildpack.git

Thanks for fixing this issue.

Copy link
Copy Markdown
Member

@arjun024 arjun024 left a comment

Choose a reason for hiding this comment

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

Please see my comments/questions inline

Also, could you amend the commit message to include a description of what sealights is and what this integration does?

Comment on lines +52 to +54
PushAppAndConfirm(app)
Expect(RunCF("bind-service", app.Name, serviceNameOne)).To(Succeed())
PushAppAndConfirm(app)
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.

Is there a reason this app is pushed twice as opposed to something more idiomatic like:

Expect(app.PushNoStart()).To(Succeed())
Expect(RunCF("bind-service", app.Name, serviceNameOne)).To(Succeed())
Expect(app.Restart()).To(Succeed())

If not, can you change it?

PushAppAndConfirm(app)
Expect(RunCF("bind-service", app.Name, serviceNameOne)).To(Succeed())
PushAppAndConfirm(app)
Expect(app.DownloadDroplet(filepath.Join(app.Path, "droplet.tgz"))).To(Succeed())
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.

This droplet.tgz is left hanging within the fixtures after the test. Can you clean it up? It would be great if you can use a tempfile instead of downloading it into the the fixture/<app> dir.

var sb strings.Builder
sb.WriteString("./node_modules/.bin/slnodejs run --useinitialcolor true ")

if o.TokenFile != "" {
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.

Not sure if I'm missing something - I couldn't find a place where TokenFile is populated but I see its value being checked here and in other places

Comment thread src/nodejs/hooks/sealights.go Outdated
sl.Log.Info("Sealights token not found")
return fmt.Errorf(EmptyTokenError), ""
}
split := strings.SplitAfter(originalCommand, "node")
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.

Is it always assured that a user who wishes to use the sealights integration would always set their start command (say in a Procfile) as node ...? Can they set something like npm start? If that's not relevant for your case, this is fine with me. If that's a use-case left out in error, can you handle it?

Comment thread src/nodejs/hooks/sealights.go Outdated
}
split := strings.SplitAfter(originalCommand, "node")

o := sl.getSealightsOptions(split[1], token)
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.

Can you verify the length of split[] before using the index and otherwise log a readable error?

EugeneTitarchuk and others added 2 commits May 6, 2022 18:25
1. Assign TokenFile property
2. Added fallback for npm commands
3. Remove temp droplet file after the tests
@RoniSegal
Copy link
Copy Markdown
Contributor Author

Thanks @arjun024, fixed your comments
Regarding fixing the commit message, unfortunately I couldn't do so since we had another commit in between

@brayanhenao brayanhenao requested a review from arjun024 May 9, 2022 14:21
@arjun024 arjun024 merged commit 33dd371 into cloudfoundry:develop May 9, 2022
@brayanhenao brayanhenao linked an issue May 9, 2022 that may be closed by this pull request
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.

Sealights integration

5 participants