Patches and pushes

  • Revision slug: Productization_guide/Patches_and_pushes
  • Revision title: Patches and pushes
  • Revision id: 364063
  • Created:
  • Creator: jbeatty
  • Is current revision? No
  • Comment

Revision Content

Now that you've made your productization selections, you may be interested in learning the technical aspects behing productization by creating a productization patch. Below you'll find instructions on creating a patch and pushing it to your repository.

Patchify

  1. Search plugins are found in browser/searchplugins. Each plugin is stored as an XML file, with list.txt containing the names of each plugin.

Here is an example search plugin file using French Yahoo.

<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
<ShortName>Yahoo</ShortName>
<Description>Yahoo Search</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16">data:image/x-icon;base64,R0lGODlhEAAQAJECAP8AAAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIplI+py+0NogQuyBDEnEd2kHkfFWUamEzmpZSfmaIHPHrRguUm/fT+UwAAOw==</Image>
***This tag is optional***<Url type="application/x-suggestions+json" method="GET"
     template="http://ff.search.yahoo.com/gossip?output=fxjson&amp;command={searchTerms}" />***
<Url type="text/html" method="GET" template="http://search.yahoo.com/search">
  <Param name="p" value="{searchTerms}"/>
  <Param name="ei" value="UTF-8"/>

  <MozParam name="fr" condition="pref" pref="yahoo-fr" />
</Url>
<SearchForm>http://search.yahoo.com/</SearchForm>
</SearchPlugin>

 

  1. Create XML files for each search plugin preference following the above example. For reference on how each tag functions, visit the OpenSearch wiki page and the MozSearch wiki page. The pages are old (I mean, Firefox 2???), but still accurate.
  2. Each plugin has an icon image which is linked within the XML file as an URI ID. Upload your plugins icon image to Data Kitchen to obtain its URI ID and add to the XML file within the Image tag.
  3. In list.txt, add the search plugin's XML filename (without extensions) on a new line and save. Note that if your team selects a local version of an already default plugin (e.g., Wikipedia), the XML filename should include the locale code (e.g., Wikipedia-es)
  4. Create a patch of the searchplugins directory by entering the following command in your command-line tool, where mypatch.diff is where you give your patch a name.
$ hg add mozilla/browser/searchplugins/
$ hg diff mozilla/browser/searchplugins/ > mypatch.diff
  1. Attach your patch file to the bug by clicking the "Add an attachment" link. Once attached and labeled as a patch, open the attachment details.
  2. In the attachment details, select the ? from the dropdown menu next to the review flag. This will display a text box to assign the review to someone.
  3. Enter :Milos as the Requestee.

