From e8734e21fe26499b0b17e7e10d8e87ef9e023be6 Mon Sep 17 00:00:00 2001 From: Barry Gordon Date: Mon, 14 Feb 2022 11:37:25 +0000 Subject: [PATCH 1/2] Ensure the build check fails if there are new untracked files --- script/check-diff | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script/check-diff b/script/check-diff index bc45833cd..c68ccf20a 100755 --- a/script/check-diff +++ b/script/check-diff @@ -1,5 +1,7 @@ #!/bin/bash +# Make sure we notice any untracked files generated by the build +git add --intent-to-add . git diff --quiet dist/ retVal=$? if [ $retVal -ne 0 ]; then From 32688a28538d439d3989f7f37dcf9693b455637f Mon Sep 17 00:00:00 2001 From: Barry Gordon <896971+brrygrdn@users.noreply.github.com> Date: Tue, 15 Feb 2022 13:14:19 +0000 Subject: [PATCH 2/2] Ignore ssh2 native extensions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We pull in ssh2 via dockerode: dockerode ↳ docker-modem ↳ ssh2 ↳ cpu-features Both it and `cpu-features` compile _optional_ native extensions using OpenSSH and cpu-features (https://github.com/google/cpu_features) which result in node-gyp generating two `.node` executables for these bindings We have found that these bindings are very sensitive to the build env which means that developer laptops, Actions and Codespaces result in a diff in the `.node` files, something we seek to prevent in PRs in order to detect cases where code changes are committed without actually being applied to the `dist/` folder. Since we do not actually SSH into any containers in our implementation, let's just ignore these files in our distributed code rather than make our build more convoluted/less portable. --- .gitignore | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 60c76247c..064597176 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,10 @@ output/output.json repo tmp/ +# Ignore optional native extensions for SSH +dist/*/build/Release/cpufeatures.node +dist/*/lib/protocol/crypto/build/Release/sshcrypto.node + # Dependency directory node_modules @@ -98,7 +102,3 @@ typings/ # OS metadata .DS_Store Thumbs.db - -# Ignore built ts files -__tests__/runner/* -lib/**/*