Skip to content

Commit

Permalink
handle bad summary for add-ons (#35)
Browse files Browse the repository at this point in the history
An add-on submission failed due the manifest not containing expected keys.

submission: [Submit add-on]:  addon-datastore#2470
job failure: https://github.com/nvaccess/addon-datastore/actions/runs/7816410786/job/21321868676
Instead an error message should be posted
  • Loading branch information
seanbudd authored Feb 9, 2024
1 parent 310b768 commit bb3aaa7
Showing 1 changed file with 24 additions and 19 deletions.
43 changes: 24 additions & 19 deletions _validate/createJson.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,30 @@ def _createDictMatchingJsonSchema(
except ValueError:
manifest._errors = f"Manifest version invalid {addonVersionNumber}"
raise
addonData = {
"addonId": manifest["name"],
"displayName": manifest["summary"],
"URL": url,
"description": manifest["description"],
"sha256": sha,
"addonVersionName": manifest["version"],
"addonVersionNumber": dataclasses.asdict(addonVersionNumber),
"minNVDAVersion": dataclasses.asdict(
MajorMinorPatch(*manifest["minimumNVDAVersion"])
),
"lastTestedVersion": dataclasses.asdict(
MajorMinorPatch(*manifest["lastTestedNVDAVersion"])
),
"channel": channel,
"publisher": publisher,
"sourceURL": sourceUrl,
"license": licenseName,
}

try:
addonData = {
"addonId": manifest["name"],
"displayName": manifest["summary"],
"URL": url,
"description": manifest["description"],
"sha256": sha,
"addonVersionName": manifest["version"],
"addonVersionNumber": dataclasses.asdict(addonVersionNumber),
"minNVDAVersion": dataclasses.asdict(
MajorMinorPatch(*manifest["minimumNVDAVersion"])
),
"lastTestedVersion": dataclasses.asdict(
MajorMinorPatch(*manifest["lastTestedNVDAVersion"])
),
"channel": channel,
"publisher": publisher,
"sourceURL": sourceUrl,
"license": licenseName,
}
except KeyError as e:
manifest._errors = f"Manifest missing required key '{e.args[0]}'."
raise

# Add optional fields
homepage = manifest.get("url")
Expand Down

0 comments on commit bb3aaa7

Please sign in to comment.