Closed Bug 739793 Opened 12 years ago Closed 12 years ago

allow passing previous version to post-upgrade homepage override URL

Categories

(Firefox :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 14
Tracking Status
firefox12 + fixed
firefox13 + fixed

People

(Reporter: Gavin, Assigned: Gavin)

References

Details

(Whiteboard: [qa-])

Attachments

(1 file, 1 obsolete file)

The goal is to make it possible to serve different content to users after upgrade, depending on which version they're upgrading from.
Attached patch patch (obsolete) — Splinter Review
This should work, it adds an %OLD_VERSION% parameter to the whatsnew URL. This is technically the Gecko version that was last run with this profile, but for the majority of users that's going to be the build that they updated from (this also has the benefit of working in cases where users upgrade outside of our update system, e.g. by downloading new builds manually).

The patch makes use of the new parameter by adding an "oldversion" param to the existing whatsnew URL, but we may need to adjust that depending on the needs of whoever will end up implementing the server side parts of this.
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Attachment #609904 - Flags: review?(mak77)
Comment on attachment 609904 [details] [diff] [review]
patch

>diff --git a/browser/branding/nightly/pref/firefox-branding.js b/browser/branding/nightly/pref/firefox-branding.js
>--- a/browser/branding/nightly/pref/firefox-branding.js
>+++ b/browser/branding/nightly/pref/firefox-branding.js
>@@ -1,9 +1,9 @@
>-pref("startup.homepage_override_url","http://www.mozilla.org/projects/%APP%/%VERSION%/whatsnew/");
>+pref("startup.homepage_override_url","http://www.mozilla.com/%LOCALE%/%APP%/%VERSION%/whatsnew/?oldversion=%OLD_VERSION%");

Was changing the path for nightlies intended here ?
Yes, I did that intentionally so that we could easily test the behavior.

(I wasn't sure why we still set the whatsnew URL in nightly branding, it seems like we should avoid doing it for the same reason we don't do it on Aurora. But it is useful for testing the functionality, I guess.)
Oh, the _path_ (and host). No, that was entirely unintentional. I'll fix it before landing!
Comment on attachment 609904 [details] [diff] [review]
patch

Review of attachment 609904 [details] [diff] [review]:
-----------------------------------------------------------------

apart what nthomas said:

::: browser/components/nsBrowserContentHandler.js
@@ +582,5 @@
>      var haveUpdateSession = false;
>      try {
> +      // Read the old value of homepage_override.mstone before
> +      // needHomepageOverride updates it.
> +      let old_mstone;

would be better to init this to an empty string or a special value?
As it is, this may end up asking for /whatsnew/?oldversion=undefined
is that expected by the server? Should at least be notified as a possible value to whoever manages that page.

@@ +611,5 @@
>              if (prefb.prefHasUserValue("app.update.postupdate"))
>                overridePage = getPostUpdateOverridePage(overridePage);
> +
> +            // Insert old_mstone into the URL
> +            overridePage = overridePage.replace("%OLD_VERSION%", old_mstone);

nit: the comment is not really useul, just saying what the code is.  Could either be removed or specify the reason we do this (comment 0 here is quite good).
Attachment #609904 - Flags: review?(mak77) → review+
(In reply to Marco Bonardo [:mak] from comment #5)
> would be better to init this to an empty string or a special value?
> As it is, this may end up asking for /whatsnew/?oldversion=undefined
> is that expected by the server? Should at least be notified as a possible
> value to whoever manages that page.

I'll use "", but it should be impossible for needHomePageOverride to return OVERRIDE_NEW_MSTONE if the value was empty/non-existent, so it shouldn't matter in practice.
(but that's not obvious, so you're right that it's better to be clear)
https://hg.mozilla.org/integration/mozilla-inbound/rev/ec441303e32e

We may want to backport this to aurora/beta so that we can be smarter in our next update prompts.
Target Milestone: --- → Firefox 14
https://hg.mozilla.org/mozilla-central/rev/ec441303e32e
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Let's move ahead with backporting this to Aurora 13 and Beta 12 in preparation for the 3.6->12 upgrade.
(In reply to Alex Keybl [:akeybl] from comment #10)
> Let's move ahead with backporting this to Aurora 13 and Beta 12 in
> preparation for the 3.6->12 upgrade.

We're actually waiting until after Thursday afternoon's meeting (and agreement on the URL we'll use) to land this.

One question while we wait though - what'd be the best way for QA to verify this fix before we first use it with our GA? Is creating a custom snippet to test internally our only option?
This can be tested on Nightly by installing a 13a1 build and updating it to 14a1. We can do the same on beta once this lands there.
Attached patch checked-in patchSplinter Review
We had the meeting on Thursday and decided that this parameter would be suitable. The snippets for update from 4+->12 should prevent the page from being opened entirely, so this may not even be technically required, but it's still useful in case that functionality ends up not working for some reason.
Attachment #609904 - Attachment is obsolete: true
Attachment #613014 - Flags: approval-mozilla-beta?
Attachment #613014 - Flags: approval-mozilla-aurora?
Bug 742998 covers the server-side work to have this change take effect.
Attachment #613014 - Flags: approval-mozilla-beta?
Attachment #613014 - Flags: approval-mozilla-beta+
Attachment #613014 - Flags: approval-mozilla-aurora?
Attachment #613014 - Flags: approval-mozilla-aurora+
Depends on: 743846
Blocks: 752716
No longer blocks: 752716
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: