Mounir Lamouri's Blog

To content | To menu | To search

The HTML progress element in Firefox

First of all, the progress element is going to be available with the next version of Firefox and is already available in the Beta, Aurora and Nightly channels.

Progress element:
Your browser does not support the progress element!
Indeterminate progress element:
Your browser does not support the progress element!


According to the specifications, and as you might imagine, "the progress element represents the completion progress of a task"[1]. To specify this completion, you can set two attributes: value and max. Note that max will be considered as 1.0 when not specified. In addition, the progress element can be indeterminate to represent that something is happening but you can't evaluate the progress. To put the progress element in this state, you have to remove the value attribute.

 <!--
   1. Progress element at full capacity.
   2. Progress element at half capacity.
   3. Progress element at zero capacity.
   4. Indeterminate progress element.
 -->
 <progress value='1'></progress>
 <progress value='50' max='100'></progress>
 <progress value='0'></progress>
 <progress></progress>

In this article, I'm going to do an overview of this new element. If you want an exhaustive documentation, you should have a look at the specifications or the Mozilla Developer Network documentation.

Native rendering

Using the new form widgets for authors make their life easier, their code less complex and improve the semantic of their pages. But this also improve user experience and this mostly comes with the native rendering of those widgets.
Native rendering means when you will see a progress element on a website, except if the author ask otherwise, you will see a progress element exactly like one in a native application. That means, on MacOS X, you will see a blue bar on a grey background. On Windows Vista and 7, you will see a green bar with an animation. On Windows XP, you will see a green bar with chunks and on Linux/GTK, it will depends on your theme.
For the later, given that we are using your GTK engine/theme, if it is bugged, you might see mis-rendered progress elements. It's very unlikely [2] unless you are using obscure engine but that means that it's preferred to test with another engine/theme if the rendering seems buggy with GTK. It is sad that we have to deal with that kind of issues but that is the price to pay to have a native rendering. It might actually explain why no other browser seems to have a native rendering on Linux/GTK.

It goes without saying that, as usual, you can disable the native rendering with -moz-appearance: none; or by setting border or background CSS properties.

 <!--
   Native and non-native progress elements.
 -->
 <progress></progress>
 <progress style="-moz-appearance: none;"></progress>

How to style it?

Styling is one of the biggest unresolved issues of new form widgets. The progress element is quite simple but there are no specifications explaining how authors should style it so every browsers have their own ways.

::-moz-progress-bar pseudo-element

Basically, the progress element is two div's. You can access to the outer div by styling progress and to the inner one with ::-moz-progress-bar pseudo-element. However, even if you can style it as much as you might expect, you will not be able to change the width unless the progress element is indeterminate; the reasons are obvious.

 <style>
   progress { background-color: red; border: 1px solid black; }
   progress::-moz-progress-bar { background-color: blue; }
 </style>
 <progress value='0.5'></progress>

It's interesting to see that Webkit has two pseudo-elements instead of one [3] but I do not see which use case this is solving that a combination of padding, border and background wouldn't solve.
Unfortunately, I did not find any documentation about styling this element with Opera/Presto.

:indeterminate pseudo-class

As said in the introductory paragraph, progress elements can be indeterminate. It happens that there is already an :indeterminate pseudo-class for checkboxes so we thought it would be a good idea to allow you to select indeterminate progress elements in that state with this pseudo-class. We did request to add this to the specifications, it has been accepted and Webkit implemented it a few days ago.

 <style>
   progress:indeterminate {
     background-color: red; border: 1px solid black;
   }
   progress:indeterminate::-moz-progress-bar {
     background-color: white;
   }
 </style>
 <progress></progress>

Vertical progress bars

