<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mickaël Morier on Medium]]></title>
        <description><![CDATA[Stories by Mickaël Morier on Medium]]></description>
        <link>https://medium.com/@mickaelmorier?source=rss-a9b4c1b7acb0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-3FKB_ob3iHGvdd9sSkw_A.jpeg</url>
            <title>Stories by Mickaël Morier on Medium</title>
            <link>https://medium.com/@mickaelmorier?source=rss-a9b4c1b7acb0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 20:31:02 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mickaelmorier/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cross-platform end-to-end tests on mobile application with Detox]]></title>
            <link>https://medium.com/doctolib/cross-platform-end-to-end-tests-on-mobile-application-with-detox-6385e5881abc?source=rss-a9b4c1b7acb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/6385e5881abc</guid>
            <category><![CDATA[cross-platform]]></category>
            <category><![CDATA[mobile]]></category>
            <category><![CDATA[end-to-end-testing]]></category>
            <category><![CDATA[test]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Mickaël Morier]]></dc:creator>
            <pubDate>Fri, 02 Apr 2021 07:06:02 GMT</pubDate>
            <atom:updated>2021-04-02T07:06:02.948Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Illustration, a humanoid robot made test on a smartphone" src="https://cdn-images-1.medium.com/max/1024/1*5_gSHMSGGG8ZgbwQ_k7ijQ.png" /></figure><p>At Doctolib, we have more than 25,000 automated tests of which a large part are end-to-end ones. Our mobile applications are mainly a webview but <a href="https://medium.com/doctolib/why-we-chose-react-native-for-our-mobile-apps-f255687151fc">they are developed with React Native</a>. However, the patient application also has some native screens for the video consultation and some features that require native code.</p><p>Since the redesign of mobile applications with React Native in February 2018, we have added Jest unit tests for some utilities, but nothing to actually test native features without manually testing the applications. We strongly believe in the benefits of end-to-end testing at Doctolib, so there has always been a desire to have end-to-end tests on mobile applications, but technically it is not as simple and well-equipped as it is for the Web.</p><h3>Which testing framework?</h3><p>A first attempt was made in April 2019 with the <a href="https://appium.io/">Appium</a> but it was a failure. It was too complicated and too limited to set up locally as on our mobile Continuous Integration (CI). So we gave up as soon as the Proof-of-Concept was done.</p><p>A year went by and mobile end-to-end testing became a priority for the patient application. <a href="https://github.com/wix/Detox">Detox</a> seemed like a good candidate and was gaining popularity. It looked easy to write tests and to configure and implement it on a CI pipeline. Therefore I did some quick testing and was rapidly convinced. In a very short time I was able to write my first tests and have them working on the iOS simulator.</p><p>Another cool thing about Detox is we can easily launch our application from a push notification or configured with specific permissions (camera, location, etc.). This is a very useful feature in Doctolib cases, for example our telehealth diagnostic screen has different behavior according to camera or microphone permissions.</p><h3>How to test the application?</h3><p>The application is mainly a webview but it interacts with native features through events sent with Window.postMessage. As it is impossible to interact with its content, we created a React Native test screen to test the native features directly. This screen only exists in the staging and development builds.</p><figure><img alt="Test screen used by Detox to test native features of the patient application" src="https://cdn-images-1.medium.com/max/1024/1*PdZ1bvESn-dld7LsrPv0og.png" /><figcaption>Test screen used by Detox to test native features of the patient application</figcaption></figure><p>This basic screen is directly available by a button from the home screen of the application. Each button on the test screen triggers a native feature. These are used by Detox to run automated tests but it is also a convenient way for developers and product managers to do manual tests on real devices. Let’s see some examples.</p><h3>Testing native screens and OS permissions</h3><p>The video consultation on the mobile application is totally implemented with native code. So with Detox, it is easy to navigate through different screens and check the behavior with different permissions given to the application by the OS. As you can see in the following video, we navigate through a flow of diagnostic screens to check whether your phone is capable of doing a video consultation. This flow is tested with different permissions for camera and microphone.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F45CS6YE-Z5c&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D45CS6YE-Z5c&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/161f5dceede63786fcebbc3842081b0b/href">https://medium.com/media/161f5dceede63786fcebbc3842081b0b/href</a></iframe><p>Let’s look at the code of the first test executed in the video. It is pretty simple to write and to understand. It is just a sequence of unit commands to launch the application with specific permissions, to click on buttons and to assert whether certain text is visible or not.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bac542f1e66bc1a270c1100afa3e1fbb/href">https://medium.com/media/bac542f1e66bc1a270c1100afa3e1fbb/href</a></iframe><p>Detox is a cross-platform testing framework, so tests are executed on Android and iOS with the same code. But sometimes Detox does not have the same support on both platforms, or Android emulator and iOS simulator do not have the same capabilities. In that case you have to adapt your test with a condition on the OS.</p><p>The first test shows the difference between the capabilities of the simulators. The iOS Simulator does not have a battery state, so we check a message for low battery. On the Android emulator, we have the information so we just check that the message is not present.</p><p>The second test is not executed on Android due to a limitation of Detox on this platform. For the moment, it is not possible to change the battery permission on Android.</p><h3>Testing native features called from the webview</h3><p>As previously mentioned, several native features are launched from the webview containing the Doctolib website via postMessage. To test these features without piloting the content of the webview, each test button creates a blank webview that injects JavaScript to post the same message as a real message from the Doctolib website. So our webview component reacts to this message and calls the corresponding native feature like in the real application. If you watch the following video, you will see the webview created for each test below the buttons.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FfVNneXkk-Bs&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DfVNneXkk-Bs&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b51dfb6b011aa0ba76011486ac7bd58f/href">https://medium.com/media/b51dfb6b011aa0ba76011486ac7bd58f/href</a></iframe><p>Let’s look at the code of some tests executed in the video. Like the previous test code, it taps on buttons and checks if elements are present by testing their text or their id.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/14f47284da4027763df4a11b74e5223b/href">https://medium.com/media/14f47284da4027763df4a11b74e5223b/href</a></iframe><p>Here again we have some OS differences, so tests contain OS-specific code. Adding a calendar event on Android will open the Calendar application that is why we go back and check if we are returning to the test screen. On iOS it shows a modal over the screen, so we check if the test screen is not visible anymore. This is the only thing we can do because Detox can only pilot your application, not anything outside of it.</p><p>If you look at the last test, you will see we can assert text and tapping on buttons of the iOS sharing modal. This is a little hacky because we use the private UI class but it is possible.</p><h3>Continuous Integration with Bitrise</h3><p>As you can see in the previous videos, Detox tests are launched by simple shell commands. As a consequence, it was pretty easy to plug it to <a href="http://www.bitrise.io/">Bitrise</a>, our mobile CI. For each commit in a pull request or on master and production branches, tests are launched and applications are built. Detox tests are executed for Android and iOS patient apps. They are very stable and fast on the iOS Simulator as shown by the following screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rWcwEPV_VlGcPzm9ZV92SQ.png" /><figcaption>Detox end-to-end tests results on Bitrise</figcaption></figure><p>On the other hand, Detox tests are <a href="https://medium.com/doctolib/hunting-flaky-tests-at-doctolib-6686944ab426">flaky</a> on Android build due to the Bitrise Android emulator. They are stable when we run them on our respective machines but on Bitrise the emulator is not performing and reactive as well. Despite some adjustments on Bitrise, it happens regularly that a test fails because the emulator does not react to the tests.</p><p>This summer, I made an attempt with a <a href="https://www.genymotion.com/cloud/">Genymotion Cloud</a> emulator instead of the Bitrise one. It was stable but some tests failed because of the physical back button used in some tests which were not understood by Genymotion. Genymotion confirmed to me very recently that there was no problem with the latest version of Detox. So we’ll have to follow up.</p><h3>What’s next?</h3><p>These Detox tests are really a first step for Doctolib and many things can be improved. As I mentioned before, the Android emulator of Bitrise is not stable so the test suite is flaky. It might be possible to use Genymotion cloud to fix this. We also can imagine executing all these end-to-end tests on real devices.</p><p>For the moment, we only have Detox tests on the patient mobile application. The doctor application has some features which use native code and it will continue to grow, so having Detox tests for this app should improve non-regression and simplify upgrades.</p><p>And you, what is your experience about end-to-end tests on mobile applications?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6385e5881abc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/doctolib/cross-platform-end-to-end-tests-on-mobile-application-with-detox-6385e5881abc">Cross-platform end-to-end tests on mobile application with Detox</a> was originally published in <a href="https://medium.com/doctolib">Doctolib</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Optimize your images, do not let your users download big image for nothing]]></title>
            <link>https://medium.com/doctolib/optimize-your-images-do-not-let-your-users-download-big-image-for-nothing-d2fcd49b8845?source=rss-a9b4c1b7acb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2fcd49b8845</guid>
            <category><![CDATA[compression]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[image]]></category>
            <category><![CDATA[optimization]]></category>
            <dc:creator><![CDATA[Mickaël Morier]]></dc:creator>
            <pubDate>Fri, 05 Jun 2020 08:34:30 GMT</pubDate>
            <atom:updated>2020-06-05T09:02:31.304Z</atom:updated>
            <content:encoded><![CDATA[<h3>Optimize your images, do not let your users download big images for nothing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GvMK8cLywfAC5yYRc5Ghlw.png" /></figure><p>Images are a big part of what browsers need to download to display web pages.</p><p>Even though internet connections have become faster and faster, you do not always have a fast connection, especially when you are on a mobile device in a subway or in some other part of the globe.</p><p>And after all, even if your connection is fast, why download 2 MB for an image if you can have the same image by only downloading 100 KB? Be nice to polar bears, save bandwidth.</p><p>At Doctolib, we have static illustrations and a huge amount of photos uploaded by doctors to present their profile and their practice. Because two thirds of our patient website users are on a mobile device, image optimization is important for us. Let’s see how we do it.</p><h3>Static images</h3><p>Most of our static images are PNG illustrations and SVG icons, but we also have a few JPEG photos. These images are part of our codebase, so they can easily be optimized.</p><p>PNG and SVG are lossless data compression image formats but both can contain metadata like information about the software which produces the image, color profiles, element identifiers, comments, etc. Clearly this metadata is useless for your users and can be removed from the file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc5f1654366dc1329427e5b51a7cefad/href">https://medium.com/media/cc5f1654366dc1329427e5b51a7cefad/href</a></iframe><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ebd268386911c6c662832f52dda4b935/href">https://medium.com/media/ebd268386911c6c662832f52dda4b935/href</a></iframe><p>To do this optimization without SVG knowledge and risk of breaking something, we use <a href="https://imageoptim.com/mac">ImageOptim on macOS</a>. This is a free, open-source application which combines several optimizers. You just drag and drop your images into the window to have them optimized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RSxbikJ1sRLDLDX6LjDkiw.png" /><figcaption><em>More than 31% gain in average per image without loss</em></figcaption></figure><p>JPEGs can contain some visual details that are not visible to the human eye. So in addition to the metadata, the weight gain can be substantial. ImageOptim can do these optimizations but I prefer using <a href="https://www.jpegmini.com/">JPEG mini</a>, I found their compression algorithm impressive.</p><p>To avoid adding unoptimized SVG files to our codebase, we use <a href="https://github.com/svg/svgo">SVGO</a> which checks and lets developers optimize them with a command we’ve reduced to a simple `yarn optimize:svg`.</p><h3><strong>Dynamic images</strong></h3><p>Some images are uploaded by doctors, such as their profile picture. We do not have control over the quality, resolution and weight of these images. In addition, these profile pictures are displayed on several screens in very different sizes. They can be found in the search results for doctors as a thumbnail, on the doctor’s profile in a medium size or in its original size without transformation in a slideshow as shown in the following captures with <a href="https://fr.wikipedia.org/wiki/Dr_Manhattan">Dr Manhattan</a>, one of our doctors in the development environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*yvnsM02QjryII2N7RoDHjw.png" /><figcaption>Thumbnail in the doctor search bar</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*51Km_hzKkqiToB4_H4zfjA.png" /><figcaption>Medium-size in the doctor&#39;s profile</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*6zB6NtF8lvgAKVt_YeUIuQ.png" /><figcaption>Full-size when previous image is clicked</figcaption></figure><p>In this case, to optimize image size we use <a href="https://cloudinary.com/">Cloudinary</a> to make on-the-fly image transformations with a dynamic URL. We can crop, focus on the face of the doctor, scale to a resolution at specific pixel density, compress, change the format, etc.</p><p>The original image as you can see above is a 220x300 JPG image which weighs almost 19.59 KB and is used to display the small thumbnail in the search bar and the medium thumbnail in the profile page. After optimization, this image becomes two images that weigh 1.17 KB and 2.22 KB respectively on recent browsers. A reduction by around 16x and 9x. Pretty cool, no?</p><p>How was it reduced so much? Because we asked Cloudinary through an URL to:</p><ol><li>Scale down to 40x40 pixels with a <a href="https://en.wikipedia.org/wiki/Pixel_density">pixel density</a> of 2, so the final image dimensions are 80x80 pixels.</li><li>Compress the image to a visual quality acceptable for humans</li><li>Change the image format to <a href="https://en.wikipedia.org/wiki/WebP">WebP</a> because the browser of the user was compatible ( like Chrome, Edge, or Firefox)</li></ol><p><a href="https://res.cloudinary.com/doctolib/image/upload/q_auto:eco,f_auto,dpr_2/w_40,h_40,c_fill,g_face/ykjk4zogkkrjqywvsxl6">https://res.cloudinary.com/doctolib/image/upload/<strong>q_auto:eco</strong>,<strong>f_auto</strong>,<strong>dpr_2</strong>/<strong>w_40</strong>,<strong>h_40</strong>,c_fill,<strong>g_face</strong>/ykjk4zogkkrjqywvsxl6</a></p><p>To explain how it works, you can see parameters in the image URL:</p><ol><li><strong>q_auto:eco</strong> compresses the image</li><li><strong>f_auto</strong> outputs the image as WebP if possible. Cloudinary detects through the browser User-Agent that the request is made from Firefox which supports WebP.</li><li><strong>dpr_2</strong> doubles the image dimensions</li><li><strong>w_40,h_40</strong> crops to 40x40 pixels</li><li><strong>g_face</strong> focuses on the face</li></ol><h3><strong>What can still be improved</strong></h3><p>Some improvements can be done on <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio">devicePixelRatio</a> (DPR), whatever the quality of the screen, we always ask Cloudinary to give us a DPR of 2. It doubles the size of the image but it is necessary to have a sharp image on a smartphone or a computer with a Retina screen. But, not all users have this type of screen, so in some cases we can only transform the image and divide the image weight by 2. Because it concerns around 30% of our users and because these users are on desktop so with a stable Internet connection and it needs to change how we display images by using <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/picture">the Picture HTML element</a>, we have not made this improvement for the moment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2fcd49b8845" width="1" height="1" alt=""><hr><p><a href="https://medium.com/doctolib/optimize-your-images-do-not-let-your-users-download-big-image-for-nothing-d2fcd49b8845">Optimize your images, do not let your users download big image for nothing</a> was originally published in <a href="https://medium.com/doctolib">Doctolib</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why we chose React Native for our mobile apps]]></title>
            <link>https://medium.com/doctolib/why-we-chose-react-native-for-our-mobile-apps-f255687151fc?source=rss-a9b4c1b7acb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f255687151fc</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[mobile]]></category>
            <dc:creator><![CDATA[Mickaël Morier]]></dc:creator>
            <pubDate>Wed, 10 Oct 2018 08:12:51 GMT</pubDate>
            <atom:updated>2018-10-26T09:32:54.353Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wZ1RoFSi2qxGoxHxFHvnLQ.png" /><figcaption>© Illustrations par <a href="http://www.baileymcginn.com/">Bailey McGinn</a></figcaption></figure><p><strong>In the beginning</strong></p><p>Doctolib is primarily a web-based company; it is important to us to be able to publish when we want, for our users to have the latest version of our application, and ideally to use one code across all platforms.</p><p>In the beginning Doctolib was far from a household name; our traffic was driven by natural SEO. Users were not yet searching directly for Doctolib in app stores to book their appointments, but rather would use a search engine to look for “dentiste Paris” or “Dr. Zoidberg”. This delivered them to Doctolib, a mobile web page giving them the option to book an appointment online. As an alternative to marketing investment, the mobile website was crucial in order to increase our B2C traffic.</p><p>As the company grew so did its reputation as a reliable and valuable service. To further increase our visibility, we published Android and iOS applications during the summer of 2016 on the App Store and Play Store. This way we tapped into the audience of users who are more inclined to download an app rather than find information via a browser. At this time, Cordova was the easiest way for us to encapsulate our web app in a webview.</p><p>Today we have more users using our mobile device than those accessing the site on a desktop, and in the medical category on both the <a href="https://itunes.apple.com/fr/genre/id6020">App Store</a> and <a href="https://play.google.com/store/apps/category/MEDICAL/collection/topselling_free?hl=fr">Play Store</a> the Patient app is in first position. Though we never used any form of promotion, almost 17% of patient users now use native apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*aqamiuZ95LUwA8yKrQ2h0A.png" /><figcaption>Traffic sharing on <a href="http://www.doctolib.fr/">www.doctolib.fr</a> for September 2018</figcaption></figure><h3><strong>So, why we left Cordova</strong></h3><p>Each new release was an enormous amount of work. Cordova works pretty much like a black box; we don’t understand what’s going on and it is always complicated having an Android studio/Xcode project that builds with the right certificates.</p><p>A few months ago, we set the goal of reducing patient SMS reminders by using push notifications in order to reduce our SMS bill. The cost of sending an SMS is 3 cents whereas using a service like Firebase would allow us to send push notifications at zero cost. In order to do this, we needed more access to modify Android Studio/Xcode projects and some native classes, access that Cordova does not provide. Other native API features we plan to incorporate like Touch ID, Face ID etc. would also be difficult to develop using Cordova.</p><h3><strong>Why not native</strong></h3><p>At Doctolib, <a href="https://medium.com/doctolib-engineering/yagni-monolith-works-ac3ae879904">pragmatism reigns</a>. A native approach would involve three times the work (Android, iOS, Web) so as long as we can achieve the same end results we will always opt for the more pragmatic option in order to avoid writing and maintaining overcomplicated code. Additionally writing native code requires a knowledge of Android and iOS specific platforms and their respective languages (Java or Kotlin for Android, Objective C or Swift for iOS). Our developers would have to develop these native skills. At Doctolib we love the idea of full stack developers, so this point is important.</p><h3><strong>Why we chose React Native</strong></h3><p>At Doctolib, our front-end developers for both patient and doctors extensively use React. Our patient mobile web app is almost entirely built with React. It is easier for our developers to write code in React Native because React and React Native use the same principles and language.</p><p>Down the road we will even be able to share code between the web and the native apps. For instance, if we want to create an offline screen on mobile apps that display the patient’s upcoming appointments we can use the same code for its UI and behaviors. This code could be shared between web and native with the exception of the final UI component (&lt;div/&gt; for web vs. &lt;View /&gt; for native). You can read more about this topic <a href="http://ihor.burlachenko.com/code-sharing-between-react-and-react-native-applications/">another medium article</a> or just scroll through some of <a href="https://medium.com/search?q=react%20react%20native%20code%20sharing">other articles</a>.</p><p>Moreover, React Native dev tooling is pretty amazing; the option to have hot reloading on native components is incredible and very effective.</p><h3>Different strokes for different folks</h3><p>In late June Airbnb published <a href="https://medium.com/airbnb-engineering/react-native-at-airbnb-f95aa460be1c">five articles</a> explaining why the company is returning to native development after a period of two years using React Native. Their decision has not impacted our own choices; React Native is still used by <a href="https://facebook.github.io/react-native/showcase.html">many big apps</a> and backed by Facebook. Its community is bigger and more active than that of Cordova but above all, Doctolib is not Airbnb. Unlike Airbnb, only two of our developers, myself included, have experience developing native mobile applications and our application is mainly a webview. React Native may not be the perfect choice for all companies, but it is certainly the best and most pragmatic choice for us at this time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f255687151fc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/doctolib/why-we-chose-react-native-for-our-mobile-apps-f255687151fc">Why we chose React Native for our mobile apps</a> was originally published in <a href="https://medium.com/doctolib">Doctolib</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improving Build Pipeline UX]]></title>
            <link>https://medium.com/doctolib/improving-build-pipeline-ux-10a9bdd0bce5?source=rss-a9b4c1b7acb0------2</link>
            <guid isPermaLink="false">https://medium.com/p/10a9bdd0bce5</guid>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Mickaël Morier]]></dc:creator>
            <pubDate>Mon, 11 Dec 2017 21:46:00 GMT</pubDate>
            <atom:updated>2018-10-26T09:32:45.204Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BulpKl7IhbNJhIOzSFpWlw.png" /><figcaption>© Illustration by <a href="http://www.baileymcginn.com/">Bailey McGinn</a></figcaption></figure><p>The Build process at Doctolib is complex and uses several technologies during which more than 6,500 tests of different types and build durations are executed. Developers require direct feedback and a simple overview of <a href="http://caines.ca/blog/2017/01/14/the-quality-feedback-loop/">what is or is not working</a>. Here we discuss the main “build experience” issues and solutions encountered recently at Doctolib.</p><p>Doctolib is built on two main platforms: Rails and React. Some build tasks can be executed in parallel, while others respect a specific order. For example, before building JavaScript assets we need to grab packages from NPM. Until recently, classic Jenkins jobs were being used to orchestrate of all our build steps, with each step being a Jenkins job within which the build script is contained. All of this information is stored in Jenkins.</p><p>Here is how a typical Jenkins job setting looked at the time:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nvOXE8YCZVaKYvw3QrVrsw.png" /><figcaption><em>Main Jenkins job which orchestrates all Jenkins job steps</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PWSiNIk449zYLKVu1gAnKA.png" /><figcaption><em>One of step Jenkins job launched by the main Jenkins job</em></figcaption></figure><p>Unfortunately, we faced a few problems along the way compelling us to find a new approach to our builds.</p><h3><strong>Problem #1: Changing the build process can lead to broken branches for other developers</strong></h3><p>Builds can be broken when a developer changes the configuration of a Jenkins job. To address the issue we moved the build scripts from Jenkins jobs to our Git repository, close to the source code. Now Jenkins jobs only reference shell scripts which gives us the ability to change them freely within each branch without impacting other developers’ work.</p><p>The addition of a Jenkins job or a change in its conditions can also unfortunately lead to blocking other developers from building their branches. One possible solution would have been to create a shell script to coordinate all build scripts into one Jenkins job but this would still make executing other tasks in parallel challenging. Instead, we use Jenkins to organize all parts of the build by using a “pipeline” project type.</p><p>Pipeline jobs are based on a Groovy file which describes all stages and scripts to execute. Using a pipeline project allows us to reference a Groovy Jenkinsfile to explain which steps must be built and for each step, which build script should be executed. All of these files are stored on Github, no longer on Jenkins as you can see in the following screenshots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zoapTZXUMvikqGgbHSk76Q.png" /><figcaption><em>Pipeline Jenkins job configuration. Build instructions are in Jenkinsfile located on our source control</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nBF2_18H8mhVdhJ8eCULSA.png" /><figcaption><em>Jenkinsfile describes how to build all steps and which shell script should be launched for each step.</em></figcaption></figure><p>As a result of these changes, improving and modifying the build script of a job and/or changing the orchestration of steps no longer disturbs other developers as all build scripts and Jenkinsfiles are versioned.</p><h3><strong>Problem #2: Reasons behind build failure are hidden from view</strong></h3><p>If you have a lot of build steps like we have at Doctolib, it may be difficult to determine specifically which test or which part of the build process has failed. It can be both painstaking and time consuming to find a failure in logs even with masterful browser searching skills.</p><p>A Jenkins job failure does not indicate which specific step during the process has failed, instead only the master job indicates a failure within. To solve a problem, one must navigate through the master job and into the step jobs to see their logs and test results in order to identify the issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*mZUPIgUKYDii1oDebGkeBw.png" /><figcaption><em>Old main Jenkins job result. We see that test-unit-ruby and test-e2e steps have failed but we need to navigate to each step page to see test results and logs of each step.</em></figcaption></figure><p>By using a single pipeline Jenkins job, all logs and test results are stored in one place. However, while identifying the “where” becomes more readily apparent, it still remains difficult to find the “why” behind a build process failure. To take further advantage of Jenkins pipelines, we installed <a href="https://jenkins.io/projects/blueocean/">Blue Ocean</a>. Blue Ocean is the new UI of Jenkins which provides a visual overview of the build process. Partnering a pipeline job with Blue Ocean allows for us to see all of our test results on one screen and easily identify problem areas.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nKNHoXWKZmEhHJYn9J1Y6w.png" /><figcaption><em>Pipeline visualization: easy to see which steps have failed (test-e2e &amp; test-unit-ruby) and which part of test-e2e step has failed.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FWy7aS_sNsm2IL11a0M6Kw.png" /><figcaption><em>Here some test results from test-unit-ruby, test-e2e &amp; test-e2e-zipper steps</em></figcaption></figure><h3><strong>Next steps</strong></h3><p>After 10 months, the feedback we have received from our developers has only been positive. All of us find it easier to modify the build process using this new method.</p><p>Build pipelines save time in finding the origin of build failures in developers’ branches, yet, in the case of master or production branches the process still requires additional steps. These branches are crucial to our <a href="https://medium.com/doctolib-engineering/the-duty-guy-the-key-to-empowering-engineers-a43d1fc4706b">Duty Guy</a>. In order to keep our daily Duty Guy happy, our plan is to migrate the specific master and production steps into our current pipeline job, turning our simple pipeline into a multi-branch pipeline job. The following captures show how our pipeline dashboard should improve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UK84HWdzXp-lljQnaf7_vg.png" /><figcaption>Simple pipeline: runs #16421 &amp; #16424 have same commit message but one is built on a feature branch, the other one on master branch.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dY735TMtloJF1M1MzpC4Ow.png" /><figcaption>Multibranch pipeline: each run is identified by its branch.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10a9bdd0bce5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/doctolib/improving-build-pipeline-ux-10a9bdd0bce5">Improving Build Pipeline UX</a> was originally published in <a href="https://medium.com/doctolib">Doctolib</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>