Open Bug 1243516 Opened 8 years ago Updated 2 years ago

Convert our schema files to draft-04 of the JSON schema spec and update our validator

Categories

(WebExtensions :: General, defect, P3)

defect

Tracking

(Not tracked)

ASSIGNED

People

(Reporter: billm, Assigned: zombie)

References

(Depends on 1 open bug)

Details

(Keywords: DevAdvocacy, Whiteboard: validator [triaged])

See https://bugzilla.mozilla.org/show_bug.cgi?id=1225715#c15.

The main difference I can see is in how object properties are handled. In particular, we'll need to remove uses of "optional" from our schemas and instead add a "required" array at the object level.
It looks like the default value of "additionalProperties" being {} will be a serious issue as well. We'll have to add "additionalProperties": false to all our object types that don't already have an "additionalProperties" property.
Flags: blocking-webextensions?
Priority: -- → P2
Whiteboard: validator [triaged]
will block nativeJS when we do that
Flags: blocking-webextensions? → blocking-webextensions-
I think I'm going to wind up writing a script to do most of this.

I've been thinking about writing a utility to find the source locations of JSON paths for a while, and these changes would involve pretty much the same logic.

I'm not sure how soon I'll get around to this, so I'm assigning the bug to myself mostly so no-one decides to waste time doing it manually. That said, if someone *wants* to waste time doing it manually, feel free to take the bug.
Assignee: nobody → kmaglione+bmo
Component: WebExtensions: Untriaged → WebExtensions: General
Flags: blocking-webextensions-
Assignee: kmaglione+bmo → mstriemer
Keywords: DevAdvocacy
Any movement here?
Flags: needinfo?(mstriemer)
I'm currently importing them into the addons-linter with a script that updates the format. What are you looking for exactly?

They might not be great for re-use in their current form but we plan on bringing them into addons-server as well.
Flags: needinfo?(mstriemer) → needinfo?(thepotch)
I'm just looking for the addons-linter to be kept up-to-date with the capabilities from the m-c source of truth. This bug seems like it blocks https://github.com/mozilla/addons-linter/issues/765, but if addons-linter is already being updated to match mozilla-central regardless of the m-c schema version, than my needs are met.
Flags: needinfo?(thepotch)
The goal is to update the schemas on the way into addons-linter and then backport the reformatted files to mozilla-central at a later date.
addons-linter is now importing the schemas from Firefox and updating them to the JSON-schema spec [1].

This should be a good starting point for backporting the schemas to Firefox. Let me know if you want to work on this and we can discuss how the changes might affect Firefox's importing of the schemas.

[1] https://github.com/mozilla/addons-linter/tree/master/src/schema/imported
Assignee: mstriemer → nobody
Priority: P2 → P5
Assignee: nobody → tomica
Status: NEW → ASSIGNED
Product: Toolkit → WebExtensions
Maintaining the import script to rewrite the schema files used by Firefox into something ajv[1] can understand becomes more and more a burden. Some import runs are easy, others require touching big amounts of the import scripts.

It'd help a lot if we could simply copy them.

[1] https://github.com/epoberezkin/ajv
Priority: P5 → P2

:jimm would it be possible to get an idea of when a fix might be possible for this? It currently requires us to maintain a conversion to a more recent schema format on the AMO side.

Flags: needinfo?(jmathies)
Flags: needinfo?(jmathies)
Whiteboard: validator [triaged] → validator [triaged] webext?

We might need some significant changes to our schemas parsing and handling to support background service workers (bug 1573659), which we'll probably know more about after investigation in the next couple of weeks.

Depending on the needs there, this well either be folded into that work (to avoid rewriting things twice in a matter of months), or done independently.

Whiteboard: validator [triaged] webext? → validator [triaged]

Marking as depends on bug 1573659 to keep track of things, but will either block it or have no dependency after we revisit it.

Priority: P2 → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.