<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hubert Sablonnière, Author at Clever Cloud</title>
	<atom:link href="https://stagingv6.cleverapps.io/blog/author/hubert-sablonniereclever-cloud-com/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>From Code to Product</description>
	<lastBuildDate>Fri, 12 Jul 2019 11:21:00 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2023/03/cropped-cropped-favicon-32x32.png</url>
	<title>Hubert Sablonnière, Author at Clever Cloud</title>
	<link></link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Environment variables: reloaded</title>
		<link>https://stagingv6.cleverapps.io/blog/features/2019/07/12/environment-variables-reloaded/</link>
		
		<dc:creator><![CDATA[Hubert Sablonnière]]></dc:creator>
		<pubDate>Fri, 12 Jul 2019 11:21:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[environment variables]]></category>
		<category><![CDATA[web components]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2019/07/12/environment-variables-reloaded/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/env-var-post-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" fetchpriority="high" srcset="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/env-var-post-1.png 1400w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/env-var-post-1-300x116.png 300w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/env-var-post-1-1024x395.png 1024w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/env-var-post-1-768x296.png 768w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/env-var-post-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p>After all these years, our Web console's codebase needed some technical updates. We chose new libraries to build our UI (templating, components…) and decided to introduce them progressively, feature by feature.

In order to test this new stack, we chose to improve an existing feature: the environment variables.

We'll get into the "under the hood" details in another article. For now, let's focus on what's new from the user's perspective.

<span id="more-2960"></span>
<h2 id="whats-new">What's new?</h2>
<h3 id="multiline-support">Multiline support</h3>
There was no real/official multiline support for your environement variables.

Now you can press the <code>enter</code> key in the value field: (it also works with copy/paste)

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-multi-01.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-multi-01.png" style="border: 1px solid #aaa; border-radius: 5px; width: 70%">
</a>

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-multi-02.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-multi-02.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>

In expert mode, your multiline variables need to be quoted:

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-multi-03.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-multi-03.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<h3 id="edits-then-update">Edits then update</h3>
The update mechanism has changed. First, you make your modifications (new vars, edits, deletions…) in simple or expert mode. Then you click on "update changes".

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-edit-update.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-edit-update.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<h3 id="input-validation">Input validation</h3>
We improved the client-side validation and tried to display detailed errors.

New variable names are checked against conventions:

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-badname.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-badname.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>

Expert mode also gets its real-time error report:

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-expert-errors-01.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-expert-errors-01.png" style="border: 1px solid #aaa; border-radius: 5px; width: 70%">
</a>

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-expert-errors-02.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-expert-errors-02.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<h3 id="small-ux-improvements">Small UX improvements</h3>
We also improved some small user-experience details:
<ul>
 	<li>The design of the focus ring has been improved.
It should be more visible for any keyboard user that needs it.</li>
</ul>
<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-focus.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-focus.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<ul>
 	<li>We're introducing a skeleton screen when data is loading:</li>
</ul>
<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-loading.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-loading.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<ul>
 	<li>We use a loader animation when data is updating:</li>
</ul>
<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-updating.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-updating.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<ul>
 	<li>For add-ons, we reuse the same component but in read-only mode:</li>
</ul>
<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-readonly-simple.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-readonly-simple.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<ul>
 	<li>For add-ons, you still have the expert mode so you can copy/paste easily from it:</li>
</ul>
<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-readonly-expert.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-readonly-expert.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<h2 id="whats-next">What's next?</h2>
We hope these improvements will help you in your usage of the Clever Cloud console. Please give us feedbacks.

We'll be back with details about how we changed our stack using Web Components…]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/env-var-post-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" srcset="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/env-var-post-1.png 1400w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/env-var-post-1-300x116.png 300w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/env-var-post-1-1024x395.png 1024w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/env-var-post-1-768x296.png 768w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/env-var-post-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p>After all these years, our Web console's codebase needed some technical updates. We chose new libraries to build our UI (templating, components…) and decided to introduce them progressively, feature by feature.

In order to test this new stack, we chose to improve an existing feature: the environment variables.

We'll get into the "under the hood" details in another article. For now, let's focus on what's new from the user's perspective.

<span id="more-2960"></span>
<h2 id="whats-new">What's new?</h2>
<h3 id="multiline-support">Multiline support</h3>
There was no real/official multiline support for your environement variables.

Now you can press the <code>enter</code> key in the value field: (it also works with copy/paste)

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-multi-01.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-multi-01.png" style="border: 1px solid #aaa; border-radius: 5px; width: 70%">
</a>

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-multi-02.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-multi-02.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>

In expert mode, your multiline variables need to be quoted:

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-multi-03.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-multi-03.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<h3 id="edits-then-update">Edits then update</h3>
The update mechanism has changed. First, you make your modifications (new vars, edits, deletions…) in simple or expert mode. Then you click on "update changes".

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-edit-update.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-edit-update.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<h3 id="input-validation">Input validation</h3>
We improved the client-side validation and tried to display detailed errors.

New variable names are checked against conventions:

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-badname.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-badname.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>

Expert mode also gets its real-time error report:

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-expert-errors-01.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-expert-errors-01.png" style="border: 1px solid #aaa; border-radius: 5px; width: 70%">
</a>

<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-expert-errors-02.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-expert-errors-02.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<h3 id="small-ux-improvements">Small UX improvements</h3>
We also improved some small user-experience details:
<ul>
 	<li>The design of the focus ring has been improved.
It should be more visible for any keyboard user that needs it.</li>
</ul>
<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-focus.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-focus.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<ul>
 	<li>We're introducing a skeleton screen when data is loading:</li>
</ul>
<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-loading.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-loading.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<ul>
 	<li>We use a loader animation when data is updating:</li>
</ul>
<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-updating.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-updating.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<ul>
 	<li>For add-ons, we reuse the same component but in read-only mode:</li>
</ul>
<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-readonly-simple.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-readonly-simple.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<ul>
 	<li>For add-ons, you still have the expert mode so you can copy/paste easily from it:</li>
</ul>
<a class="image-popup-no-margins" href="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-readonly-expert.png">
<img src="https://cdn.clever-cloud.com/uploads/2021/08/env-vars-readonly-expert.png" style="border: 1px solid #aaa; border-radius: 5px; margin-bottom: 3rem; width: 70%">
</a>
<h2 id="whats-next">What's next?</h2>
We hope these improvements will help you in your usage of the Clever Cloud console. Please give us feedbacks.

We'll be back with details about how we changed our stack using Web Components…]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The story of clever-tools 1.0.0</title>
		<link>https://stagingv6.cleverapps.io/blog/features/2018/10/15/the-story-of-clever-tools-1-0-0/</link>
		
		<dc:creator><![CDATA[Hubert Sablonnière]]></dc:creator>
		<pubDate>Mon, 15 Oct 2018 16:00:00 +0000</pubDate>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[clever tools]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[jenkins]]></category>
		<guid isPermaLink="false">https://www2.cleverapps.io/wp/blog/technology/2018/10/15/the-story-of-clever-tools-1-0-0/</guid>

					<description><![CDATA[<p><img width="1400" height="540" src="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/clever-tools-1-0-0-story-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" srcset="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/clever-tools-1-0-0-story-1.png 1400w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/clever-tools-1-0-0-story-1-300x116.png 300w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/clever-tools-1-0-0-story-1-1024x395.png 1024w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/clever-tools-1-0-0-story-1-768x296.png 768w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/clever-tools-1-0-0-story-1-1368x528.png 1368w" sizes="(max-width: 1400px) 100vw, 1400px" /></p><p>We have some news about our dear clever-tools, the Clever Cloud CLI for humans, robots and others.</p>
<p>Back in January, we released version 0.10.1 which contained <a href="https://github.com/CleverCloud/clever-tools/blob/master/CHANGELOG.md#0101-2018-01-16">some new commands and a few bug fixes</a>. Today we&#39;re releasing version 1.0.0!</p>
<p>You can find all the details about the user oriented changes in the <a href="https://github.com/CleverCloud/clever-tools/blob/master/CHANGELOG.md#100-2018-10-15">CHANGELOG</a>. In this article, we&#39;ll cover the structural changes related to the project:</p>
<ul>
<li>Improved error handling = better usage in CI/CD pipelines</li>
<li>ES2015 refactor + ESLint = better contributing experience</li>
<li>Goodbye nodegit, hello isomorphic-git!</li>
<li>Improved Jenkins build = more release methods and beta channel (npm, deb, rpm, arch, homebrew and chocolatey)</li>
</ul>
<p>Now let me tell you the story of this release...</p>
<span id="more-2945"></span>

<h2 id="improved-error-handling--better-usage-in-cicd-pipelines">Improved error handling = better usage in CI/CD pipelines</h2>
<p>It all started with <a href="https://github.com/CleverCloud/clever-tools/issues/195">issue 195</a>. With the previous version, when a user tried to <code>clever deploy</code> a non existing branch, the error message was <a href="https://github.com/CleverCloud/clever-tools/issues/195#issuecomment-371101087">a bit too raw</a>. Our colleague <a href="https://twitter.com/k33g_org">Philippe</a> wanted emojis, but we had to decline 😭.</p>
<p>While investigating this error message and how to improve it, we realized that the command was not returning a proper error exit status. This is a very important rule to follow when you&#39;re writing a terminal command/script:</p>
<ul>
<li>If everything went well: return exit status <code>0</code></li>
<li>If something went wrong: return exit status <code>1</code> (or <a href="http://www.tldp.org/LDP/abs/html/exitcodes.html">another one more specific</a>)</li>
</ul>
<p>Our CLI is built for humans AND robots. We want to empower our terminal addicted users. Moreover, we want to empower our users to automate anything related to Clever Cloud in their CI/CD pipeline. In such cases, returning a proper error exit status is crucial to mark a CI/CD job as successful or failed.</p>
<p>We took a quick look at the rest of the codebase and noticed that other commands were concerned by this problem. We reworked the code of <code>clever deploy</code> and decided to apply the same error handling to all the other commands:</p>
<ul>
<li>For humans: Always have an <code>[ERROR]</code> prefix (colored in red) when we display an error message.</li>
<li>For robots: Always log error messages to <code>stderr</code>.</li>
<li>For robots: Always return <code>1</code> as exit status when something goes wrong.</li>
</ul>
<p>This obviously required some significant work. We had to go through all the 28 commands. Nevertheless, we&#39;re sure this will help you to build more robust and automated jobs, interacting with the Clever Cloud platform.</p>
<h2 id="es2015-refactor--eslint--better-contributing-experience">ES2015 refactor + ESLint = better contributing experience</h2>
<p>While we went through the codebase, we took the opportunity to do a bit of refactoring.</p>
<p>First, we decided to update all our code to ES2015+ syntax. We tried to use most of the modern good practices of the JavaScript ecosystem when it made sense (destructuring, rest parameters, fat arrows...). We also decided to setup an <a href="https://github.com/CleverCloud/clever-tools/blob/master/.eslintrc.js">ESLint config file</a> (based on <a href="https://github.com/standard/standard">StandardJS</a>) to enforce our codestyle for the next iterations. This lint check is now part of our automated test suite on <a href="https://travis-ci.org/CleverCloud/clever-tools">Travis CI</a> which is triggered on each pull-request.</p>
<p>This big refactoring took some time but it allowed us to reduce the number of lines of code while improving the overall consistency and readability. We hope this will drive more users to customize the clever-tools and propose pull-requests for bug fixes and feature requests.</p>
<p>Looking at how easily the new <code>clever console</code> was added by <a href="https://github.com/CleverCloud/clever-tools/pull/248">an outside contributor</a>, it seems like we&#39;re on the right path.</p>
<h2 id="goodbye-nodegit">Goodbye nodegit</h2>
<p>During this refactoring, we updated most of our dependencies but one of them required special attention: <a href="https://github.com/nodegit/nodegit">NodeGit</a>.</p>
<p>NodeGit is a node.js module which provides bindings over <a href="https://libgit2.org/">libgit2</a>, a portable and pure C implementation of the git core methods. This is commonly referred to as a &quot;native module&quot; in the node.js ecosystem. Each time you install NodeGit, npm will try to build libgit2 from source (in some situations, it will try to download pre-builds). Because we want our users to have a straightforward installation experience, this native module thing had many drawbacks:</p>
<ul>
<li>In our Travis CI config, we had to <a href="https://github.com/CleverCloud/clever-tools/blob/0.10.0/.travis.yml#L5-L10">install some native dependencies</a> so npm could build libgit2 from source.</li>
<li>Some of our users tried to install the clever-tools via npm and had difficulties because of this.</li>
<li>Our users don&#39;t all use the same version of node.js, this also multiplied the number of weird cases we had to support.</li>
<li>Each time we wanted to update NodeGit, it was a puzzle to resolve.</li>
</ul>
<p>All those problems pushed us to stop releasing the clever-tools via npm. ⚠️ SPOILER ALERT: it&#39;s back for version 1.0.0.</p>
<p>The second problem is that we use <a href="https://github.com/zeit/pkg/">pkg</a>. This tool is great. It lets you compile a node.js project to different portable binaries for MacOS, Windows and GNU/Linux. We&#39;ve been using it for a while to provide various installation methods. When we dropped installation via npm for 0.10.1, the binaries built with pkg where the only official way to use the clever-tools.</p>
<p>This mix of NodeGit + pkg complicated the situation even more:</p>
<ul>
<li>The binaries built with pkg did not include native dependencies. We had to distribute the right <code>nodegit.node</code> file along with our main binary file and users had to have it in their <code>PATH</code>.</li>
<li>On some GNU/Linux distributions, we <a href="https://github.com/nodegit/nodegit/search?q=libcurl-gnutls&amp;type=Issues">had problems with native dependencies</a> like <code>libcurl-gnutls</code>, <code>libnghttp2-git</code> or <code>libssh2</code></li>
</ul>
<p>We already looked for a replacement solution but a fairly new one came up <a href="https://twitter.com/mojavelinux/status/968432035680284673">to our attention in February</a>...</p>
<h2 id="hello-isomorphic-git">Hello isomorphic-git</h2>
<p><a href="https://github.com/isomorphic-git/isomorphic-git">isomorphic-git</a> is a &quot;pure JavaScript implementation of git that works in node and browser environments&quot;. The project was created by <a href="https://twitter.com/wmhilton">William Hilton</a>. This guy is awesome!</p>
<p>As I said, we heard about it in February but we only tried to use it for our use-case in July. It does not support all the git feature set (yet) but it has strong foundations and we only need a few things for the clever-tools:</p>
<ul>
<li>list and resolve branches</li>
<li>list and resolve commits</li>
<li>add/rm remotes</li>
<li>push to repos (via HTTPS)</li>
</ul>
<p>We were missing a few features so we reached out to William to see if we could help and/or contribute. In the end, <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=hsablonniere">we contributed a few features</a> in the codebase and <a href="https://isomorphic-git.org/blog/2018/07/23/isomorphic-git-dot-org-corporate-sponsors-and-a-new-CORS-proxy">we sponsored the hosting of the CORS-proxy</a> which is used to demo the project in browsers.</p>
<p>By replacing NodeGit with isomorphic-git, we can say goodbye to most of the problems we described earlier:</p>
<ul>
<li>no need to worry about different node.js versions</li>
<li>no need to have native dependencies on our CI server to build/test the project</li>
<li>no need to distribute <code>nodegit.node</code> with the pkg binary</li>
<li>no need for a user to have the right native dependencies on his/her system to use it</li>
<li>npm releases are back</li>
</ul>
<h2 id="improved-jenkins-build--more-release-methods-and-beta-channel">Improved Jenkins build = more release methods and beta channel</h2>
<p>Because we decided to ditch NodeGit, we were able to simplify the packaging (no more <code>nodegit.node</code> and no native dependencies). This required some rework on our Jenkins builds but it was a good occasion to migrate 5 different jobs to one multibranch pipeline project.</p>
<p>We&#39;ll discuss the details of this new build system and how we set it up in another article. For now though, here&#39;s what changed:</p>
<ul>
<li>All platforms:<ul>
<li>Added: installation via npm is back</li>
</ul>
</li>
<li>GNU/Linux:<ul>
<li>Added: rpm packages (stable &amp; beta) with a <a href="https://bintray.com/clevercloud/rpm/clever-tools">yum repo on Bintray</a></li>
<li>Added: deb packages (stable &amp; beta) with an <a href="https://bintray.com/clevercloud/deb/clever-tools">apt repo on Bintray</a></li>
<li>Added: Exherbo exheres <a href="https://github.com/CleverCloud/CleverCloud-exheres/tree/master/packages/dev-util/clever-tools-bin">clever-tools-bin</a></li>
<li>Changed: <a href="https://aur.archlinux.org/packages/clever-tools-bin">dedicated AUR package</a> for beta versions</li>
</ul>
</li>
<li>MacOS:<ul>
<li>Changed: <a href="https://github.com/CleverCloud/homebrew-tap">dedicated homebrew tap</a> for beta versions</li>
</ul>
</li>
<li>Windows:<ul>
<li>Changed: chocolatey packages are now automatically published (no more manual upload, no more manual review from chocolatey&#39;s team)</li>
<li>Changed: chocolatey packages are no longer published on chocolatey.org</li>
<li>Changed: chocolatey packages are published (beta &amp; stable) on <a href="https://bintray.com/clevercloud/nupkg/clever-tools">Bintray</a> but you can still use the <code>choco</code> CLI to install them (see <a href="https://github.com/CleverCloud/clever-tools/#using-chocolatey">chocolatey installation docs</a> for the specifics).</li>
</ul>
</li>
</ul>
<p>The structural changes of this release will help us to be more reactive on the project. We&#39;ll be able to publish new features and bug fixes more easily and more often. Hopefully, this will improve the quality of the clever-tools and push more customers who only use the Web console to try the CLI way of life.</p>
<p>We&#39;re looking forward to read your feedbacks on this release through are usual channels: support chat, email, Twitter, GitHub issues…</p>
]]></description>
										<content:encoded><![CDATA[<p><img width="1400" height="540" src="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/clever-tools-1-0-0-story-1.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="" decoding="async" loading="lazy" srcset="https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/clever-tools-1-0-0-story-1.png 1400w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/clever-tools-1-0-0-story-1-300x116.png 300w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/clever-tools-1-0-0-story-1-1024x395.png 1024w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/clever-tools-1-0-0-story-1-768x296.png 768w, https://staging-cc-assetsv6.cellar-c2.services.clever-cloud.com/uploads/2021/08/clever-tools-1-0-0-story-1-1368x528.png 1368w" sizes="auto, (max-width: 1400px) 100vw, 1400px" /></p><p>We have some news about our dear clever-tools, the Clever Cloud CLI for humans, robots and others.</p>
<p>Back in January, we released version 0.10.1 which contained <a href="https://github.com/CleverCloud/clever-tools/blob/master/CHANGELOG.md#0101-2018-01-16">some new commands and a few bug fixes</a>. Today we&#39;re releasing version 1.0.0!</p>
<p>You can find all the details about the user oriented changes in the <a href="https://github.com/CleverCloud/clever-tools/blob/master/CHANGELOG.md#100-2018-10-15">CHANGELOG</a>. In this article, we&#39;ll cover the structural changes related to the project:</p>
<ul>
<li>Improved error handling = better usage in CI/CD pipelines</li>
<li>ES2015 refactor + ESLint = better contributing experience</li>
<li>Goodbye nodegit, hello isomorphic-git!</li>
<li>Improved Jenkins build = more release methods and beta channel (npm, deb, rpm, arch, homebrew and chocolatey)</li>
</ul>
<p>Now let me tell you the story of this release...</p>
<span id="more-2945"></span>

<h2 id="improved-error-handling--better-usage-in-cicd-pipelines">Improved error handling = better usage in CI/CD pipelines</h2>
<p>It all started with <a href="https://github.com/CleverCloud/clever-tools/issues/195">issue 195</a>. With the previous version, when a user tried to <code>clever deploy</code> a non existing branch, the error message was <a href="https://github.com/CleverCloud/clever-tools/issues/195#issuecomment-371101087">a bit too raw</a>. Our colleague <a href="https://twitter.com/k33g_org">Philippe</a> wanted emojis, but we had to decline 😭.</p>
<p>While investigating this error message and how to improve it, we realized that the command was not returning a proper error exit status. This is a very important rule to follow when you&#39;re writing a terminal command/script:</p>
<ul>
<li>If everything went well: return exit status <code>0</code></li>
<li>If something went wrong: return exit status <code>1</code> (or <a href="http://www.tldp.org/LDP/abs/html/exitcodes.html">another one more specific</a>)</li>
</ul>
<p>Our CLI is built for humans AND robots. We want to empower our terminal addicted users. Moreover, we want to empower our users to automate anything related to Clever Cloud in their CI/CD pipeline. In such cases, returning a proper error exit status is crucial to mark a CI/CD job as successful or failed.</p>
<p>We took a quick look at the rest of the codebase and noticed that other commands were concerned by this problem. We reworked the code of <code>clever deploy</code> and decided to apply the same error handling to all the other commands:</p>
<ul>
<li>For humans: Always have an <code>[ERROR]</code> prefix (colored in red) when we display an error message.</li>
<li>For robots: Always log error messages to <code>stderr</code>.</li>
<li>For robots: Always return <code>1</code> as exit status when something goes wrong.</li>
</ul>
<p>This obviously required some significant work. We had to go through all the 28 commands. Nevertheless, we&#39;re sure this will help you to build more robust and automated jobs, interacting with the Clever Cloud platform.</p>
<h2 id="es2015-refactor--eslint--better-contributing-experience">ES2015 refactor + ESLint = better contributing experience</h2>
<p>While we went through the codebase, we took the opportunity to do a bit of refactoring.</p>
<p>First, we decided to update all our code to ES2015+ syntax. We tried to use most of the modern good practices of the JavaScript ecosystem when it made sense (destructuring, rest parameters, fat arrows...). We also decided to setup an <a href="https://github.com/CleverCloud/clever-tools/blob/master/.eslintrc.js">ESLint config file</a> (based on <a href="https://github.com/standard/standard">StandardJS</a>) to enforce our codestyle for the next iterations. This lint check is now part of our automated test suite on <a href="https://travis-ci.org/CleverCloud/clever-tools">Travis CI</a> which is triggered on each pull-request.</p>
<p>This big refactoring took some time but it allowed us to reduce the number of lines of code while improving the overall consistency and readability. We hope this will drive more users to customize the clever-tools and propose pull-requests for bug fixes and feature requests.</p>
<p>Looking at how easily the new <code>clever console</code> was added by <a href="https://github.com/CleverCloud/clever-tools/pull/248">an outside contributor</a>, it seems like we&#39;re on the right path.</p>
<h2 id="goodbye-nodegit">Goodbye nodegit</h2>
<p>During this refactoring, we updated most of our dependencies but one of them required special attention: <a href="https://github.com/nodegit/nodegit">NodeGit</a>.</p>
<p>NodeGit is a node.js module which provides bindings over <a href="https://libgit2.org/">libgit2</a>, a portable and pure C implementation of the git core methods. This is commonly referred to as a &quot;native module&quot; in the node.js ecosystem. Each time you install NodeGit, npm will try to build libgit2 from source (in some situations, it will try to download pre-builds). Because we want our users to have a straightforward installation experience, this native module thing had many drawbacks:</p>
<ul>
<li>In our Travis CI config, we had to <a href="https://github.com/CleverCloud/clever-tools/blob/0.10.0/.travis.yml#L5-L10">install some native dependencies</a> so npm could build libgit2 from source.</li>
<li>Some of our users tried to install the clever-tools via npm and had difficulties because of this.</li>
<li>Our users don&#39;t all use the same version of node.js, this also multiplied the number of weird cases we had to support.</li>
<li>Each time we wanted to update NodeGit, it was a puzzle to resolve.</li>
</ul>
<p>All those problems pushed us to stop releasing the clever-tools via npm. ⚠️ SPOILER ALERT: it&#39;s back for version 1.0.0.</p>
<p>The second problem is that we use <a href="https://github.com/zeit/pkg/">pkg</a>. This tool is great. It lets you compile a node.js project to different portable binaries for MacOS, Windows and GNU/Linux. We&#39;ve been using it for a while to provide various installation methods. When we dropped installation via npm for 0.10.1, the binaries built with pkg where the only official way to use the clever-tools.</p>
<p>This mix of NodeGit + pkg complicated the situation even more:</p>
<ul>
<li>The binaries built with pkg did not include native dependencies. We had to distribute the right <code>nodegit.node</code> file along with our main binary file and users had to have it in their <code>PATH</code>.</li>
<li>On some GNU/Linux distributions, we <a href="https://github.com/nodegit/nodegit/search?q=libcurl-gnutls&amp;type=Issues">had problems with native dependencies</a> like <code>libcurl-gnutls</code>, <code>libnghttp2-git</code> or <code>libssh2</code></li>
</ul>
<p>We already looked for a replacement solution but a fairly new one came up <a href="https://twitter.com/mojavelinux/status/968432035680284673">to our attention in February</a>...</p>
<h2 id="hello-isomorphic-git">Hello isomorphic-git</h2>
<p><a href="https://github.com/isomorphic-git/isomorphic-git">isomorphic-git</a> is a &quot;pure JavaScript implementation of git that works in node and browser environments&quot;. The project was created by <a href="https://twitter.com/wmhilton">William Hilton</a>. This guy is awesome!</p>
<p>As I said, we heard about it in February but we only tried to use it for our use-case in July. It does not support all the git feature set (yet) but it has strong foundations and we only need a few things for the clever-tools:</p>
<ul>
<li>list and resolve branches</li>
<li>list and resolve commits</li>
<li>add/rm remotes</li>
<li>push to repos (via HTTPS)</li>
</ul>
<p>We were missing a few features so we reached out to William to see if we could help and/or contribute. In the end, <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=hsablonniere">we contributed a few features</a> in the codebase and <a href="https://isomorphic-git.org/blog/2018/07/23/isomorphic-git-dot-org-corporate-sponsors-and-a-new-CORS-proxy">we sponsored the hosting of the CORS-proxy</a> which is used to demo the project in browsers.</p>
<p>By replacing NodeGit with isomorphic-git, we can say goodbye to most of the problems we described earlier:</p>
<ul>
<li>no need to worry about different node.js versions</li>
<li>no need to have native dependencies on our CI server to build/test the project</li>
<li>no need to distribute <code>nodegit.node</code> with the pkg binary</li>
<li>no need for a user to have the right native dependencies on his/her system to use it</li>
<li>npm releases are back</li>
</ul>
<h2 id="improved-jenkins-build--more-release-methods-and-beta-channel">Improved Jenkins build = more release methods and beta channel</h2>
<p>Because we decided to ditch NodeGit, we were able to simplify the packaging (no more <code>nodegit.node</code> and no native dependencies). This required some rework on our Jenkins builds but it was a good occasion to migrate 5 different jobs to one multibranch pipeline project.</p>
<p>We&#39;ll discuss the details of this new build system and how we set it up in another article. For now though, here&#39;s what changed:</p>
<ul>
<li>All platforms:<ul>
<li>Added: installation via npm is back</li>
</ul>
</li>
<li>GNU/Linux:<ul>
<li>Added: rpm packages (stable &amp; beta) with a <a href="https://bintray.com/clevercloud/rpm/clever-tools">yum repo on Bintray</a></li>
<li>Added: deb packages (stable &amp; beta) with an <a href="https://bintray.com/clevercloud/deb/clever-tools">apt repo on Bintray</a></li>
<li>Added: Exherbo exheres <a href="https://github.com/CleverCloud/CleverCloud-exheres/tree/master/packages/dev-util/clever-tools-bin">clever-tools-bin</a></li>
<li>Changed: <a href="https://aur.archlinux.org/packages/clever-tools-bin">dedicated AUR package</a> for beta versions</li>
</ul>
</li>
<li>MacOS:<ul>
<li>Changed: <a href="https://github.com/CleverCloud/homebrew-tap">dedicated homebrew tap</a> for beta versions</li>
</ul>
</li>
<li>Windows:<ul>
<li>Changed: chocolatey packages are now automatically published (no more manual upload, no more manual review from chocolatey&#39;s team)</li>
<li>Changed: chocolatey packages are no longer published on chocolatey.org</li>
<li>Changed: chocolatey packages are published (beta &amp; stable) on <a href="https://bintray.com/clevercloud/nupkg/clever-tools">Bintray</a> but you can still use the <code>choco</code> CLI to install them (see <a href="https://github.com/CleverCloud/clever-tools/#using-chocolatey">chocolatey installation docs</a> for the specifics).</li>
</ul>
</li>
</ul>
<p>The structural changes of this release will help us to be more reactive on the project. We&#39;ll be able to publish new features and bug fixes more easily and more often. Hopefully, this will improve the quality of the clever-tools and push more customers who only use the Web console to try the CLI way of life.</p>
<p>We&#39;re looking forward to read your feedbacks on this release through are usual channels: support chat, email, Twitter, GitHub issues…</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
