mozilla/web-ext

Use `web-ext sign` with a release notes

Closed this issue · 8 comments

laedit commented

Bug

What is the current behavior?

I use web-ext sign to upload and sign my addon and wanted to add the release notes to avoid having to add it manually afterward.
So I use the --use-submission-api and --amo-metadata parameters to indicate the following metadata file:

{
  "release_notes": {
    "en-US": " Changed\n\n- Upgrade dependencies: Typescript 4.9.5, web-ext 7.5.0, etc.\n- Add images to ReadMe\n\n Fixed\n\n- Options page width (#197)\n",
    "_default": "en-US"
  }
}

But the release notes of the created version are still empty, I had to manually add them.

Is it possible to add them on web-ext sign?

For reference the logs of the entire sign process:

2023-03-18T05:03:45.4465397Z $ /home/runner/work/new-tab-moment/new-tab-moment/node_modules/.bin/web-ext sign --api-key *** --api-secret *** --use-submission-api --channel=listed --source-dir build --amo-metadata ./version-metadata.json
2023-03-18T05:03:45.8436859Z Applying config file: ./package.json
2023-03-18T05:03:46.2628891Z Building web extension from /home/runner/work/new-tab-moment/new-tab-moment/build
2023-03-18T05:03:46.5185667Z Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/
2023-03-18T05:03:47.9481368Z Waiting for Validation...
2023-03-18T05:03:47.9492462Z Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/64277bfc0b79418fb679ee2d529aff7f/
[same fetching URL skipped]
2023-03-18T05:03:55.9974791Z Fetching URL: https://addons.mozilla.org/api/v5/addons/upload/64277bfc0b79418fb679ee2d529aff7f/
2023-03-18T05:03:56.3229850Z Validation results: {
2023-03-18T05:03:56.3234193Z   errors: 0,
2023-03-18T05:03:56.3235194Z   warnings: 1,
2023-03-18T05:03:56.3235980Z   notices: 0,
2023-03-18T05:03:56.3236478Z   success: true,
2023-03-18T05:03:56.3237286Z   compatibility_summary: { warnings: 0, errors: 0, notices: 0 },
2023-03-18T05:03:56.3237924Z   metadata: {
2023-03-18T05:03:56.3238437Z     listed: true,
2023-03-18T05:03:56.3238966Z     identified_files: {},
2023-03-18T05:03:56.3239999Z     id: 'new-tab-moment@laedit.net',
2023-03-18T05:03:56.3240606Z     manifestVersion: 3,
2023-03-18T05:03:56.3241258Z     name: 'New Tab - Moment',
2023-03-18T05:03:56.3241775Z     type: 1,
2023-03-18T05:03:56.3242359Z     version: '0.9.7',
2023-03-18T05:03:56.3243056Z     firefoxMinVersion: '109.0',
2023-03-18T05:03:56.3243652Z     experimentApiPaths: {},
2023-03-18T05:03:56.3244317Z     totalScannedFileSize: 32805,
2023-03-18T05:03:56.3244888Z     emptyFiles: [],
2023-03-18T05:03:56.3245581Z     jsLibs: {},
2023-03-18T05:03:56.3246131Z     unknownMinifiedFiles: []
2023-03-18T05:03:56.3246673Z   },
2023-03-18T05:03:56.3247135Z   messages: [
2023-03-18T05:03:56.3247586Z     {
2023-03-18T05:03:56.3248024Z       tier: 1,
2023-03-18T05:03:56.3248604Z       type: 'warning',
2023-03-18T05:03:56.3249103Z       id: [Array],
2023-03-18T05:03:56.3249905Z       message: 'Manifest V3 compatibility warning',
2023-03-18T05:03:56.3250532Z       description: [Array],
2023-03-18T05:03:56.3251168Z       compatibility_type: null,
2023-03-18T05:03:56.3251704Z       extra: true
2023-03-18T05:03:56.3252163Z     }
2023-03-18T05:03:56.3252586Z   ],
2023-03-18T05:03:56.3253042Z   message_tree: {},
2023-03-18T05:03:56.3253539Z   ending_tier: 5
2023-03-18T05:03:56.3254050Z }
2023-03-18T05:03:56.3258343Z Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/new-tab-moment@laedit.net/
2023-03-18T05:03:57.3477619Z Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/new-tab-moment@laedit.net/versions/?filter=all_with_unlisted
2023-03-18T05:03:57.6142456Z Waiting for Approval...
2023-03-18T05:03:57.6149533Z Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/new-tab-moment@laedit.net/versions/5540970/
[same fetching URL skipped]
2023-03-18T05:05:28.6037320Z Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/new-tab-moment@laedit.net/versions/5540970/
2023-03-18T05:05:28.7497326Z Fetching URL: https://addons.mozilla.org/firefox/downloads/file/4085313/new_tab_moment-0.9.7.xpi
2023-03-18T05:05:28.9317301Z Done in 103.53s.

What is the expected or desired behavior?

Release notes are associated to the created version.

Version information (for bug reports)

  • Firefox version: 112.0b3 (64-bit)
  • Your OS and version: Windows 11 Pro N 22H2
  • node version: v18.15.0
  • npm version: 9.3.1
  • web-ext version: 7.5.0

@eviljeff could you please take a look?

I've not attempted to replicate, but from reading the issue:
release_notes is a per-version metadata unlike properties like the addon name, etc, so should be under version. e.g.

{
  "version": {
    "release_notes": {
      "en-US": " Changed\n\n- Upgrade dependencies: Typescript 4.9.5, web-ext 7.5.0, etc.\n- Add images to ReadMe\n\n Fixed\n\n- Options page width (#197)\n",
      "_default": "en-US"
    }
  }
}
laedit commented

Thanks, I will try that on my next version and keep you posted!
Did I miss a documentation where this information was?

The api is documented here: https://addons-server.readthedocs.io/en/latest/topics/api/addons.html#version-create-request and release_notes is a field under the version, but it's probably not obvious how you need to structure the JSON from the docs - especially in the web-ext docs themselves. (Even our QA team have missed the subtly between Addon and Version metadata before)

laedit commented

Yeah, I used this doc and failed to see that you have to use a version field.
Are all fields of the create version request needs to be in the version field?

Yeah, I used this doc and failed to see that you have to use a version field. Are all fields of the create version request needs to be in the version field?

Requests directly to to the create/update version endpoint don't need to use the version field; requests to addon create/update/patch do need to use the version field for version properties (to distinguish them from addon properties). web-ext only uses addon create and patch endpoints though, so you can keep the json in the metadata file the same.

laedit commented

Thanks for the explanation!

laedit commented

I have tried with a version field and it is working well:

{
  "version": {
    "release_notes": {
      "en-US": " Version 2.0"
    }
  }
}

The _default field was a misinterpretation of the documentation from me and it is not accepted.

Thanks again for the support!