A few form widgets can be vertical [4]. Currently, the HTML specifications say that as soon as the dimension of the widget are vertical, the element should be shown as vertical. For a progress bar, that means that the bar should go from bottom to top instead of left to right (or right to left). Such a system would have required to add a :vertical pseudo-class but unfortunately, for complex reasons [5], it happened to be hardly implementable. So, we came with another system: if you want to request a form widget to be shown as vertical, you can set the -moz-orient CSS property to vertical. Then, the element will be rendered as requested even if the dimensions are not appropriate. Note that if you don't specify a size to the progress element and asks it to be vertical, the default dimensions will be vertical. Note also that you can use horizontal keyword as well as vertical.

 <style>
   progress { -moz-orient: vertical; }
 </style>
 <!--
   1. Vertical progress element.
   2. Vertical progress element with horizontal dimensions.
   3. Horizontal progress element.
 -->
 <progress value='0.5'></progress>
 <progress value='0.5' style="height: 1em; width: 10em;"></progress>
 <progress value='0.5' style="-moz-orient: horizontal;"></progress>

DISCLAIMER: the way we allow vertical progress bar is far from being stable (in the sens that it might change) and the current specifications are not even close to our implementation.

Feedback

Feedback is always welcome and can have a real impact at this state so if you think something should be done differently, send me an email. If you see a bug, feel free to report it.

Notes

[1] http://www.whatwg.org/specs/web-app...

[2] It's the case for at least the Equinox engine: https://bugzilla.mozilla.org/show_b...

[3] http://trac.webkit.org/wiki/Styling...]

[4] meter, progress and <input type='range'> if I recall correctly

[5] See the thread in www-style mailing list: http://lists.w3.org/Archives/Public...

Mozilla Tech Tour in Dakar

During the last week of April, I was part of a team from Mozilla that was in Dakar for a Mozilla Tech Tour of a few universities. The team was composed of Claire Corgnou, the volunteer behind Bonjour Mozilla, Vivien Nicolas, who works on Firefox Mobile front-end, Anthony Ricaud, web developer on mozilla.com and William Quiviger, who works for the User Engagement team.

For the week that we were in Dakar, we gave speeches in universities about Mozilla, who we are, what we stand for and how to contribute. Claire, as a member of WoMoz, gave a talk about the project. We also conducted two technical workshops: one about HTML5/CSS3 and one about the Add-on SDK. During these speeches and workshops, we had the chance to meet students from Epitech Senegal, ESTM, ESMT and ISI.

Our Mission

If we went to Dakar it's mostly thanks to Mouhamadou Moustapha Camara who put a lot of energy to have us come. When we arrived, he had planned everything, he was accompanying us everywhere and was doing his best to make sure everything went smoothly. But we should also thank William who really wants Mozilla to strengthen its community in Africa. Actually, Senegal is a very good place to begin with [1]: it is the leading country of West Africa in term of new technologies.

Our goal was to strengthen the Mozilla community in Senegal. For what we saw, in universities, student are really aware of FLOSS and the exceptional power it could have in Africa. They were really open-minded and had a real thirst for knowledge. However, even if they have a full access to information, the conditions in Dakar are really different from the ones we are used to. In Dakar, the power is very unstable and you can spend hours without power [2], the Internet connection isn't really fast even if it's one of the best of the region. These are two concrete issues and might be fixed soon.
Another issue is cultural and might take longer to fix. For what we saw students' English is very often weak and most of them had a hard time reading the Add-on SDK documentation. This is unfortunate because most of the technical documentation is in English. This is also a reminder that part of Mozilla's mission is to promote the free flow of ideas and information on the Internet and that implies localizing the information. So, we should translate the documentation of the Add-on SDK.

From now on, Camara is going to lead the Mozilla Senegal community. That means bringing people together who share Mozilla's vision and having them work together on different projects. In Senegal, people mostly speak French and Wolof and one project that seems to create a lot of excitement is to translate Firefox to Wolof. That would be amazing to have this done.

The Add-on SDK workshop

