Closed Bug 862418 Opened 13 years ago Closed 13 years ago

make the build more strict with bad metadata.json files

Categories

(Firefox OS Graveyard :: Gaia, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(blocking-b2g:-, b2g18+ fixed, b2g18-v1.0.1 fixed)

RESOLVED FIXED
blocking-b2g -
Tracking Status
b2g18 + fixed
b2g18-v1.0.1 --- fixed

People

(Reporter: julienw, Assigned: julienw)

Details

(Whiteboard: u=fx-os-user c=may-6-17 p=1)

Attachments

(1 file, 2 obsolete files)

We found that in some partner customizatons (eg [1]) the metadata.json files are wrong. I'd like that we make the build stricter now so that we don't have strange builds later: - make the manifestURL property mandatory, and fail if this is missing. (instead of having a magic concatenation) - check that the origin is a real origin (ie: no path at the end). Investigate if we can infer this origin from the manifestURL. - issue a warning when the manifestURL is an "app://" url, because this makes the packaged app unupdatable (which is sometimes desirable). [1] https://github.com/telefonicaid/firefoxos-gaia-spain Asking tef+ on this because while it's npotb I want that our partners are aware of this, and I want to prioritize this.
blocking-b2g: --- → tef?
FWIW, I think this is a good idea to do for defect prevention, but I don't think a makefile protection in itself should block the release. But I definitely suggest going forward implementing this.
thank you Julien for telling me about origin incorrect things. I also filed bugs on telefonica repositories and gaia-preload-app for incorrect origin. https://github.com/yurenju/gaia-preload-app/issues/5 https://github.com/telefonicaid/firefoxos-gaia-spain/issues/2 https://github.com/telefonicaid/firefoxos-gaia-latam/issues/2
We won't block on this, but we'll track this so we get to this in future releases.
blocking-b2g: tef? → -
tracking-b2g18: --- → +
Fixed it on gaia-preload-app and I will make new version for telefonica repository on bug 864617.
Assignee: nobody → felash
another check we need to do : * check that we have a manifest.webapp
should we check etag in metadata.json?
(In reply to Yuren Ju [:yurenju] from comment #6) > should we check etag in metadata.json? I don't think. We don't want to do network access at build time.
Whiteboard: u=fx-os-user c=may-6-17 p=0
Whiteboard: u=fx-os-user c=may-6-17 p=0 → u=fx-os-user c=may-6-17 p=1
Attached patch patch v1 (obsolete) — Splinter Review
* be stricter about metadata.json data * fix the apps we have in the tree --- build/webapp-manifests.js | 91 +++++++++++++++++++------ test_external_apps/hoststubtest/metadata.json | 2 +- test_external_apps/mochitest/metadata.json | 3 +- 3 files changed, 75 insertions(+), 21 deletions(-)
Attachment #750509 - Flags: review?(fabrice)
Comment on attachment 750509 [details] [diff] [review] patch v1 Review of attachment 750509 [details] [diff] [review]: ----------------------------------------------------------------- Please use nsIURI for all the uri checks instead of string based manipulation.
Attachment #750509 - Flags: review?(fabrice) → review-
Attached patch patch v2 (obsolete) — Splinter Review
* be stricter about metadata.json data * fix the apps we have in the tree --- build/webapp-manifests.js | 95 ++++++++++++++++++++----- test_external_apps/hoststubtest/metadata.json | 2 +- test_external_apps/mochitest/metadata.json | 3 +- 3 files changed, 79 insertions(+), 21 deletions(-) Now uses nsIURI, thanks for the great suggestion.
Attachment #750509 - Attachment is obsolete: true
Attachment #751059 - Flags: review?(fabrice)
Comment on attachment 751059 [details] [diff] [review] patch v2 Review of attachment 751059 [details] [diff] [review]: ----------------------------------------------------------------- r=me with nits fixed. ::: build/webapp-manifests.js @@ +4,5 @@ > //dump('-*- webapp-manifest.js: ' + msg + '\n'); > } > > +let io = Components.classes['@mozilla.org/network/io-service;1'] > + .getService(Components.interfaces.nsIIOService); nit: s/Components.classes/Cc, and align .getService with ['@mozilla.org/network... @@ +135,5 @@ > + 'mandatory manifestURL property.'); > + return; > + } > + > + let manifestURLURI; very weird variable name. What about manifestURI ?
Comment on attachment 751059 [details] [diff] [review] patch v2 Review of attachment 751059 [details] [diff] [review]: ----------------------------------------------------------------- r=me with nits fixed. ::: build/webapp-manifests.js @@ +4,5 @@ > //dump('-*- webapp-manifest.js: ' + msg + '\n'); > } > > +let io = Components.classes['@mozilla.org/network/io-service;1'] > + .getService(Components.interfaces.nsIIOService); nit: s/Components.classes/Cc, and align .getService with ['@mozilla.org/network... @@ +135,5 @@ > + 'mandatory manifestURL property.'); > + return; > + } > + > + let manifestURLURI; very weird variable name. What about manifestURI ?
Attachment #751059 - Flags: review?(fabrice) → review+
Attached patch patch v3Splinter Review
fixed nits, carrying r=fabrice PR in https://github.com/mozilla-b2g/gaia/pull/9862 to see if Travis is happy
Attachment #751059 - Attachment is obsolete: true
Attachment #751347 - Flags: review+
master: 7d8f462d9402c306fa243c96c3d660a399128acc
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
a=npotb v1-train: 9380ceb81b3eac45861b8d1be07ab7f748ed52a3 v1.0.1: 62a6ed13e3e135e7183a1af2eef3b55f5ffb0378
No longer blocks: b2g-apps-v1-next
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: