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

Fix/npm package cli download #2332

Merged
merged 9 commits into from
Jun 23, 2023

Conversation

xemle
Copy link
Contributor

@xemle xemle commented Apr 19, 2023

Fixes #2327 with by replacing unzipper package by adm-zip due ZJONSSON/node-unzipper#271 and problems on node:18.16-alpine docker image.

It reduces also dependencies since adm-zip comes without any dependencies.

@xemle
Copy link
Contributor Author

xemle commented Apr 19, 2023

Dear maintainers

I would like to help with the MR but the automatic tests are failing. Can you help me to fix them and explain why they fail through my changes?

@xemle
Copy link
Contributor Author

xemle commented Jun 13, 2023

Hi @zabil

Currently gaugejs is blocked due failing installation of the bin for current node versions 18 and upcoming TLS version 20. The PR fixes this. Since the change should not affect the general automatic test they are still failing. I am wondering how to proceed with this fix. I am happy for any input bringing this PR forward.

In #2338 you wrote

We have a wonderful community here, and I'm confident that others who may be facing this same issue will soon chime in with their insights or solutions. Your patience while waiting for these responses is greatly appreciated.

Currently my feeling is that there is no wonderful community which takes care about breaking and blocking issues. Dont take it as offense. I just want to know and clarify the activity of this awesome project. I totally understand if the projects gets abandoned when the financial support is not given and all the hard work is needs to be done for free. But it would be fair for the wonderful community to communicate it in such way, too. The last commit on the master is 9 month old.

Who is taking care of PRs? Which members can review or accept the PRs? How can we proceed here?

@zabil
Copy link
Member

zabil commented Jun 13, 2023

I just want to know and clarify the activity of this awesome project.

Gauge is not actively maintained anymore.

Thanks for the effort in this PR. This can be merged after

  • You sign the DCO
  • And the builds pass

Cheers.

Signed-off-by: Sebastian Felis <[email protected]>
Signed-off-by: Sebastian Felis <[email protected]>
Signed-off-by: Sebastian Felis <[email protected]>
Signed-off-by: Sebastian Felis <[email protected]>
@xemle xemle force-pushed the fix/npm-package-cli-download branch from 024f7ce to 902fa31 Compare June 14, 2023 20:38
@xemle
Copy link
Contributor Author

xemle commented Jun 14, 2023

@zabil Thank you for your quick answer.

I've signed the DCO. Thank you for the hint.

However still tests are failing.

@xemle
Copy link
Contributor Author

xemle commented Jun 14, 2023

I just want to know and clarify the activity of this awesome project.

Gauge is not actively maintained anymore.

@zabil Is this information transparent to the public? I can not find information in on the project page https://gauge.org, the blog the README.md or the CONTRIBUTING.md. It would be fair to state it clearly.

@zabil
Copy link
Member

zabil commented Jun 20, 2023

@xemle
Copy link
Contributor Author

xemle commented Jun 20, 2023

Thank you @zabil for updating the README.md. This clarifies the current project state.

I hope it wont be the end of all the awesome work of it. Lets see

@xemle
Copy link
Contributor Author

xemle commented Jun 22, 2023

Hi @haroon-sheikh

Thank you very much for updating basic CI build settings. Now even my PR has green checks! Awesome.

What plans do you have with gauge regarding maintenance and review PRs? Is there a chance that the Gauge's JS port gets fixed for current node LTS versions?

@haroon-sheikh
Copy link
Contributor

haroon-sheikh commented Jun 22, 2023

Thanks @xemle. I'll be more than happy to review any PRs under https://github.com/getgauge/gauge-js. Please feel free to contribute.

@gaugebot
Copy link

gaugebot bot commented Jun 22, 2023

@xemle Thank you for contributing to gauge. Your pull request has been labeled as a release candidate 🎉🎉.

Merging this PR will trigger a release.

Please bump up the version as part of this PR.

Instructions to bump the version can found at CONTRIBUTING.md

If the CONTRIBUTING.md file does not exist or does not include instructions about bumping up the version, please looks previous commits in git history to see what changes need to be done.

@xemle
Copy link
Contributor Author

xemle commented Jun 22, 2023

@haroon-sheikh up to now I did not face problems on gauge-js to run my e2e tests of my web photo HomeGallery - except the installing on node LTS. I just see other js projects replacing the node-unzipper lib to work again - see the references in ZJONSSON/node-unzipper#271.

If I face problems, I will raise PRs in gauge-js

Thank you for marking this PR as ReleaseCandidate! Great!

@xemle
Copy link
Contributor Author

xemle commented Jun 22, 2023

@haroon-sheikh now I have no clue why the changes lead to a failing PR

@haroon-sheikh
Copy link
Contributor

