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

Node 20: Docker, package.json dependency updates, README enhancements, and general bugfixes and enhancements for developer experience. #1523

Merged
merged 14 commits into from
Dec 15, 2023

Conversation

dgrebb
Copy link
Contributor

@dgrebb dgrebb commented Dec 15, 2023

@garris happy Friday!

Here is the (drafted) PR for Node 20 support, and Node 14 deprecation. Test results and CI/CD can be seen here.

@OssamaSijbesma had already addressed the image updates to Node 20 in PR #1513. Thanks @OssamaSijbesma!

Please let me know if you'd like to discuss this week, would like any changes, and have any feedback in general :)

Passing Tests

I set up a collection of GitHub Actions workflows, to make testing awareness and communication more streamlined for the project. More on that in a separate PR :)

🙈 Backstop & Docker CI

The above results are from a testing-only branch, which is rebased from my develop to include the GitHub testing workflows. This branch doesn't have actions merged in, so it can't be tested without polluting the PR.

Happy to explain more, but perhaps an image will suffice!

image

Backstop Tests

  • Backstop Tests
  • Backstop Integration Tests
  • Backstop Sanity Tests
  • Backstop Smoke Tests

Docker Tests

  • Docker Tests
  • Docker Build & Push
  • Docker Sanity Tests
  • Docker Smoke Tests

The Node 20 Docker image is available here, and can be tested locally via:

cd test/configs/ && docker pull ghcr.io/dgrebb/backstopjs:chore-downstream-pr_feature-34-node-20 && docker run --platform linux/arm64 --rm -it --mount type=bind,source="$(pwd)",target=/src ghcr.io/dgrebb/backstopjs:chore-downstream-pr_feature-34-node-20 test --config=backstop_features_pw

This assumes --platform linux/arm64. Please update to test on non-arm architecture!

Also, one may need to change the --mount source value back to cwd — I wasn't sure why that is used in the README example for running against a custom image.

Note

The above docker image and test results are in a develop rebased branch for testing only.

The Dockerfile in this branch is set to use dgrebb/BackstopJS#feature/34-node-20 as the installation source for backstopjs. This was needed to demonstrate passing tests with the latest changes, inside GitHub Actions (coming soon in another PR).

This closes #34.


Details

Change Summary

This comes with many dependency updates, formatting adjustments, a README refactor, Dockerfile updates, and general bugfixes, removals, and enhancements. Here's the tl;dr:

  • updates dependencies to latest possible versions
  • adjusts formatting based on eslint rules
  • adds eslint-disable where needed
  • drops support for Node 14 and specifies engines in package.json
  • updates Dockerfile
    • node:20-bullseye
    • includes npx playwright install --with-deps in Dockerfile
  • fixes npm script: integration-test
  • adds friendly pass/fail/caution message to the end of smoke, integration, and sanity tests
  • adds load-docker npm script for local testing of built docker images
  • major updates to formatting and README TOC
    • adds note about load-docker
  • removes obsolete genConfig npm script
    • legacy from casper/slimer days (became makeConfig, aka backstop init)

I can squash the 14 commits down into one with a longer description attached to the squash-commit. Let me know and it shall be done!

Next Steps

  • Change base branch of this PR to upstream
  • Approve PR
  • Cut a pre-release?
  • Community Testing?
  • Publish next version to npm
  • Publish new Docker image to registry
  • Review / merge / publish new ember-backstop version
  • Done!

README.md Updates

While updating the README, I thought it could use a refresh. Happy to revert this if needed.

I'm using a handy VSCode Markdwon plugin for TOC generation, which automatically creates and updates based on comments and .vscode/settings.json configuration. Happy to share details if curious!

HTML Report Development

Added a warning here that currently builds are broken and updates are in progress to fix webpack, update React, etc.

Docker

Added a note about load-docker npm script to build/run Dockerfile changes locally without publishing.

General Spacing/Indentation/Enhancements

Removed some legacy, commented-out sections from the README, which I think are OK to keep in git history for now?

Removed $ in command examples that users will likely want to copy/paste.

Converted scenario properties section to a markdown table.

Converted onBeforeScript/onReadyScript variable list to a markdown table.

Added some fancy GitHub-flavored markdown blockquote highlights. Great for "warnings", "tips", and other callouts.

Notes

Critical Vulnerability in mockery

The maintainer of mockery has not addressed this yet, but a patch is open. Please let me know if you're interested in adding patch-package and a patches directory to address this. Happy to set that up!

this loads the custom docker image, built with buildx, into local system container namespace. necessary when updating dockerfile without the option to publish to docker registry.
`genConfig` is now `makeConfig` and is ultimately used in `backstop init`. There is no need to test this separately, as it's part of the
overall flow of `init`, which is now used in npm's `integration-test` script, and passing.
…on, smoke, and sanity tests

This provides a final outcome message for all npm scripts for internal project testing. With tests that `exit 1`, a caution message is used, as opposed to a full-blown "FAIL".
also renames "docker-load" script "load-docker" to align with other script naming conventions
@dgrebb dgrebb changed the title Feature/34 node 20 Node 20: Docker, package.json dependency updates, README enhancements, and general bugfixes and enhancements for developer experience. Dec 15, 2023
@garris
Copy link
Owner

garris commented Dec 15, 2023

Thank you @dgrebb for this big refresh! Cheers!

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.

Version 0.4.0 stop working
2 participants