teleren/devto huggingface dataset:
From the message queue: How to mitigate conflicting changes
Tags: cicd, devops, qa, conflicts
Published: 2021-05-24 10:19:45

---
title: From the message queue: How to mitigate conflicting changes
published: true
date: 2021-05-21 00:00:00 UTC
tags: cicd,devops,qa,conflicts
canonical_url: https://jhall.io/archive/2021/05/21/from-the-message-queue-how-to-mitigate-conflicting-changes/
---

Fellow Daily Commit reader Axel recently wrote to me (shared with permission, and edited slightly for context):

> In your [Lean CD](https://jhall.io/leancd) course, you talk about doing manual QA before merging. But wouldn’t moving QA before the merge expose you to integration risks? Let’s say there are two conflicting changes on separate branches. We would discover the problem only after the merge to master, right? Am I missing something here?

Here’s my full response:

> Hi Axel,
> 
> Thank you for your question! It’s a good one.
> 
> At a high level, the goal should be to find a way to validate that the merge is safe, and there are no conflicts, _before_ merging to master. There are different ways to accomplish this, and the best approach depends on your particulars.
> 
> Probably the simplest way to prevent conflicting merges is simply to require that all merges are fast-forwardable. Both GitHub and GitLab offer this option in the repo/merge request options. This disables the ‘Merge’ button when the feature branch is not up to date, forcing a rebase or merge (and thus a re-run of the automated CI tests) before merging. In my experience, this approach works very well on a small repo, with less than maybe 10 developers active.
> 
> For larger repos, GitLab offers [Merge Trains](https://about.gitlab.com/blog/2020/01/30/all-aboard-merge-trains/), which can help order your merges, without forcing a rebase yourself, to prevent conflicts. I imagine GitHub, or some CI add-on tools, can do the same, but I haven’t investigated.
> 
> Another option could be to have some staging branch that is merged into, then _automatically_ promoted to master after CI runs. This allows any conflicting merges to be caught in this stage, before merging to master. It would require manual intervention in such a case (probably reverting some PR). This would be sort of a manual implementation of GitLab’s Merge Trains feature. The key here is that it ought to be 100% automated, so that when there is no conflict there’s no further human interaction between hitting “merge” and the code being deployed into production.
> 
> Does this help?
> 
> Jonathan

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
Week 6-13 - Summary
Tags: diary, learning
Published: 2021-05-20 23:13:32

What a long JavaScript journey!

I purchased a complete JS course through Udemy and have spent the past several weeks working my way through the entire 60+ hour course; completing the challenges, the projects, and importantly making quality notes for reference so the knowledge isn’t lost! I also found a website called ‘Codecademy’ and worked through their tutorial section too, which was also useful.

It was a bit of a slog trying to complete the entire Udemy JS course, but I felt it necessary in order to get a thorough understanding of JS and to have a solid book of notes for reference. The course covered all the fundamentals, some really useful ‘under the hood’ theory on how JS works, and all the way up to the more advanced topics like closure and asynchronous functions. 

Reflecting on my JS journey, I admittedly felt a bit intimidated by the language before I began learning. It is a central language of the internet after all! Now I feel it has been demystified and I feel a lot more confident in my ability to expand my learning going forward. I do quite like the style of the language itself, the syntax and features, but then that’s not really surprising given my first language was VBA inside Excel and AutoCAD!
 
I’m going to have a well-deserved break and start fresh next week, having noticed my energy has been decreasing and fatigue setting in (not helped by the abysmal weather and pandemic). I think I will jump back into the [‘FrontEndMentor’](https://www.frontendmentor.io/) coding challenges next week and move to the more difficult scenarios, so I can apply my JS knowledge practically. I will look for some other JS challenges or practical applications, as well as start planning a personal project to demonstrate my frontend skills – I had an idea to re-create a book of solo card games that I own.

Thinking ahead, I already have a course and some resources on Python lined up. From my research Python seems to be the next language to delve into, for both its wide scope of application and also for the backend potential use – I think it’s prudent to dive into backend development too, to get a good all round knowledge base. Perhaps when I’ve spent more time practicing my JS skills I may come back and look at Node.JS, algorithms, and more advanced concepts.

A few weeks back, before I became immersed in the Udemy JS course, I completed the lecture and exercises for CS50 Week 2 which involved more programming in the C language. From memory I think it took the better part of two days to complete the exercises – always opting for the more challenging ones! Now that the JS course is done I want to resume my aim to complete a CS50 module a week, to keep the momentum going and also keep my learning diversified!
Functional Components and When to Use Them
Published: 2021-05-20 21:57:57

First, what is a functional component. In React, a functional component is a component that is defined as a function, instead of as a class. The most basic of functional components looks something like this:

```
function exampleComponent () {
	return(
		<div>
			Hello world!
		</div>
	)
}
```

As you can see, unlike a class component it does not have a render method, in fact, as a function it doesn’t have any methods; the function just returns some JSX for us. In this case a `div` element is rendered with ‘Hello world!’ inside of it. This is pretty useless, so how do we get some use out of our component.

We pass in props. The props are passed to the component using the same syntax in the parent as if it were a class component. The props can then be accessed the same as arguments to any function. 
```
function exampleComponent (props) {
	return(
		<div>
			Hello {props.name}!
		</div>
	)
}
```
We now know what a functional component is, when should we use one? Whenever we don’t need all of the abilities of a class component is the answer. So unless we need state, the store, dispatch functions or anything else we can ONLY get from class components we should use functional components. Functional components are simpler and therefore easier to write and debug.

In my recent application toxic-players(link) I used functional components to display players and their reports. The components of the players and reports were functional, and so were the lists containing them (note, not the container components those lists were in). The components did not need to change as the user interacted with them, except to appear and disappear. They have very little interaction with the store. The interaction that they did have with the store was handling by passing functions as props from a component that used the store more. Let’s look at my ` Player ` component:
```
export default function Player({player, store}) {
    return(
        <div className='player' style={{backgroundColor: `rgb(100, ${player.score * 5}, 255)`}}>
            <VotingButtons player={player} store={store}/>
            <h3>{player.username}</h3>
            <ReportContainer player={player} store={store}/>
        </div>
    )
}

```
The function returns a `div` element, with some things inside of it. Notably, one of those things is a ` ReportContainter` component, which is a class component. By passing the store through our functional component to a class component we retain the use of it. This allows a lot of useful behavior, that I won’t get into now. 

When we use functions to define our display components, they are more streamlined and often easier to understand at a glance. There is no looking around for a render method, we know that our JSX will be returned at the end of the function. We should use them whenever possible to minimize unnecessary complexity and eliminate as much bugginess as possible.
Top 5 DEV Comments of the Past Week
Tags: bestofdev
Published: 2021-05-20 22:27:37

---
title: Top 5 DEV Comments of the Past Week
published: true
description: 
tags: bestofdev
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nvjh80kv1nr41sw6wxke.png
---

_This is a weekly roundup of awesome DEV comments that you may have missed.  You are welcome and encouraged to boost posts and comments yourself using the **[#bestofdev](/t/bestofdev)** tag._


It's the [little tricks](https://dev.to/iamludal/tired-of-relative-imports-time-to-get-rid-of-them-1n48) that make long coding days go by easier. This tip from @valeriavg is exactly the kind of support we're all about here at DEV! 
{% devcomment 1efeg %}

This post on [consol.log()](https://dev.to/daryllukas/you-can-do-more-than-just-console-log-598a) is a great read. And we've got another fantastic trick in the bag, thanks to @stephanie ! 
 {% devcomment 1ei8a %}


Sometimes we all feel like [the world of programming is just too vast](https://dev.to/91sameer/i-think-there-is-too-much-to-learn-in-programming-16l6). It can be difficult to pull yourself out of a slump like this, @91sameer. But fellow developers like @nicozerpa coming through and offering support, guidance, and perspective can make those hard times just a little better  ❤️
{% devcomment 1ef58 %}


I feel it's fair to say that anyone who codes loves a good [hidden feature in Git](https://dev.to/yuvgeek/learn-the-hidden-feature-in-git-stash-k7b)! Thanks for a great addition to the post, @lucassperez !
{% devcomment 1eghe %} 

This is the ultimate [weekly win](https://dev.to/devteam/what-was-your-win-this-week-7cj) in my book, @jessekphillips. 😁
{% devcomment 1efj6 %}


See you next week for more great comments ✌
Educative Raises $12 Million in Series A Funding
Tags: news, educative, career, startup
Published: 2021-05-20 22:05:17

We founded Educative with the mission to make every developer more productive and successful. It was an inspirational rallying cry for the early few who helped us found the company. Along the way, we’ve been fortunate enough to work with millions of developers. We saw first-hand that developers need real hands-on training to succeed, and the market has responded with a resounding agreement.

That’s why we’re excited to announce the completion of our Series A funding round. Matrix Partners led the round of $12 million with additional funding from new and returning investors, including Trilogy Equity Partners, Lookout founder Kevin Mahaffey, Mercury founder Immad Akhund, Segment founder Ilya Volodarsky, and several other angel investors. For additional information, we hope you’ll read the [news release](http://www.prnewswire.com/news-releases/educative-secures-12-million-series-a-funding-to-accelerate-growth-and-expand-b2b-offerings-for-engineering-managers-and-leaders-301294762.html?tc=eml_cleartime) that we published this morning. 

The incredible support of the developers who rely on our courses to land new jobs and upskill themselves has humbled us. We are also thankful to our team and our investors for their continued support in expanding our mission.

We founded Educative on the idea of making every developer more productive. We’d like to spend a few moments sharing our plan to use this investment to help developers. 

- We’re more than tripling our course offerings this year and building offerings for teams and enterprises that want to expand the skills of their employees.
- We recently launched our business-to-business offerings to target our enterprise customers and their needs. We have already seen traction and growth with paying customers of teams and organizations of all shapes and sizes, which validates our belief in the opportunity to grow in the enterprise space.
-  We will continue to build the world-class courses you love -- hands-on, in-browser exercises that help you learn and develop your skills in key and emerging technologies.

To facilitate this growth, we will be hiring more than 200 new employees in our Seattle headquarters and around the world.

Ultimately, our promise to you is that we’ll continue to invest in ways that we think help you be more productive and more successful. That was our mission on our first day, and this round of investment will help us accelerate in that commitment.

Thank you for your support, and as always…

*Happy learning!*

Fahim and Naeem,
Co-Founders @ Educative
Beginner's guide to Linux
Tags: linux, beginners, ubuntu
Published: 2021-05-20 21:49:08

Once upon a time I installed Ubuntu, and here is a summary of how it progressed. Here I am trying to write in laymen's terms, and suggestions are welcomed.

**Why did I install it?**
My computer at the time was low on ram, and quite slow so as a workaround, I decide to install Linux.

**Which Linux to install as a beginner.**
There are many easy to install and use, I found Ubuntu a good one.

Also GUI of Ubuntu is same as Windows with some difference like you won't find Microsoft office here, instead Libre office, for music you can use Vlc,and for Web browsing Firefox.

There are all alternative tools available for all sorts of work.

**What is ubuntu.**
Leaving behind the technicals terms, It is just an operating system like windows but it is Open Sourced.
Go to <https://ubuntu.com/download/desktop> for more information.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zfy9bjfjrr8bjp8lh6dd.jpg)

**How to Try ubuntu**
Create a bootable device. How?
Go to <https://rufus.ie>(Rufus link) and download the software.

Proper Installation is not mentioned here you can look for it on youtube or blogs.

Since you wish to use ubuntu, you may want to learn more than a normal user would.


###1. Terminal 
This is the place where all the magic happens.
To access the terminal you can press `ctrl+atl+t` or press windows button and search terminal
![Terminal Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5nru7agurj6ze2nu7ssx.png)

###2. Updating and Upgrading through terminal
```sudo apt-get update && sudo apt-get upgrade```

little background:

sudo: gives Root privileges 
apt-get: is a package manager. you can find the software you need here.
update: gets an updated list from the repository
upgrade: install the updated list to your computer
 
###3. Installing software.
```sudo apt-get install software_name_here```
example: sudo apt-get install firefox

###4. Basic commands to use in terminal
Start a Program from terminal
Open terminal and `vlc` and **enter**

**cd**: change directory eg. `cd ~/Downloads`

**mkdir**: make a new directory  eg. `mkdir dev`

**cp**: copy command eg. `cp fileNameYouWishtoCopy DestinationWheretoCopy`

**rm**: remove a file eg. `rm fileToRemove` 


     
##Pro tip
when writing command try to use `Tab` and most time it will autocomplete commands.
Most commands are written in smallcase.
eg. `cd` and `CD` are different things.
![smallcase cd vs capital case](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jmyh7f5h5tsconaq3tl5.png)

##A general tip:
Even after experiencing it for years I still face issues, don't worry just search them online, In most of the case, there will be people similar to you, who already had that issue and got it resolved.

If this is not the case then no need to fear.
Your all-new best friend Stack Overflow is here. Just log in and put up your question there. ( Remember, always check if any similar question already exits or not)

or sometimes help from a friend is also useful.

Thanks to @chrisachard for inspiring me to write my first blog.
Day 371 : Let's Get It Started
Tags: hiphop, code, coding, lifelongdev
Published: 2021-05-20 21:42:28

_liner notes_:
- Professional : Day started out kind of hectic. Went to log into my work laptop and my password totally flew out of my brain. I was literally frozen. I entered in what I thought was the password, nope. Tried and few times without any success. I was worried that maybe I got locked out or something. Asked for some help on Slack and found out that my laptop would lock me out after multiple wrong entries. My password is pretty long and complex so I just entered it in slowly and made sure every character was entered. I've been having issues with my laptop and one being the keys sometime to respond when pressed. Once I did the password slowly, I was able to log in. Good thing I got my new work laptop yesterday. Had a meeting with a team mate. Good talk. Then set up my laptop with IT and installed programs I use daily. I didn't download any files from the back up I made yesterday. I figured if I need them, I can always download them later. Want to keep the new laptop as free from old unused files and projects as possible. Plus, I've been doing more in the cloud which is where I worked on a new sample demo application for the rest of the day. 

- Personal : Last night, I worked out the mobile layout for my side project and implemented it. I switched from flex box to css grid so that I could use grid template areas and just rearrange the elements based on screen size. Also put a window listener for the inner width of the screen in Svelte so I could show a different timer Web Component depending on the screen size. Works pretty well. I just need to figure out what to do with the timers in the navigation when not on the main page. I may have to add more features to the timer Web Component to only show certain parts of the date so it gets shorter as the screen gets narrow.

![Close up of a small tree sticking up from white flower pedals covered green grass with even more larger closely packed trees in the distance in Mahilyow, Belarus.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3kz6no7phzzluwzday97.jpg)

Tonight I want to work on add the ability to leave out parts of the timer Web Component and get it working in my side project at different sizes. Then I want to start working on the notification portion of the site and after that, I can finally get it deployed to the proper URL and start showing it to people and they can hopefully set reminders for when we go live. Also need to finish putting together the radio show for this week, because I have an event to go to Friday. Let's get it started.

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube akVWFiptGNY %}
Add Animation over your favorite Terminal in GNU/Linux.
Tags: linux, cpp, showdev, opensource
Published: 2021-05-20 20:58:50

I've always wanted to animate my konsole with an animation over it's title bar. I searched everywhere but I can't find a program for that. That's why I've created spirit. It is a small program written in C++ which overlays a gif over your terminal. *This is only available currently for KDE Plasma, Gnome, XFCE, Mate and other major X11 based Desktop Environments for Gnu/Linux*.

There are plans to support Windows and Mac in the future. 

# Quick Start

```
 $ wget "https://github.com/antony-jr/spirit/releases/download/v0.1.2/spirit"
 $ chmod +x spirit
 $ ./spirit init # That's it.
```

Now you should have a animation over your terminal window. **You should restart your terminal to take full effect.**

# Terminate the Application

```
 $ ./spirit deinit
```

The above command will stop spirit, you can just delete the binary if you don't need spirit in your system.


# Animation Change on Error Command.

When you execute error command in the terminal the gif will change. This can be used as a visual indicator when compiling code.

# Support

If you think this project is cool then please share the word and give a star at **https://github.com/antony-jr/spirit**

Stars in a project gives insight on how many people want this project to continue.
PyQt: cross-platform GUI programming
Tags: python, gui
Published: 2021-05-20 20:38:37

PyQt is a set of [Python](https://python.org) bindings for The Qt Toolkit library. The Qt toolkit is a C++ framework that is primarily used for creating graphical user interfaces ([GUIs](https://en.wikipedia.org/wiki/Graphical_user_interface)). It supports different platforms, such as Microsoft Windows, Mac OS and Linux.

The Python programming language provides an ideal and easy to learn scripting language for developing graphical user interfaces with PyQt. The bindings provide a high level interface between Python and Qt.
 
[PyQt](https://pythonpyqt.com/) allows Python programmers to create programs with a robust, highly functional graphical user interface, simply and easily. It is also suitable for applications requiring "quick-and-dirty" GUI prototyping. 

## PyQt Hello World

"Hello World" is a typical example program for demonstration purposes. 

This is a basic "hello world" application using the PyQt toolkit. It should give you an idea of what the PyQt framework is like. 

```python
# load pyqt widgets
from PyQt5.QtWidgets import * 
import sys
  
class Window(QMainWindow):
    def __init__(self):
        super().__init__()
  
        # the window title
        self.setWindowTitle("hello dev!")
  
        # window size
        self.setGeometry(0, 0, 200, 200)
  
        # create label 
        self.label = QLabel("Hello World", self)
  
        # show all the widgets
        self.show()
  
# create the app
App = QApplication(sys.argv)
  
# create Window
window = Window()
  
# start
sys.exit(App.exec())
```

To run the application, just type "python hello.py". This will open a window with the "Hello World" text. 

![hello world in python pyqt](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/78185ure6fotx7trbla5.png)

The window properties are set in the class

```python
# the window title
self.setWindowTitle("hello dev!")
  
# window size
self.setGeometry(0, 0, 200, 200)
```

Besides labels, you can add many things to the window like buttons, tables, select boxes, checkbox, video widgets and much much more. If you are new to PyQt, I recommend [this course](https://gumroad.com/l/pysqtsamples)