@xemle Should be green now. Please go ahead and bump the version to 1.5.1 (See https://github.com/getgauge/gauge/blob/master/CONTRIBUTING.md#bump-up-gauge-version)

Signed-off-by: Sebastian Felis <[email protected]>
@haroon-sheikh haroon-sheikh merged commit bdc0f73 into getgauge:master Jun 23, 2023
@xemle
Copy link
Contributor Author

xemle commented Jun 23, 2023

@haroon-sheikh thank you so much for approving this PR amd releasing 1.5.1. I will celebrate it this afternoon! Great

@haroon-sheikh
Copy link
Contributor

No worries! Let us know how it goes if it fixes the problem for you.

@xemle
Copy link
Contributor Author

xemle commented Jun 23, 2023

The fix works. See my test logs. Before node 18.16.0 failed. Now with gauge 1.5.1 it works.

Thank you again

$ docker run -ti --rm node:18-alpine /bin/sh
/ # node --version
v18.16.0
/ # mkdir app
/ # cd app
/app # npm init -y
Wrote to /app/package.json:

{
  "name": "app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}


/app # npm i -D @getgauge/cli

added 2 packages, and audited 3 packages in 10s

found 0 vulnerabilities
npm notice
npm notice New minor version of npm available! 9.5.1 -> 9.7.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.7.2
npm notice Run npm install -g [email protected] to update!
npm notice
/app # npx gauge
Usage:
  gauge <command> [flags] [args]

Examples:
  gauge run specs/
  gauge run --parallel specs/

Commands:
  completion  Generate the autocompletion script for the specified shell
  config      Change global configurations
  daemon      Run as a daemon
  docs        Generate documentation using specified plugin
  format      Formats the specified spec files
  help        Help about any command
  init        Initialize project structure in the current directory
  install     Download and install plugin(s)
  list        List specifications, scenarios or tags for a gauge project
  man         Generate man pages
  run         Run specs
  template    Change template configurations
  uninstall   Uninstalls a plugin
  update      Updates a plugin
  validate    Check for validation and parse errors
  version     Print Gauge and plugin versions

Flags:
  -d, --dir string         Set the working directory for the current command, accepts a path relative to current directory (default ".")
  -h, --help               Help for gauge
  -l, --log-level string   Set level of logging to debug, info, warning, error or critical (default "info")
  -m, --machine-readable   Prints output in JSON format
  -v, --version            Print Gauge and plugin versions

Use "gauge [command] --help" for more information about a command.
Complete manual is available at https://manpage.gauge.org/.
/app # npx gauge -v
Gauge version: 1.5.1
Commit Hash: bdc0f73

Plugins
-------
No plugins found
Plugins can be installed with `gauge install {plugin-name}`
/app #

@xemle
Copy link
Contributor Author

xemle commented Jun 23, 2023

The same works for node 14 and 16. On node 20 the process hangs :'( . I will investigate it

@xemle
Copy link
Contributor Author

xemle commented Jun 27, 2023

Update: node 20 is still working. But it needs time since the requests of the download functions are not consumed. I will provide a patch to fix it.

@chadlwilson
Copy link
Contributor

I'm not sure what has changed, but recently when installing on MacOS any version after this change, the gauge binary doesn't seem to have executable bits set, and so fails.

This seemed to start failing on GHA in the last week, but I am a bit mystified about what has happened since this has been working up until recently with versions including gauge 1.6.7. May also be a Node 20.x change somewhere along the line perhaps, that has only recently git GHA runners.

Anyone have any ideas?

npm install -g @getgauge/[email protected] && ls -al /Users/chad/.local/share/mise/installs/node/20.16.0/lib/node_modules/@getgauge/cli/bin

drwxr-xr-x@ 4 chad  staff       128 Aug 14 11:16 .
drwxr-xr-x@ 8 chad  staff       256 Aug 14 11:16 ..
-rw-r--r--@ 1 chad  staff        25 Aug 14 11:16 DO_NOT_DELETE.txt
-rwxr-xr-x@ 1 chad  staff  20911906 Aug 14 11:16 gauge

vs

npm install -g @getgauge/[email protected] && ls -al /Users/chad/.local/share/mise/installs/node/20.16.0/lib/node_modules/@getgauge/cli/bin

drwxr-xr-x@ 4 chad  staff       128 Aug 14 11:16 .
drwxr-xr-x@ 8 chad  staff       256 Aug 14 11:16 ..
-rw-r--r--@ 1 chad  staff        25 Aug 14 11:16 DO_NOT_DELETE.txt
-rw-rw-rw-@ 1 chad  staff  20911906 Jun 23  2023 gauge

@zabil
Copy link
Member

zabil commented Aug 14, 2024

the gauge binary doesn't seem to have executable bits set, and so fails.

Interesting, I noticed build failures at
https://github.com/getgauge/taiko/actions/runs/10299522224/job/28507083148#step:6:37

This was resolved by checking in a package-lock json and I didn't investigate further. This might be the issue there as well.

@chadlwilson
Copy link
Contributor

Yeah the Linux installs have the same issue. The zip releases of gauge have the executable bits set correctly inside them so it's either the unzipping or something npm is doing that seems to have changed.

Myself locally and GoCD install gauge vis asdf plugin and the web installer script respectively so haven't seen this problem outside gauges own GHA action runs.

https://github.com/getgauge/gauge-lsp-tests/actions/runs/10380646369

@zabil
Copy link
Member

zabil commented Aug 14, 2024

Could be this

cthackers/adm-zip#530

As we use it at

AdmZip = require('adm-zip'),

@chadlwilson
Copy link
Contributor

Oh wow, I missed that despite looking at the adm-zip changelog - yes that would explain it. I guess adding your package lock would only have fixed it if you locked at an older version of the transitive dependency - unless you force downgraded it?

Hmm, I’ll release a fixed gauge version with a locked patch version until this is addressed, i suppose - and chase down that issue. Since the cli is intended to be installed globally it’s normally going to be used without a package lock.

@zabil
Copy link
Member

zabil commented Aug 14, 2024

if you locked at an older version of the transitive dependency - unless you force downgraded it?

Yeah, I checked the package lock for taiko which I checked in which says

git grep adm-zip                                                                      
package-lock.json:        "adm-zip": "^0.5.12"
package-lock.json:    "node_modules/adm-zip": {
package-lock.json:      "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.12.tgz",

So definitely a version issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

npm package @getgauge/cli broken (empty binary)
4 participants