Review, commit, & land

  1. Address any review comments made by the reviewees and update the patch until it receives an r+ rating.
  2. If the r+ is "with nits" (i.e., that's short for nit-picky requests), fix those before committing. Also, no new patch attachment will be needed.
  3. Commit the patch to your Aurora repo.
    1. Only commit the changes you have reviewed.
    2. Use a commit message that mentions the bug number, describes the change, and mentions the reviewer. For example:
hg ci -m "bug 654321, copied the comment from the doc without reading, r=nobody" path-to-changed-files
  1.  Close the bug, with copying the url to your change in the closing comment. Write up something like this for your comment:
Landed this on aurora, http://hg.mozilla.org/releases/l10n/mozilla-aurora/ab-CD/rev/adfe1234feac, marking FIXED.
  1. Update your sign-offs on the l10n dashboard to include the change into the next release.

And that's it! It can be considered a bit complicated at first, but after you do it the first time, it gets easier and easier after that :-)

Revision Source

<p>Now that you've made your productization selections, you may be interested in learning the technical aspects behing productization by creating a productization patch. Below you'll find instructions on creating a patch and pushing it to your repository.</p>
<h2 class="bz_comment_text" id="Patchify">Patchify</h2>
<ol>
  <li class="bz_comment_text">Search plugins are found in <code>browser/searchplugins</code>. Each plugin is stored as an XML file, with <code>list.txt</code> containing the names of each plugin.</li>
</ol>
<p class="bz_comment_text" style="margin-left: 40px;">Here is an example search plugin file using French Yahoo.</p>
<pre style="margin-left: 40px;">
&lt;SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/"&gt;
&lt;ShortName&gt;Yahoo&lt;/ShortName&gt;
&lt;Description&gt;Yahoo Search&lt;/Description&gt;
&lt;InputEncoding&gt;UTF-8&lt;/InputEncoding&gt;
&lt;Image width="16" height="16"&gt;data:image/x-icon;base64,R0lGODlhEAAQAJECAP8AAAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIplI+py+0NogQuyBDEnEd2kHkfFWUamEzmpZSfmaIHPHrRguUm/fT+UwAAOw==&lt;/Image&gt;
***This tag is optional***&lt;Url type="application/x-suggestions+json" method="GET"
     template="http://ff.search.yahoo.com/gossip?output=fxjson&amp;amp;command={searchTerms}" /&gt;***
&lt;Url type="text/html" method="GET" template="http://search.yahoo.com/search"&gt;
  &lt;Param name="p" value="{searchTerms}"/&gt;
  &lt;Param name="ei" value="UTF-8"/&gt;

  &lt;MozParam name="fr" condition="pref" pref="yahoo-fr" /&gt;
&lt;/Url&gt;
&lt;SearchForm&gt;http://search.yahoo.com/&lt;/SearchForm&gt;
&lt;/SearchPlugin&gt;
</pre>
<p>&nbsp;</p>
<ol start="2" style="margin-left: 40px;">
  <li class="bz_comment_text">Create XML files for each search plugin preference following the above example. For reference on how each tag functions, visit the <a href="/en/Creating_OpenSearch_plugins_for_Firefox" title="https://developer.mozilla.org/en/Creating_OpenSearch_plugins_for_Firefox">OpenSearch wiki page</a> and the <a href="/en/Creating_MozSearch_plugins" title="https://developer.mozilla.org/en/Creating_MozSearch_plugins">MozSearch wiki page</a>. The pages are old (I mean, Firefox 2???), but still accurate.</li>
  <li class="bz_comment_text">Each plugin has an icon image which is linked within the XML file as an URI ID. Upload your plugins icon image to Data Kitchen to obtain its URI ID and add to the XML file within the Image tag.</li>
  <li class="bz_comment_text">In <code>list.txt</code>, add the search plugin's XML filename (without extensions) on a new line and save. Note that if your team selects a local version of an already default plugin (e.g., Wikipedia), the XML filename should include the locale code (e.g., Wikipedia-es)</li>
  <li class="bz_comment_text">Create a patch of the searchplugins directory by entering the following command in your command-line tool, where <code>mypatch.diff</code> is where you give your patch a name.</li>
</ol>
<pre class="eval" style="margin-left: 40px;">
$ hg add mozilla/browser/searchplugins/
$ hg diff mozilla/browser/searchplugins/ &gt; mypatch.diff
</pre>
<ol start="5" style="margin-left: 40px;">
  <li class="bz_comment_text">Attach your patch file to the bug by clicking the "Add an attachment" link. Once attached and labeled as a patch, open the attachment details.</li>
  <li class="bz_comment_text">In the attachment details, select the <strong>?</strong> from the dropdown menu next to the&nbsp;review flag. This will display a text box to assign the review to someone.</li>
  <li class="bz_comment_text">Enter <strong>:Milos</strong> as the <strong>Requestee</strong>.</li>
</ol>
<h3 class="bz_comment_text" id="Review.2C_commit.2C_.26_land">Review, commit, &amp; land</h3>
<ol>
  <li class="bz_comment_text">Address any review comments made by the reviewees and update the patch until it receives an <strong>r+</strong> rating.</li>
  <li class="bz_comment_text">If the <strong>r+</strong> is "with nits" (i.e., that's short for nit-picky requests), fix those before committing. Also, no new patch attachment will be needed.</li>
  <li class="bz_comment_text">Commit the patch to your <strong>Aurora</strong> repo.
    <ol>
      <li class="bz_comment_text">Only commit the changes you have reviewed.</li>
      <li class="bz_comment_text">Use a commit message that mentions the bug number, describes the change, and mentions the reviewer. For example:</li>
    </ol>
  </li>
</ol>
<pre style="margin-left: 40px;">
hg ci -m "<span class="bz_closed"><a class="external" href="https://bugzilla.mozilla.org/show_bug.cgi?id=654321" title="RESOLVED DUPLICATE">bug 654321</a></span>, copied the comment from the doc without reading, r=nobody" path-to-changed-files
</pre>
<ol start="4">
  <li class="bz_comment_text">&nbsp;Close the bug, with copying the url to your change in the closing comment. Write up something like this for your comment:</li>
</ol>
<pre class="bz_comment_text" style="margin-left: 40px;">
Landed this on aurora, <a class="external" href="http://hg.mozilla.org/releases/l10n/mozilla-aurora/ab-CD/rev/adfe1234feac">http://hg.mozilla.org/releases/l10n/mozilla-aurora/ab-CD/rev/adfe1234feac</a>, marking FIXED.
</pre>
<ol start="5">
  <li class="bz_comment_text">Update your <a href="https://l10n.mozilla.org/teams/" title="https://l10n.mozilla.org/teams/">sign-offs on the l10n dashboard</a> to include the change into the next release.</li>
</ol>
<p class="bz_comment_text">And that's it! It can be considered a bit complicated at first, but after you do it the first time, it gets easier and easier after that :-)</p>
Revert to this revision