Closed Bug 929572 Opened 11 years ago Closed 11 years ago

When building a customized grid into a build, if the grid isn't valid, report a build error

Categories

(Firefox OS Graveyard :: Gaia::Homescreen, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jsmith, Assigned: albert)

References

Details

(Whiteboard: [systemsfe])

Attachments

(1 file, 1 obsolete file)

363 bytes, text/html
yurenju
: review+
Details
Motivation - https://bugzilla.mozilla.org/show_bug.cgi?id=927973#c7

We need to fire build errors in the case when the homescreen grid isn't valid in a customization given in a distribution directory.
Whiteboard: [systemsfe]
Can you take a look at this, Albert?
Assignee: nobody → acperez
Attached file Patch (obsolete) —
Attachment #821705 - Flags: review?(yurenju.mozilla)
There is an important thing to keep in mind, is not possible to know at build time the max number of applications that can be accommodated per screen. Apps per screen is a dynamic value, at a runtime apps per screen is fixed to 16 in normal devices, 15 in tablets and then, depending on the scree size, it can be incremented. For this reason the patch will launch a warning is one screen has more than 16 apps but an exception.
Attachment #821705 - Flags: feedback?(salva)
For testing:
- Clone https://github.com/acperez/firefoxos-gaia-testsbuild
- Launch GAIA_DISTRIBUTION_DIR=/path/to/firefox-gaia-testsbuild make reset-gaia
Albert, 

John is rewriting variant.py in javascript on bug 921417 and I thought the progress is good to review in this week, so we should wait that commit landed and fix this issue in javascirpt version.

Is it okay to you?
Flags: needinfo?(acperez)
(In reply to Yuren Ju [:yurenju] from comment #5)
> Albert, 
> 
> John is rewriting variant.py in javascript on bug 921417 and I thought the
> progress is good to review in this week, so we should wait that commit
> landed and fix this issue in javascirpt version.
> 
> Is it okay to you?

Yes, it's fine
Flags: needinfo?(acperez)
Attachment #821705 - Flags: review?(yurenju.mozilla)
Attachment #821705 - Flags: feedback?(salva)
Assignee: acperez → nobody
Depends on: 921417
Assignee: nobody → acperez
Attached file Patch
Javascript version
Attachment #821705 - Attachment is obsolete: true
Attachment #827034 - Flags: review?(yurenju.mozilla)
Attachment #827034 - Flags: review?(johu)
Comment on attachment 827034 [details]
Patch

Thanks for this patch.

I give it r- because a logic error in the code which makes qa-test-case not pass, please find them in github.

There is another thing I am not sure: what should we do when app.location is too large and no more wildcard apps?? In this patch, we throw an error. But I feel in this kind of case, the homescreen will append this app at the last.
Attachment #827034 - Flags: review?(johu) → review-
(In reply to John Hu [:johnhu] from comment #8)
> There is another thing I am not sure: what should we do when app.location is
> too large and no more wildcard apps?? In this patch, we throw an error. But
> I feel in this kind of case, the homescreen will append this app at the last.
I think that was exactly the intent for this patch: to throw an error when the configuration specifies a grid that we cannot satisfy exactly, instead of just creating an approximated but incorrect (incorrect meaning not exactly the specified one) grid.

So when a grid is specified that would create gaps (ie, the location is too big) then we should fail, which is what this patch does. Flagging Jason just in case we understood the intent of the bug incorrectly.
Flags: needinfo?(jsmith)
Comment on attachment 827034 [details]
Patch

Changes from github comments
Attachment #827034 - Flags: review- → review?(johu)
(In reply to Antonio Manuel Amaya Calvo (:amac) from comment #9)
> (In reply to John Hu [:johnhu] from comment #8)
> > There is another thing I am not sure: what should we do when app.location is
> > too large and no more wildcard apps?? In this patch, we throw an error. But
> > I feel in this kind of case, the homescreen will append this app at the last.
> I think that was exactly the intent for this patch: to throw an error when
> the configuration specifies a grid that we cannot satisfy exactly, instead
> of just creating an approximated but incorrect (incorrect meaning not
> exactly the specified one) grid.
> 
> So when a grid is specified that would create gaps (ie, the location is too
> big) then we should fail, which is what this patch does. Flagging Jason just
> in case we understood the intent of the bug incorrectly.

Yup, that sounds right.
Flags: needinfo?(jsmith)
Comment on attachment 827034 [details]
Patch

Nice patch. I think it's ok to land. Please find my latest small suggestion in the github.
Attachment #827034 - Flags: review?(johu) → review+
Comment on attachment 827034 [details]
Patch

Albert, I left some comments on github, please set review flag to me again if you fix it.

the major issue is accessing init.json which may not exists if use variant.js in customization tool on bug 897325.
Attachment #827034 - Flags: review?(yurenju.mozilla)
Comment on attachment 827034 [details]
Patch

Changes from comment 13
Attachment #827034 - Flags: review+ → review?(yurenju.mozilla)
Comment on attachment 827034 [details]
Patch

Okay looks good, thank you!
Attachment #827034 - Flags: review?(yurenju.mozilla) → review+
don't forget remove that two more 'n' :)
(In reply to Yuren Ju [:yurenju] from comment #16)
> don't forget remove that two more 'n' :)

Ouch! I forgot the filename I was using for testing... fixed.

Thanks!
Master: https://github.com/mozilla-b2g/gaia/commit/de5b918f61a7823fbbdfa48b8bc3cbc1765dc2a4
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Depends on: 951450
Depends on: 952268
No longer depends on: 952268
Depends on: 980149
No longer depends on: 980149
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: