Skip to content

feat(sign): Linked the metadata docs in add-on submission errors - #3899

Open
aaronanish-t wants to merge 1 commit into
mozilla:masterfrom
aaronanish-t:improve-submission-error-hint
Open

aaronanish-t wants to merge 1 commit into
mozilla:masterfrom
aaronanish-t:improve-submission-error-hint

Conversation

@aaronanish-t

Copy link
Copy Markdown

Fixes #3636

When AMO rejects a submission with a 4xx (usually missing or invalid metadata, like the missing license in the issue), the error now ends with a hint pointing to the docs rpl linked in the issue. Server errors (5xx) are unchanged.

Example, for the error from the issue:

Submission failed (2): Bad Request
{
  "version": {
    "license": [
      "This field, or custom_license, is required for listed versions."
    ]
  }
}
The add-on metadata may be missing a required field or contain an invalid value. Pass metadata with --amo-metadata, see https://mozilla.github.io/addons-server/topics/api/addons.html#version-create and https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext/#sign-and-submit-for-publication

Changes:

  • fetchJson() takes an optional errorHint that's appended to 4xx errors.
  • doNewAddonSubmit() and doNewAddonOrVersionSubmit() pass SUBMISSION_ERROR_HINT.
  • Tests: the hint on 4xx for both submit paths, no hint on 5xx, and fetchJson() appending a hint.

tests/unit/test-util/test.submit-addon.js passes (68 tests). On Windows, the full unit suite has two failures in test.watcher.js, but they also fail intermittently on a clean master checkout, so they're unrelated.

@Rob--W, about the docs part of the issue (making it clear license is required): should that be a separate PR to the Extension Workshop repo?

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.

The error message is cryptic

1 participant