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

Use Actuated runners for Linux test and publish #2758

Merged
merged 2 commits into from Apr 23, 2024
Merged

Conversation

klutchell
Copy link
Contributor

Change-type: patch

Resolves: #
Change-type: major|minor|patch
Depends-on:
See:


Please check the CONTRIBUTING.md file for relevant information and some
guidance. Keep in mind that the CLI is a cross-platform application that runs
on Windows, macOS and Linux. Tests will be automatically run by balena CI on
all three operating systems, but this will only help if you have added test
code that exercises the modified or added feature code.

Note that each commit message (currently only the first line) will be
automatically copied to the CHANGELOG.md file, so try writing it in a way
that describes the feature or fix for CLI users.

If there isn't a linked issue or if the linked issue doesn't quite match the
PR, please add a PR description to explain its purpose or the features that it
implements. Adding PR comments to blocks of code that aren't self explanatory
usually helps with the review process.

If the PR introduces security considerations or affects the development, build
or release process, please be sure to highlight this in the PR description.

Thank you very much for your contribution!

Change-type: patch
Signed-off-by: Kyle Harding <kyle@balena.io>
@klutchell
Copy link
Contributor Author

@otaviojacobi @thgreasi this is exactly what I did in my second commit, what am I missing?

** npm-shrinkwrap.json was not deduplicated or not fully committed - FAIL **
** This can usually be fixed with: **
** git checkout master -- npm-shrinkwrap.json **
** rm -rf node_modules **
** npm install && npm dedupe && npm install **
Error: "test-shrinkwrap": /home/runner/work/balena-cli/balena-cli/automation/test-lock-deduplicated.sh failed with exit code 1:
"/home/runner/work/balena-cli/balena-cli/automation/test-lock-deduplicated.sh" []

@otaviojacobi
Copy link
Contributor

otaviojacobi commented Apr 22, 2024

@klutchell This is one of the common gotchas when pushing the CLI: Some dependencies will be deduped. When some of the packages that are deduped have a new release, the shrinkwrap needs to be updated. If the shrinkwrap you pushed is different from the one the CI generated, you get this error. But why would they differ?

  • Most of the times is because a random deduped package had a new version published in the meantime between your push and npm install on the CI.
  • Sometimes it will be because of unmatching sha hashes of packages of the same version - usually caused by different npm version between your local env npm & CI NPM (npm can change the sha calculation method in different releases and cause this)

It appears that in your case it is the second as if I run npm i && npm dd && npm i in my machine I get a diff on the unbzip2-stream package current is:

    "node_modules/unbzip2-stream": {
      "version": "1.4.2",
      "resolved": "git+ssh://git@github.com/balena-io-modules/unbzip2-stream.git#4a54f56a25b58950f9e4277c56db2912d62242e7",
      "integrity": "sha512-brk1qgoQuqWAWifAFEyC7At0CZxuHL90kd3S2Sdmd1GrOcUGl2bey0Bu6MVc25xAXMz7WITNKD8hxyBpNmeOdg==",
      "license": "MIT"
    },

and after is:

    "node_modules/unbzip2-stream": {
      "version": "1.4.2",
      "resolved": "git+ssh://git@github.com/balena-io-modules/unbzip2-stream.git#4a54f56a25b58950f9e4277c56db2912d62242e7",
      "integrity": "sha512-hqSQ+EGPNNs80IGpZszUngM7ttKBCgjRtrw+2PTRDUd1UNvPOoSL4M7V1bDBJXktGv8KaVJFRKk2mWi6RmbiEg=="
    },

Note the different integrity checksums and the fact that the one above has a "license" while the below one does not.

@klutchell
Copy link
Contributor Author

So how can I tell which npm version I need to use?

@otaviojacobi
Copy link
Contributor

So how can I tell which npm version I need to use?

Usually I will check which one is flowzone using:

Environment details
  node: v20.12.2
  npm: 10.5.0

I suppose npm 10.5.0

@klutchell
Copy link
Contributor Author

Have we considered adding test:shrinkwrap to husky pre-commit hooks? Or even the entire dedupe command but that may be overkill.

@otaviojacobi
Copy link
Contributor

Have we considered adding test:shrinkwrap to husky pre-commit hooks? Or even the entire dedupe command but that may be overkill.

The issue is exactly that test:shrinkwrap underneath the hook needs to run npm i && npm dd && npm i which is very slow for a commit hook (maybe 5 minutes)?

@klutchell
Copy link
Contributor Author

which is very slow for a commit hook

yeah, I came to that conclusion

@klutchell klutchell marked this pull request as ready for review April 22, 2024 14:33
@klutchell
Copy link
Contributor Author

I'm using npm 10.5.0 now, still fails :(

Signed-off-by: Kyle Harding <kyle@balena.io>
@otaviojacobi
Copy link
Contributor

If I ran on your commit previous to Thodoris commit I still get a difference on sha calculation. Idk how exactly

@otaviojacobi
Copy link
Contributor

Ah wait, @klutchell did you ran npm i && npm dd && npm i after bumping?

@thgreasi
Copy link
Member

@klutchell

Run tar --exclude-vcs -acf /home/runner/actions-runner/_work/_temp/custom.tgz .
tar --exclude-vcs -acf /home/runner/actions-runner/_work/_temp/custom.tgz .
Error: pwsh: command not found

@klutchell
Copy link
Contributor Author

@klutchell

Run tar --exclude-vcs -acf /home/runner/actions-runner/_work/_temp/custom.tgz .
tar --exclude-vcs -acf /home/runner/actions-runner/_work/_temp/custom.tgz .
Error: pwsh: command not found

I saw that, I'm asking the Actuated team to install pwsh.

@klutchell
Copy link
Contributor Author

Ah wait, @klutchell did you ran npm i && npm dd && npm i after bumping?

Not sure what you mean. I re-ran to amend my dedupe commit. Maybe I should have deleted my dedupe commit before running? I can try that.

@flowzone-app flowzone-app bot merged commit 47e11d5 into master Apr 23, 2024
53 checks passed
@flowzone-app flowzone-app bot deleted the kyle/actuated branch April 23, 2024 12:07
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