To begin with, obviously I needed to set up a local dev environment. The version of Ruby that we are using won't build via rvm on Debian Buster, which I am using. So I began by upgrading Ruby to 2.4, which is the earlier version that installs without issue.
Of course, the whole point of CI in this case was just to run unit tests. So I started with that:
A large number of them failed. Rubygems itself changed a bit of its core, and thanks to the PR by @20goto10, I fixed that.
@joshjordan did a great job with tests, as always, for the code he wrote. Stripe changed their input iframe, though, so I had to fix the tests to accommodate the changes.
When running the tests, bower failed every time it was invoked. Oh, jeez. Now this is a can of worms. I began by installing the same versions that were present on production of both NPM and Node and trying again. No luck, but different errors. I scp'd the production node_modules directory locally to investigate. All of the dependencies were basically completely different. This is the problem, see the next bullet point for the solution.
NPM basically used to be a "wild west" with installs. NPM prior to 5 did not have a package-lock.json, so you could install a specific-ish version for your dependencies, but then those dependencies would all end up installing whatever was at the highest end of the acceptable semver range. I had already tried running this with the LTS node and npm but that did not work, so I downgraded to node 4.2.6 (from production) and then installed the earliest version of npm (5) that supports package-lock.json. Well, of course, that doesn't run on 4.2, you need 4.4 at least. So then I upgraded node to 4.4 with NPM 5. Then I ran npm i --package-lock-only on my local copy of the current production deployment. That is where the package-lock.json came from, which is very important. Now we will end up deploying consistent versions every time.
Many of the dependencies did not like Ruby 2.4, so I upgraded those.
rspec-core seems to have made a change that required me to move @example into a block parameter.
Several places in the code, including in our own Gemfile, the git://github.com/ protocol/server was used, and that doesn't exist anymore. I had to fix these to even install it.
I had several errors (which frankly I cannot remember) with the Selenium driver, which was extremely old and also didn't play well with the slightly newer dependencies. I replaced it with the headless chrome driver, which doesn't look too hard to get working on CI.
I fixed another issue with Stripe tests which I cannot explain but now it works.
GitHub Actions CI Setup
Then after doing the aforementioned yak shaving, I added one file, verify.yaml, which runs rspec. Now CI works.
I also updated the README to add a deprecation notice, and updated our build status badge.
This addresses #481
Summary of changes:
bower
failed every time it was invoked. Oh, jeez. Now this is a can of worms. I began by installing the same versions that were present on production of both NPM and Node and trying again. No luck, but different errors. Iscp
'd the productionnode_modules
directory locally to investigate. All of the dependencies were basically completely different. This is the problem, see the next bullet point for the solution.package-lock.json
, so you could install a specific-ish version for your dependencies, but then those dependencies would all end up installing whatever was at the highest end of the acceptable semver range. I had already tried running this with the LTSnode
andnpm
but that did not work, so I downgraded to node 4.2.6 (from production) and then installed the earliest version ofnpm
(5) that supportspackage-lock.json
. Well, of course, that doesn't run on 4.2, you need 4.4 at least. So then I upgradednode
to 4.4 with NPM 5. Then I rannpm i --package-lock-only
on my local copy of the current production deployment. That is where thepackage-lock.json
came from, which is very important. Now we will end up deploying consistent versions every time.rspec-core
seems to have made a change that required me to move@example
into a block parameter.git://github.com/
protocol/server was used, and that doesn't exist anymore. I had to fix these to even install it.GitHub Actions CI Setup
Then after doing the aforementioned yak shaving, I added one file,
verify.yaml
, which runs rspec. Now CI works.I also updated the README to add a deprecation notice, and updated our build status badge.