Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace s3pository with nodebin #540

Merged
merged 9 commits into from
Mar 15, 2017
Merged

replace s3pository with nodebin #540

merged 9 commits into from
Mar 15, 2017

Conversation

hone
Copy link
Member

@hone hone commented Feb 25, 2017

upgrade node to latest Node LTS for Rails 5.1
s3pository is being replaced with nodebin
can't push to cedar-10 stack anymore, so don't need "legacy"
node 0.12 is ancient at this point, we should pin to LTS now

/cc @hunterloftis

@hone hone force-pushed the nodebin branch 4 times, most recently from f456e0f to 24650ff Compare February 25, 2017 01:39
@schneems
Copy link
Contributor

Awesome start, tests are failing. Looks like due to rate limiting. Restarting tests.

@hone hone force-pushed the nodebin branch 17 times, most recently from 6e62447 to 5b4b845 Compare March 9, 2017 23:42
hone added 2 commits March 9, 2017 17:42
upgrade node to latest Node LTS for Rails 5.1
s3pository is being replaced with nodebin
can't push to cedar-10 stack anymore, so don't need "legacy"
node 0.12 is ancient at this point, we should pin to LTS now
@hone
Copy link
Member Author

hone commented Mar 10, 2017

added yarn support if we detect the webpacker gem.

Copy link
Contributor

@schneems schneems left a comment

Choose a reason for hiding this comment

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

Left a few comments. Think we need to namespace the helper to keep it consistent with the other ones. Also take a look at the rails version assertion, either need to modify or remove that.

@@ -0,0 +1,24 @@
require 'json'

class LanguagePack::Nodebin
Copy link
Contributor

Choose a reason for hiding this comment

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

The other helpers are name-spaced LanguagePack::Helpers

Copy link
Member Author

Choose a reason for hiding this comment

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

happy to make that change.

end

def self.node_lts
node("latest?range=6.x")
Copy link
Contributor

Choose a reason for hiding this comment

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

Will we need to manually rev this for future versions of node?

Copy link
Member Author

@hone hone Mar 13, 2017

Choose a reason for hiding this comment

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

yeah, I'm asking @hunterloftis for a /lts route or param. It'd be nice not having to keep up to date with it. I think he's trying to keep changes to a minimum until after he ships it to prod for now. /cc @jmorrell

Choose a reason for hiding this comment

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

I'm down with the idea & if @jmorrell wants to implement 👍 but I wouldn't sweat the maintenance burden too much (once a year updates).

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd be happy to submit a PR too if you're down with it :) I just imagine if say the Go buildpack needs to start bundling yarn + node, it would be nice to have a path for it.

node_bin = "#{binary_path}/bin/node"

Dir.chdir(dir) do
@fetcher.fetch_untar(@url, node_bin)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the mktmpdir dance needed here?

Copy link
Member Author

Choose a reason for hiding this comment

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

it's not looking at it now.

bin_dir = "bin"
FileUtils.mkdir_p bin_dir
Dir.chdir(bin_dir) do |dir|
if name.match(/^node\-/)
@node_installer.install
node_bin_path = File.absolute_path(".")
ENV["PATH"] = "#{ENV["PATH"]}:#{node_bin_path}"
Copy link
Contributor

Choose a reason for hiding this comment

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

It's weird that this is needed. bin/ should already be on the path.

Copy link
Member Author

@hone hone Mar 13, 2017

Choose a reason for hiding this comment

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

we need this b/c we need the absolute path during yarn install. some node modules using node-gyp will change the CWD and try to execute node and it won't be there. i'll add a comment.

Hatchet::Runner.new("rails51_webpacker").deploy do |app, heroku|
expect(app.output).to include("Installing yarn")
expect(app.output).to include("yarn install")
expect(app.run("rails -v")).to match("")
Copy link
Contributor

Choose a reason for hiding this comment

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

We supposed to be expecting a rails version here?

Maybe we should check status of yarn -v?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure. I just copied the rails5 test I think.

Copy link
Contributor

@schneems schneems 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

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.

None yet

3 participants