Search code examples
firefox-addonweb-ext

How to use web-ext sign with a release notes


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.

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: '[email protected]',
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/[email protected]/
2023-03-18T05:03:57.3477619Z Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/[email protected]/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/[email protected]/versions/5540970/
[same fetching URL skipped]
2023-03-18T05:05:28.6037320Z Fetching URL: https://addons.mozilla.org/api/v5/addons/addon/[email protected]/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.

Solution

  • As explained in the github issue, since release_notes is a version property it needs to be passed in a version object, like this:

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

    And the _default property is not supported, it was a misinterpretation of the documentation, it is only returned from a GET request but never passed through a PUT, POST or PATCH request.