Vivien and I led a few Add-on SDK workshops. It probably was as instructive for us as for the students. First of all none of us was an Add-on SDK hacker before and we only chose to show this because it's a very good first technical step into the Mozilla technologies. In addition, it helped us to find some issues with how the Add-on SDK currently works. Vivien has to write a blog post about this but, in a nutshell, most students where using Windows and the Add-on SDK requires Python which is a pain to install in a Windows environment. The user is also required to use the command line and Windows users are usually not used to it. During the workshops we gave a quick course of Javascript then, we tried to show how to write a very simple extension. If time permitted, the students were able to write their own extensions and we tried to help them.
As I mentioned above, the idea behind showing how the Add-on SDK works was to help the students do the first step into the Mozilla technologies. One of our constraints was that the attendees were from freshmen to senior students and digging into mozilla-central code base or classic extensions might have been a bit frightening for the youngest. Being able to have a working extension made by themselves was also one of the goals: a lesson is much more motivating if you are able to produce something at the end of the day. Our hope was to motivate a few of them to write their own extensions after the workshop; and we know a few of them did.

I wrote two extensions for these workshops. The first of them is a simple URL shortener extension using TinyURL and is available here. I like this extension because it contains around 15 lines, it does something really useful, uses three different modules and is simple enough to understand it while reading it.
The second extension is probably less simple if you don't have enough HTML/CSS knowledge: it's an extension that allows the user to edit an image in a web page. I actually wrote it quickly (so it's not finished, patches accepted) while I thought I would not have an Internet connection to present the first extension. I should actually improve it a bit to be able to use Firefox as an image viewer/editing tool. It is available here.

Conclusion

The Tech Tour was concluded by an afternoon at the AUF who hosted a workshop, an install party and a few talks. The same evening we had an amazing Firefox 4 release party.
The day before leaving, we met the authorities in a meeting organized by Jokkolabs. During this meeting, we talked about how the open source and hybrid companies like Mozilla can be an economical model that might fit Senegal's needs, and more generally, African's ones. You can't completely change the mind of anyone in a couple of hours but I hope that, at our scale, we have been able to help them understand there are alternatives and these alternatives might be better for everyone.

Finally, I believe that what we did during this week is exactly what the Mozilla Manifesto is about and I really hope we will be able to do it again in the future!

You can found pictures of the Tech Tour on Flickr: http://www.flickr.com/groups/mozill...

Notes

[1] It's not exactly the first Mozilla tour in Africa but one of the first.

[2] This actually leads to an intolerable contrast between rich citizens who can afford a generator and others who can't.

Improving HTML5 Forms' user experience with :-moz-ui-invalid and :-moz-ui-valid pseudo-classes

As you might have noticed, with Firefox 4, we have introduced the form validation in the browser. You can have more information about what that means in a previous blog post. Because of the validation made by the browser, we needed to have a feedback to show users that a form element is currently invalid thus preventing users trying to submit a form while it contains errors.

I'm not a technical person, what should I remember?

At Mozilla, we want your experience with forms to be much better. Currently, the tools available to web authors are not powerful enough to do a good UI with simple code. If the tools are not good, we are going to see bad form UI's. Because forms are very important in your life on the web, we chose to create two tools to help web authors make your web experience better. If these tools are appreciated by web authors and accepted by other browser vendors, they might be integrated into the HTML specifications and be widely used.

Why these new pseudo-classes?

CSS3 specification comes with two pseudo-classes named :invalid and :valid which respectively match invalid and valid form elements in the document. During Firefox 4 beta process, we have introduced a default style to :invalid pseudo-class adding a red glow to all invalid form elements. Unfortunately, this was very bad for UX. The most obvious issue is that we were showing required element with a red glow as soon as the page was loaded thus moving user attention to them. Going from this issue, we thought it would be better to create two pseudo-classes with some UX rules. The goal was to provide a simple way for authors to style invalid and valid elements while following UX rules. These pseudo-classes are named :-moz-ui-invalid and :-moz-ui-valid. And :invalid no longer has a default style on Firefox 4 but :-moz-ui-invalid has one instead.

When are they applied?

To follow these rules, we had a look at this interesting article by Luke Wroblewski. Then I've been working with Alexander Limi, Jonas Sicking, Tantek Çelik and Justin Dolske and we have decided to focus on two issues: element being invalid when the page is loaded (the user attention is uselessly focused on those elements) and validity status being changed while you are typing (the user is distracted by the UI changes).

The former issue has been fixed with a simple rule: as long as the element's value hasn't been changed by the user, both pseudo-classes can't apply. Though, if the user tries to submit the form in an invalid state, the pseudo-classes will apply even if the value hasn't been changed. This is to make it clear for the user which elements are currently invalid and need to be fixed.
For the later issue, we do not want to distract the users while typing. So, when an element is focused as valid, if it was matching :-moz-ui-valid it will match it until the element is blurred even if the element becomes invalid. Though, to help the user make an element valid, if, when focused, an element is matching :-moz-ui-invalid, it will match :-moz-ui-valid or :-moz-ui-invalid depending of the validity while typing. In other words, we want to help the user to fix an invalid element but do not want to distract him while interacting with a valid one. For example, when you have to enter an email address, you will have to type "username" which isn't a valid email address but you actually wanted to type "username@domain.com" and this is a valid email address.

You can try it on the following text field. A green glow is when :-moz-ui-valid applies and a red one is when :-moz-ui-invalid applies. The text field is required and expect a valid email address. Firefox 4 is required.

Follows a deeper explanation of the algorithm for those who want to know the details. For more information, it's better to dig into the code.

To match :-moz-ui-invalid, all of the following conditions have to be true:

  1. The element is invalid;
  2. The element is not focused, or had either :-moz-ui-invalid applying before it was focused;
  3. The element has no form owner or its form owner doesn't have the novalidate attribute set;
  4. The element has already been modified or the user tried to submit the form owner while invalid.

There is one exception: if the element is invalid because of a custom error, the only conditions that have to be fulfilled in the condition number 3.

To match :-moz-ui-valid, all of the following conditions have to be true:

  1. The element is either valid or isn't allowed to have :-moz-ui-invalid applying 1;
  2. The element is not focused, or had either :-moz-ui-valid or :-moz-ui-invalid applying before it was focused;
  3. The element has no form owner or its form owner doesn't have the novalidate attribute set;
  4. The element has already been modified or the user tried to submit the form owner while invalid.

You can also have a look at the Mozilla Developer Network documentation: :-moz-ui-invalid and :-moz-ui-valid.

Examples

You can simply show a red glow when the element is invalid and a green one when it is valid:

 :-moz-ui-invalid {
   box-shadow: 0 0 1.5px 1px red;
   /* This is actually the default Firefox style. */
 }
 :-moz-ui-valid {
   box-shadow: 0 0 1.5px 1px green;
 }

You can also change an image positioned next to the form element:

 span.validator {
   width: 16px;
   height: 16px;
   display: inline-block;
   background-size: 100%, 100%;
 }
 :-moz-ui-valid + span {
   background-image: url("images/valid.png");
 }
 :-moz-ui-invalid + span {
   background-image: url("images/invalid.png");
 }

With the corresponding HTML code (for example):

 <input type='email'><span class='validator'>

Looking for feedback

We are looking for feedback from authors and implementors. As an author, you should keep in mind that this feature is experimental and could be removed and changed at any time. Though, we are looking for feedbacks and we encourage you to try it and tell us what should be tweaked. You can open a bug on bugzilla or send me an email. As implementors, we would love to see other implementations trying to fix that issue to be able to discuss a specification.

Get your try server builds from TinderboxPushlog

Last month, I've added a very simple feature that might help try servers users and even people who want to test try server builds. It's currently a pain to get try server builds when you didn't get the try server email with the URL. This URL isn't random or seriously complex, it's just quite long and it includes the pusher email address and the revision id.

From now, if you select a successful try server build, you will see a 'go to build directory' link just before the 'view briew log' link. A screenshot might be better than a complex description:
screenshot

I'm blogging about this so late because I realized that a lot of people didn't see this feature and were looking for something similar. I guess a post to planet is the best way to spread the news.

A few hacks for Tinderbox Pushlogs

A month ago, I've introduced a few new features in Tinderbox Pushlog and Ehsan threatened me to write a blog post about them, so I do.

My first contributions to Tinderbox Pushlog were two filters you had to pass in parameter in the URL[1]. In the mean time I thought of another filter: show only unstarred jobs to help people watching the tree (especially philor). I used this momentum to write a few other patches:

  • Show a UI to filter by pusher email or toggle unstarred jobs filter (you might have notice that between "Infrastructure" and "Timezone") ;
  • Click on a pusher name to filter his pushes (re-click to unfilter) ;
  • Add some keybings: U to toggle unstarred jobs filter, P and N to navigate between current unstarred failing jobs ;
  • Make all of this working with HTML5's PushState/PopState (aka History API) so you can copy/paste the URL to have the same filters applied (need Firefox 4+ for that feature).

I realize that the keybindings will not work with Vimperator but if you use this extension you might be used to that kind of annoyance and know the workarounds.

I hope these new features will make some people's life easier!

Notes

[1] See this blog post.

"Contributing to the Mozilla project" workshop debriefing

Two weeks ago, the 13th of November, Vivien Nicolas, Pascal Chevrel and I organized a workshop in the Paris office. The goal of the workshop was to meet people who want to contribute to the Mozilla project and help them. By contributions, we meant any kind of contributions, from beta testing, bug reporting, regression window to bug fixing.

Amongst the ten people who came, I mostly worked with two guys, Anas Husseini (Arabic translator of Firefox) and Emmanuel Gil Peyrot. Both of them were interested in contributing to the Mozilla's platform.
With Anas, I worked on bug 606491. He didn't seem really impressed by the code base and was quite quick. Unfortunately, he left soon and we hadn't enough time to update all the tests to reflect this change.
With Emmanuel, we worked on bug 606990 which is, as you can see RESOLVED FIXED. I'm glad this change has been approved and pushed and I hope Anas' patch will be very soon.

I've also spoken a lot with Jérémie Patonnier about HTML5 Forms. It's always very instructive to speak with webdevs about concrete use cases and needs they have.

Finally, the workshop went very well with a good atmosphere and I hope we will be able to repeat that again later. If there are two things we should improve it's being more prepared because it was a bit hard at some point to help all these people with only the three of us. Also, for the platform contributions, having a few computers ready with an up-to-date and compiled tree would be better given that these steps took a very long time.

HTML5 Forms Validation in Firefox 4

HTML5 Forms specifications introduce some new input types, attributes and other awesome features. One of the transversal features is native browser-side form validation.
For Firefox 4, we tried to focus on that feature and ship it as complete as possible. All following features descriptions are available with Firefox 4 beta 7 except some which are going to be available in following betas (it's clearly specified when that's the case).

Why browser-side form validation?

The idea behind form validation in HTML5 Forms is to prevent using JavaScript to check basic stuff in your forms: Is this email address valid? Is this field filled in? Do passwords match? These are often checked in JavaScript when you click on the submit button. You might write your own javascript code or use a library but that will always be a repetitive, boring and error-prone task. With forms validated by the browser, you no longer have to care about those steps, just write simple HTML.
For the user, the validation being done by the browser is a guarantee of quality with better accessibility and consistency.

How can I make my form using this feature?

If you use new attributes related to form validation or new input types with internal validation, you will automatically opt in for form validation by the browser (if supported by the browser). All new input types introduced with HTML5 forms except search and tel benefit from internal validation.
Firefox 4 is going to support email and url and the validation will check if the value is a valid email or url respectively.
In addition, these attributes will provide an automatic validation mechanism:

  • required: a required form control will be invalid if its value is empty. This is working for <input> and <textarea>. If set on a <input type='checkbox'>, the element will have to be checked. On a group of <input type='radio'>, one of the radio button will have to be selected. If set on a <input type='file'>, a file will have to be selected.

<select> will accept the required attribute in Firefox beta 8 (see What's next?).

<input required>
<textarea required></textarea>
  • pattern: you can specify a regular expression [1] to check the element's value. This can be used only on some <input> types (text, search, tel, email and url). When you use pattern, it's highly recommended to use the title attribute to describe the pattern.
<input type='tel' pattern='\d\d \d\d \d\d \d\d \d\d' title="Write a phone number in the format 'XX XX XX XX XX'">
<input type='email' pattern=".*@company\.com" title="Enter you company email address">
  • maxlength: maxlength can already be used with Firefox 3.6 but it will only block the keyboard inputs made by the users on an <input> so they can't type more characters than the value specified in the maxlength attribute. In Firefox 4 beta 7, this applies on <textarea> too. In addition, if the value is set via .value, the element will become invalid if the new value has a length bigger than maxlength.
<input maxlength='10'>
<textarea maxlength='140'></textarea>

How can I opt out?

You should probably think about that twice, If you have your own system for form validation, you should probably try to disable it when the browser can manage form validation instead of disabling the validation by the browser for your own system. However, there might be other reasons why you would want to disable form validation. Good reasons might be if you want to use some new input types but you don't care about checking the validity.
The simplest way to opt out is to add the novalidate attribute to your <form>. You can also set formnovalidate on your submit controls. You should prefer formnovalidate than novalidate if you want to have one submit control with form validation and another without.
Detecting this feature is not really easy given that you want to have a message being shown but you can't know for sure if the browser is going to show something even if form validation seems to be supported. I will try to write another post about that later.

How can I specify my validity rules?

You can make an element invalid by calling .setCustomValidity(errorMsg). Doing some checks on oninput() and calling .setCustomValidity() should be enough in most situations.
.setCustomValidity() takes in parameter the error message. You can pass the empty string to .setCustomValidity() if you want to remove the custom error.
With this method, you can check that two password fields have the same value very easily:

 <script>
   function checkPassword(p1, p2)
   {
     if (p1.value != p2.value) {
       p2.setCustomValidity('passwords do not match');
     } else {
       p2.setCustomValidity('');
     }
   }
 </script>
 <input type='password' id='p1'>
 <input type='password' onfocus="checkPassword(document.getElementById('p1'), this);" oninput="checkPassword(document.getElementById('p1'), this);">

How can I change the text of the error message?

Each error types have a string associated describing the error. For example, if an input element is required and has no value, the message will be "Please fill out this field". Firefox will try to be as clever as possible to show the best error message but you might want to override it in some situations where the rules are very complex. For example:

<input type='email' required pattern='.*@company\.com'>

You might prefer to have a simple "Please, enter your corporate email address." instead of three generic messages depending of the unfulfilled constraint.
To help with that, we have introduced a non-standard x-moz-errormessage [2] which let you specify an error message for a given form control. Regardless of the error, if x-moz-errormessage is present and different from the empty string, its value will be used as the error message instead of the default one.
This is non-standard so it should be used carefully. See http://www.w3.org/Bugs/Public/show_.... In addition, you should know that .setCustomValidity() lets you indirectly set your own error message but we do not really like that because you will let the browser think that the element is suffering from a custom error even if it is not.

How can I change the error popup UI?

Unfortunately, there is no way to change the UI. The popup is part of the browser and it's currently not possible to style the browser from the content. This might change later but that will not be done for Firefox 4.
If you think the current popup is ugly, you should know it's not final. We will try to enhance that later, see bug 602500. All comments are very welcome!

New CSS pseudo-classes and default styles

CSS3 UI introduce new pseudo-classes that HTML5 is now using like :invalid, :valid, :required and :optional. Firefox 4 beta 7 supports all these pseudo-classes and adds a new pseudo-class: :-moz-submit-invalid which applies on submit controls when a form has an invalid element.
:invalid has a default style which is a red box-shadow. This default style is going to be removed when :-moz-ui-invalid will be added (see What's next?). In the mean time, you can easily remove this default style in your stylesheets:

 :invalid {  
   box-shadow: none;  
 }

What's next?

It's a bit early to say what will be done after Firefox 4 but we already know that a few things will be done in the following betas:

  • required attribute for <select>. You will be able to specify that a select element is required. This rule will be fulfilled if you select at least one option which has a value different from the empty string. See bug 596511. This might be fixed for beta 8.
  • Let <output> being subject from constraint validation. Output elements are currently barred from constraint validation but it seems to be too restrictive and .setCustomValidity() might be useful in some situations. See bug 604673. This might be fixed for beta 8.
  • Adding :-moz-ui-invalid and maybe -moz-ui-valid pseudo-classes. :invalid and :valid pseudo-classes are very bad for UI and UX perspectives. We want to introduce new pseudo-classes which would follow some UX rules. This will probably be the subject of a future blog post. Related bugs: bug 605124 and bug 605125.

Notes

[1] The regular expression will follow the JavaScript regular expression rules and will be checked against the entire element's value.

[2] The prefix is the new recommendation, see http://www.w3.org/Bugs/Public/show_....

Atelier "Contribuer à Mozilla", samedi 13 novembre

Samedi 13 novembre, le week-end après l'Ubuntu Party de Paris, Mozilla (Paris) va organiser un atelier pour les personnes souhaitant contribuer au projet Mozilla. Conscient de la difficulté que peuvent rencontrer les personnes souhaitant contribuer, nous voulons prendre le temps de discuter des différents types de contributions mais surtout de réellement passer le cap. L'atelier se deroulera sur une journée entière afin d'être sûr que vous repartiez avec des résultats concrets.

Nous serons trois personnes pour vous accompagner durant cette journée : Pascal Chevrel, responsable de l'internationalisation des sites web de Mozilla, Vivien Nicolas, développeur pour l'interface utilisateur de Firefox Mobile (Fennec) et moi-même, développeur plateforme (Gecko).

Etant donné que nous serons deux développeurs, ce pourrait être une bonne occasion d'écrire votre premier patch pour le projet Mozilla. Bien entendu, l'atelier est ouvert aux non-techniciens.

Plus d'informations et inscriptions : http://www.mozfr.org/wiki/doku.php?...

Filter TinderboxPushLog by pusher or revision id

I wrote two small patches [1] that let you filter tinderboxpushlog with the pusher or the revision id. This is available in http://tests.themasta.com/tinderbox... since a few days.

So, now, you can specify these new arguments in tinderboxpushlog URL:

pusher=<pusher_email_address> - filter pushes to show those done by the given user.
rev=<12_rev_id_chars> - filter pushes to show the one containing the given revision id.

For example, this URL will only show the push containing the revision id 071d28940876: http://tests.themasta.com/tinderbox....

The main use case of that feature is to make tinderboxpushlog more friendly when trying to look at a push on the try server: you can avoid the noise made by other pushes.
Unfortunately. rev doesn't try to search the given revision id and you will have to browse the pushes until one appears.

If someone wants to add a UI for this feature, have a look at bug 576544.

Notes

[1] bug 549275 and bug 598556

A script to get tinderbox logs without going to the web interface

The new try server is really cool but it is still a real pain to get the tinderbox logs when you have warnings or failures. Except if I am missing something, the way to do it is to grep your rev id in the web interface then manually open every log you need.
There is some work in progress to fix that and send the build log URL in the email so it can be more straightforward (bug 511749) but until then, we have to suffer...

I really think these kind of repeating boring tasks should be avoided all the more for a software engineer so today, while waiting for a compilation, I tried to write a python script to grep the build log URL's for me. Surprisingly, it works.
The script fetches the tinderbox web interface HTML page (for MozillaTry only, at the moment) and tries to find with a plain and simple heuristic where the build logs corresponding to your rev id are.

The script has been tested with python 2.6 and python 3.1 and requires lxml python library (for parsing).

You can download it here:
http://people.mozilla.org/~mlamouri...

Let me know if it helps (or if you find bugs) !

- page 1 of 2

Thème Time Flies par David Yim