mozilla / web-ext

A command line tool to help build, run, and test web extensions
Mozilla Public License 2.0
2.68k stars 334 forks source link

`WEB_EXT_API_APPROVAL_TIMEOUT` environment variable not respected #3238

Open AprilSylph opened 1 week ago

AprilSylph commented 1 week ago

Is this a feature request or a bug?

Bug

What is the current behavior?

If WEB_EXT_API_APPROVAL_TIMEOUT is set to 0, the value is ignored and web-ext sign still waits for approval using the default timeout (15 minutes). Other values not tested; possibly just an issue with 0.

Other WEB_EXT_* environment variables are working as expected.

https://github.com/AprilSylph/XKit-Rewritten/actions/runs/10672659889/job/29580508044

Run npx web-ext sign
  npx web-ext sign
  shell: /usr/bin/bash -e {0}
  env:
    WEB_EXT_API_KEY: ***
    WEB_EXT_API_SECRET: ***
    WEB_EXT_API_APPROVAL_TIMEOUT: 0
    WEB_EXT_CHANNEL: listed
Building web extension from /home/runner/work/XKit-Rewritten/XKit-Rewritten/src
Waiting for validation...
Waiting for approval...

WebExtError: Approval: timeout exceeded. When approved the signed XPI file can be downloaded from https://addons.mozilla.org/en-US/developers/addon/xkit-rewritten/versions/5802334
    at file:///home/runner/work/XKit-Rewritten/XKit-Rewritten/node_modules/web-ext/lib/cmd/sign.js:101:13
    at async Program.execute (file:///home/runner/work/XKit-Rewritten/XKit-Rewritten/node_modules/web-ext/lib/program.js:270:7)
    at async file:///home/runner/work/XKit-Rewritten/XKit-Rewritten/node_modules/web-ext/bin/web-ext.js:13:1

Error: Process completed with exit code 1.

What is the expected or desired behavior?

https://extensionworkshop.com/documentation/develop/web-ext-command-reference/#approval-timeout

Set to 0 to disable the wait for approval. [...] Environment variable: $WEB_EXT_API_APPROVAL_TIMEOUT

Version information (for bug reports)

  Ubuntu
  22.04.4
  LTS
  node: v20.17.0
  npm: 10.8.2
  yarn: 1.22.22
willdurand commented 1 week ago

Is it working with the CLI option?

AprilSylph commented 1 week ago

Looking at other projects (example: Workflow / Run), --approval-timeout=0 does seem to be working.

I've adjusted my workflow file to use the CLI option now, and I'll report back when it comes time for the next release of my addon.

Rob--W commented 2 days ago

Thanks for your report. The documentation was inaccurate. I have submitted a PR to fix it at https://github.com/mozilla/extension-workshop/pull/1944

To fix the issue, use WEB_EXT_APPROVAL_TIMEOUT instead.