Gitlab Ci Monorepo Example

This requires a. In this example, we have a simple nodejs project and we would like to make sure the code is good by linting and unit-test. yml file at the top of a repository. There are multiple reasons for that, but the principal one is that source control update/pull/sync is the most efficient way for you to keep up with the HEAD of a library on a. This project's static Pages are built by GitLab CI, following the steps defined in. GitLab has a built in Continuous Integration & Deployment (CI/CD) service that can be used to host static websites, named GitLab Pages. Back up and synchronize your Postman Collections on GitLab (an open source Git repository manager) and on any of your custom domains. Gitlab makes CI/CD in such a setup very easy and checks out submodules recursively during a build, even across groups. yml (This Post) Troubleshooting GitLab and GitLab CI #1- Understanding the. 12, GitLab CI uses a YAML file (. CI/CD Pipeline - Will you choose Jenkins, Travis. Introduction to GitLab CI with Maven At ConSol we use GitLab as our central Git server and I am quite happy with its functionality. Personally I love gitlab and for a while I even self hosted it on Kubernetes. With Gitlab CI going full steem ahead following their proclaimed vision, we want to have a look on it ourselves! Mostly working with the proven and beloved open source CI tool Jenkins, we are wondering, will Gitlab give us some new features and benefits or will it not be able to replace Jenkins as the number one CI-tool. com will work fine). Using Docker images GitLab CI in conjunction with GitLab Runner can use Docker Engine to test and build any application. What decisions to make when specific conditions are encountered. yml cd your-hugo-site In the root directory of your Hugo site, create a. Apart from those, here is an collection of tutorials and guides on setting up your CI pipeline: Testing a PHP application. The more unique and sophisticated your Monorepo - different languages, platforms, runtimes etc. A sample of. Build command: If you are using a static site generator or other build tool, this is where you should specify the command to run to build your site. yml This yml contains the definition all the stages after a CI/CD pipeline is triggered in response to a git push/merge. In this guide, we will. GitLab CI evaluates the test coverage and can then display it in the job and pipeline view, as shown in Figure 1. yml that are then passed in the job environment. CI/CD Tools Comparison: Jenkins, GitLab CI, Buildbot, Drone, and Concourse July 21, 2017 Continuous integration, delivery, and deployment are strategies designed to help increase the velocity of development and the release of well-tested, usable products. Monorepo Advantages: One place to store all configs and tests. The "Authorization callback URL" must be the URL of your Concourse server with /sky/issuer/callback appended. In general though, you describe a Pipeline with a. Continuous Integration, System Administration, Caché Recently I started working with GitLab - GitHub self-hosted foss alternative. Apart from those, here is an collection of tutorials and guides on setting up your CI pipeline: Testing a PHP application. yml files is maintained at the GitLab CI Yml project. In a monorepo, we must bundle the breaking change to project B and the fix to project A in a single logical commit to the master branch of our monorepo. For example, there isn't an elegant solution for monorepo in GitLab after one year, neither is Travis CI. Source Control – Git is the clear leader, the real decision is where to host the remote repository, GitHub, GitLab, Azure, AWS CodeCommit, etc. Package installation; User, group, home directory; Global configuration; GitLab Runner tags; GitLab Runner instances; Custom file upload; Shell executor configuration; SSH key and host. When you create a new file via the UI, GitLab will give you the option to choose one of these templates. In the example above, it's a static inventory based on an INI file format, however if you wish you can switch it to a dynamic inventory generated from a database; just replace the ansible/inventory/hosts file with a script. The command Validate GitLab CI YAML will send your currently open. The more unique and sophisticated your Monorepo - different languages, platforms, runtimes etc. yml file at the top of a repository. GITLAB CI automatically builds the projects once a commit is made. 04 Introduction A self-hosted Git repository provider, GitLab Community Edition comes with additional features for software development as well as project management; including GitLab CI, which is a built-in continuous integration and delivery tool. To test your package on GitLab CI, here is a sample. x, which ships with bundled Continuous Integration module. For example, 2. - the more effort will be required when setting up, for example, a CI/CD workflow. 1 this is supported. On the Package Management team, we're frequently asked how to think about versioning packages. The secure variables are stored out of the repository (the. instanceUrl": "https://my-gitlab-domain. For example, in the backend, frontend, and mobile projects, the original CI has a deploy operation, which needs to be renamed to deploy_backend, deploy_frontend, deploy_mobile, or other names that. CI or Continuous Integration is the methodology of integrating, testing and building our application in each change we make to our version control automatically. I've provided a sample. It also requires the GitLab Runner 11. GitLab CI/CD Examples A collection of. This is a simple Python cli script that allows you create releases in GitLab automatically. Moreover, it's actually a good CI/CD practice to build and store artifacts when doing CI, and deploy the stored artifacts to different environments during the deployment phase. Using GitLab CI to configure your jobs. com, and does not apply to self-hosted GitLab installations. I am interested in using GitLab CI, but I need to know first if it would be possible for me to configure it so that my monorepo will be built entirely: I need to test and build client, landing and api (it should make a docker image and push it to docker registry). yml I commonly use for building and deploying Microservices in Kubernetes. A sample of. In mathematics, particularly graph theory, and computer science, a directed acyclic graph is a finite directed graph with no directed cycles. For example, having to split a project because it's too big or has too much history for your VCS is not optimal. In that file, you describe various Jobs which belong to Stages of the Pipeline. x, which ships with bundled Continuous Integration module. # Change Log: All notable changes to this project will be documented in this file. The possibilities are endless: think of it as if it was your own command line running the jobs for you. Setting Up Continuous Integration Pipelines with GitLab CI on Ubuntu 16. Installing intra-monorepo package dependencies is hard with a private repositories. You can change this in your repository settings, but this is the default location. I think it’s a smart move. If you want to see all issues click in the issues button in the left sidebar. orfeo-toolbox. yml files is maintained at the GitLab CI Yml project. yml The above example will create a code_quality job in your CI/CD. See [Conventional Commits](https://conventionalcommits. First of all: GitLab is an open-source git service. 0 for release 1, 2. We are excited to announce the launch of k8s-deploy-helper 1. Want to hack on it?. The reason is that they can't decide what to compare against. On any push to your repository, GitLab will look for the. We learnt what were the steps to get the automation running and we learnt about the different UI available to allow us to pinpoint errors happening either at build time or during deployment. To define this stage we have to:. org/orfeotoolbox/otb. On the Package Management team, we're frequently asked how to think about versioning packages. As you might have guessed from its name, GitLab (like GitHub) is a web-based Git repository — but with some notably different features. yml template files is maintained in GitLab. Directed graph builds systems like Buck, Bazel, and Pants solve this by compartmentalizing builds and tests to the active area of development. 0 meaning that the SemVer of 1. To fix this, go back to your GitLab CI Admin Dashboard (click GitLab CI in the topbar), then click your project's name. Directed Acyclic Graph Introduced in GitLab 12. Configure a Runner Configuring a Runner. To use the CI in the free GitLab account, you just have to create a. org:poezio/slixmpp. The control‑plane team at F5 was using GitLab with its built‑in continuous integration feature (GitLab CI) for the code repo and pipeline, and JFrog Artifactory for all artifacts. com will work fine). In the following examples, the job in the test stage runs and GitLab collects the JUnit test report from each job. yml cd your-hugo-site In the root directory of your Hugo site, create a. orfeo-toolbox. The major advantage of using GitLab Pages is that you will be able to compile all your Rmd posts through its CI/CD service instead of your local computer and any generated content, such as HTML files, will be. When new codes are pushed to the repository, GitLab will look for. Docker is an open-source project that allows you to use predefined images to run applications in independent "containers" that are run within a single Linux instance. NET projects in Gitlab. Before I walk you through my. com and all its services. Monorepo Support and/or filtering based on VCS changes in a specific directory Currently, any merges to master trigger all steps of all workflows. yml to this. This hybrid approach, where a single Git repository holds multiple modules/functions, is unofficially called 'monorepo'. The command Validate GitLab CI YAML will send your currently open. Attention: In the meantime GitLab introduced the only:changes feature which is geared towards the same problem as this repo. Directed Acyclic Graph Introduced in GitLab 12. Installation instructions for the runner/gitlab-ci-multi-runner package repository. yml variables that are set in build environment. Copy HTTPS clone URL. Simply add the content below. At fleetster we have our own instance of Gitlab and we rely a lot on Gitlab CI. After each job is executed, the XML reports are stored in GitLab as. com" To enable Gitlab Workflow extension to work with different Gitlab instances, each token is assigned to a Gitlab instance URL. Community Edition. yml from the root directory, and trigger a build. GitLab CI/CD Examples A collection of. Example: "gitlab. Want to hack on it?. In short, for multirepo to work, open source and commercial tools in the market are most likely sufficient. Contribute to GitLab Sign in / Register. A group is a collection of several projects. yaml with an example application. 1 this is supported. We are using GitLab's Multi-runner on a small Google Compute Engine instance. The solutions in this repo are more customizable / flexible but also more complex. The variables are stored in the git repository and are meant to store non-sensitive project configuration, for example:. With Gitlab CI going full steem ahead following their proclaimed vision, we want to have a look on it ourselves! Mostly working with the proven and beloved open source CI tool Jenkins, we are wondering, will Gitlab give us some new features and benefits or will it not be able to replace Jenkins as the number one CI-tool. The GitLab CI YML. This requires a. Quite recently we upgraded our GitLab CE to wersion 8. yml, and specify the path(s) of the generated test reports. If there are any performance or service interruptions, an update will be posted here. yml cd your-hugo-site In the root directory of your Hugo site, create a. As a collection of:. yml for a gradle project. x, which ships with bundled Continuous Integration module. yml from the root directory, and trigger a build. This year Ivan Moore (@ivanrmoore) made a claim that you can not do CI without using monorepos. For example, having to split a project because it's too big or has too much history for your VCS is not optimal. 0 for release 1, 2. The setup is like other CI tools such as Travis CI or Jenkins. A portal on this practice. Even on login. Walkthrough and examples on how GitLab 10. Let’s take a close look at the exact pros and cons of using the monorepo in the wild. yml file is a YAML file that you create on your project's root. What decisions to make when specific conditions are encountered. Take a look at this example: Update: Added example with Xvfb deprecated (details here). For the new JS monorepo, we have two stages: The build phase is extremely simple and runs the following two scripts: lerna bootstrap lerna run build. Gitlab executes the instructions found in. We can certainly look into leveraging this work to publish "official" Terraform modules to the public module registry for customers to more easily deploy GitLab to various IaaS cloud providers, but that is beyond the scope of this design for now. In general though, you describe a Pipeline with a. Monorepo or Multirepo? Role-Based Repositories. Here at Undabot we are using GitLab CI for continuous integration. This year Ivan Moore (@ivanrmoore) made a claim that you can not do CI without using monorepos. GitLab Community Edition. Scroll down a touch and under Project settings , put a tick in the box for Allow shared runners , then scroll to the bottom and Save changes. yml file for this project, as you already did for simple-maven-dep. For this example, we'll just spin up an EC2 instance, but for your project it can be any AWS resources that Terraform supports and that your "TerraformRole" allows. Replace YOUR_GITLAB_BUILD_NAMESPACE with a name for the namespace in which the GitLab CI builds are run. When you create a new file via the UI, GitLab will give you the option to choose one of these templates. GitLab CI Examples A collection of. In your CI/CD system, instead of referencing your individual source repositories, you will use your main monorepo as the source repository and then reference the specific project directory within it. One of the big differences between GitLab and GitHub is the built-in Continuous Integration/Delivery of GitLab. file to the root directory fo your code repository. After each job is executed, the XML reports are stored in GitLab as. GitLab CI/CD Examples Examples are a useful way of understanding how to implement GitLab CI/CD for your specific use case. yml example. gitlab_runner default variables. Gitlab itself has a lot of useful information about CI configuration, for example this and this. 1 for next and 2. Now I feel compelled to fill this gap. To enable the JUnit reports in merge requests, you need to add artifacts:reports:junit in. yml ? What would be an example criteria? Since you are a paying customer feel free to work with our support team to have the features you need prioritized. com using our publicly available shared runners. Here at Undabot we are using GitLab CI for continuous integration. For example if there's a firewall blocking the connection, then the CI trigger won't work. This post is about enabling Continuous Integration of. This is contrary to a setup with (for example) Git source control where you have a single repository per module. GitLab GitLab. Mastering continuous integration and continuous deployment with GitLab. When new codes are pushed to the repository, GitLab will look for. This example shows how to run Static Application Security Testing (SAST) on your project's source code by using GitLab CI/CD. GitLab CI/CD Examples This page contains links to a variety of examples that can help you understand how to implement GitLab CI/CD for your specific use case. A CI build ID is used to associate multiple CI machines to one test run. So monorepo !== monolith. When you create a new file via the UI, GitLab will give you the option to choose one of the templates existent on this project. yml for a gradle project. yml file and start jobs on CI according to the contents of the. Gitlab is really the only option as of now that provides a private git repo, continuous delivery, and is free. Here at Undabot we are using GitLab CI for continuous integration. Here is an example. yml files is maintained at the GitLab CI Yml project. *$/ matches Deploy-2014-06-01 and other branches and tags that start with deploy-in any combination of cases. Once you set up the Runner, add a new job to. I showed a very simple 3 stages pipeline build/test/deploy. file to the root directory fo your code repository. Monorepo or Multirepo? Role-Based Repositories. [Tutorial — Guide] Installing GitLab, GitLab CI on AWS EC2 from Zero. While you could hard-code them… please don’t. Copy SSH clone URL [email protected] yml file and start jobs on CI according to the contents of the. In a monorepo, we must bundle the breaking change to project B and the fix to project A in a single logical commit to the master branch of our monorepo. Directed Acyclic Graph Introduced in GitLab 12. Gitlab CI After I set up this website using a Gitlab pipeline, I tried to set up a continuous integration pipeline for one of my Python projects. If the branching and merging strategy are solid, then some jobs can be specific to certain branches. With Gitlab CI going full steem ahead following their proclaimed vision, we want to have a look on it ourselves! Mostly working with the proven and beloved open source CI tool Jenkins, we are wondering, will Gitlab give us some new features and benefits or will it not be able to replace Jenkins as the number one CI-tool. gitlab_runner default variables. Jump to: ☰ Menu How to build a CI/CD pipeline using Kubernetes, Gitlab CI, and Helm. So monorepo !== monolith. Once you have a runner working on a machine you can add a config file to a project. Some real-world examples on how to smoke test infrastructure. We want to realize the following: After pushing to the staging branch:. All I can see is Ruby and can't find any information on how to build a C# application using it. yml Scanning results The above example will create a sast job in your CI/CD pipeline and scan your project's source code for possible. Using monorepos with a traditional CI solution is very challenging. Steven has 5 jobs listed on their profile. A monorepo is simply one repository where all source code ends up. GitLab CI uses a YAML file for job configuration. rst, AUTHORS. Hopefully soon to be integrated into GitLab CI!. To add new environments in GitLab, first go to the web interface, navigate to your repository and then to CI / CD > Environments. Showing 1 changed file with 3 additions and 0 deletions. I turned one of these into an example repository that shows how to use GitLab together with the Rocker Docker images and the drake build system to reproducibly run a project pipeline, using the cacheing functionality across all three tools to make things reasonably speedy and enable both local and remote builds. You can identify if a pull request was built while it was considered draft by the contributor by looking at the DRAFT tag in the web UI. Apart from those, here is an collection of tutorials and guides on setting up your CI pipeline:. A sample of. The problem is, that I receive 422 HTTP errors frequently. yml configs, I’d like to mention all the sources that led me to where I am: Easily deploy a Vue + Webpack App to Heroku in 5 Steps [tutorial] by Nick Manning Deploying AdonisJS Apps to Heroku by Chimezie Enyinnaya. In the above example we use Dpl to deploy my-app-staging to Heroku server with api-key stored in HEROKU_STAGING_API_KEY secure variable. To use different provider take a look at long list of Supported Providers. I turned one of these into an example repository that shows how to use GitLab together with the Rocker Docker images and the drake build system to reproducibly run a project pipeline, using the cacheing functionality across all three tools to make things reasonably speedy and enable both local and remote builds. I've finally found some time to write this post. JSFoo is in its ninth edition this year. Talks at JSFoo 2019 will cover the following topics: Component architecture – how different web components have been stitched together to build apps; outcomes on UI and performance as a result of architecture choices. For example, there isn't an elegant solution for monorepo in GitLab after one year, neither is Travis CI. com Gold provides you the ability to run 50,000 CI pipelines per month (with a 4-hour support SLA) along with advanced DevOps features and functions which include project management, portfolio management, advanced security (SAST, DAST and automated solutions for vulnerabilities) and application performance alerts. GitLab has a built in Continuous Integration & Deployment (CI/CD) service that can be used to host static websites, named GitLab Pages. How to deploy any project using FTP with Gitlab Continous Integration (CI)? 8 August, 2017 - by Wojciech Kałużny Using FTP programs to add every change on your projects is not only annoying but also time-consuming. CI or Continuous Integration is the methodology of integrating, testing and building our application in each change we make to our version control automatically. 1 this is supported. Some real-world examples on how to smoke test infrastructure. So far this is working fine, but the CI/CD was giving me problems. rst, LICENSE. Conceptually, it's simple: NuGet (like many package managers) prefers semantic versioning (SemVer), which describes a release in terms of its backwards-compatibility with the last release. yml) for the project configuration. There are multiple reasons for that, but the principal one is that source control update/pull/sync is the most efficient way for you to keep up with the HEAD of a library on a. The solutions in this repo are more customizable / flexible but also more complex. I think it’s a smart move. Quite recently we upgraded our GitLab CE to wersion 8. PR triggers Pull request (PR) triggers cause a build to run whenever a pull request is opened with one of the specified target branches, or when changes are pushed to such a pull request. In this example, we have a simple nodejs project and we would like to make sure the code is good by linting and unit-test. I have a monorepo with multiple projects (read: multiple clients) with some code shared between them, and I've managed to successfully set up a CI pipeline where I can build, test and package each and every of them separately using when:changes and when. We continuously monitor gitlab. Toggle navigation. GitLab CI example projects. GitLab offers a nice CI which works well with the idea of using build container to build the actual image. Location: San Francisco. Artifactory, nexus, private npm, Communicate, update and test dependency releases. Gitlab CI/CD with pipeline, artifacts and environments. This hybrid approach, where a single Git repository holds multiple modules/functions, is unofficially called 'monorepo'. Attention: In the meantime GitLab introduced the only:changes feature which is geared towards the same problem as this repo. Monorepo Support and/or filtering based on VCS changes in a specific directory Currently, any merges to master trigger all steps of all workflows. yml example. yml file as seen in example Github project. Example: "gitlab. 11 modules, monorepo and shared code. Exploring GitLab's new Directed Acyclic Graph feature to build monorepo CI/CD pipelines. GitLab offers a nice CI which works well with the idea of using build container to build the actual image. CI Examples. GitLab CI uses a YAML file for job configuration. This monorepo contains the packages that implement the Kosu protocol, alongside supporting packages and developer tooling. GitLab Tutorial. Docker is an open-source project that allows you to use predefined images to run applications in independent "containers" that are run within a single Linux instance. PR triggers Pull request (PR) triggers cause a build to run whenever a pull request is opened with one of the specified target branches, or when changes are pushed to such a pull request. This file stores the information, what the CI should do after a commit. After each job is executed, the XML reports are stored in GitLab as. yml cd your-hugo-site In the root directory of your Hugo site, create a. Pull request builds are an essential part of Travis CI. Apart from those, here is an collection of tutorials and guides on setting up your CI pipeline: Testing a PHP. In this tutorial, I will briefly go over what is CI/CD, why I decided to go with GitLab's tool and a walkthrough on how to create a. In mathematics, particularly graph theory, and computer science, a directed acyclic graph is a finite directed graph with no directed cycles. Monorepo Workflows Based on Lerna with Azure Pipelines. Even on login. Git in the Enterprise: How to succeed at DevOps using Git and a monorepo 1. While you could hard-code them… please don’t. Copy HTTPS clone URL. GitHub Gist: instantly share code, notes, and snippets. yml ? What would be an example criteria? Since you are a paying customer feel free to work with our support team to have the features you need prioritized. Tools like TravisCI and CircleCI can work with Monorepos just as well as with Multirepos, but be ready to hit a roadblock when dealing with edge cases. yml Scanning results The above example will create a sast job in your CI/CD pipeline and scan your project's source code for possible. Directed Acyclic Graph Introduced in GitLab 12. At fleetster we have our own instance of Gitlab and we rely a lot on Gitlab CI. All CI tools like Jenkins, GitLab, Nexus and SonarQube should be accessible for all team members. Clone this Maven sample project into your GitLab repository. yml file a makefile is called, which in turn calls a bash script for the compilation of the several files. This adds full transparency to all of your software projects and keeps teams motivated to fix broken builds and failing unit tests. file to the root directory fo your code repository. In mathematics, particularly graph theory, and computer science, a directed acyclic graph is a finite directed graph with no directed cycles. Some real-world examples on how to smoke test infrastructure. Git in the Enterprise: How to succeed at DevOps using Git and a monorepo 1. For example, tests can only be run only on branches since everything that is merged into master has already been tested. I am interested in using GitLab CI, but I need to know first if it would be possible for me to configure it so that my monorepo will be built entirely: I need to test and build client, landing and api (it should make a docker image and push it to docker registry). As you might have guessed from its name, GitLab (like GitHub) is a web-based Git repository — but with some notably different features. Let’s take a close look at the exact pros and cons of using the monorepo in the wild. The Netlify CMS team moved to this kind of monorepo architecture when that reached v2. Exploring GitLab's new Directed Acyclic Graph feature to build monorepo CI/CD pipelines. io/unity3d-gitlab-ci-example/. 5-beta0010 so it will sort properly. A generic introduction to Gitlab CI and an overview on its features. This is contrary to a setup with (for example) Git source control where you have a single repository per module. When the variables keyword is used on a job level, it overrides the global YAML variables and predefined ones. When you use GitLab Runner you most likely configured it to use your server's shell commands. sh - to build docker container. orbtk examples. GitLab CI Examples A collection of. org/poezio/slixmpp. A monorepo is simply one repository where all source code ends up. The clever tooling will allow just the necessary modules to be included at build time. Simply add the content below. Instead of installing certbot in our build box, we could just use one of the docker containers and simply give it our credentials to perform the necessary operations, ending up with a new section in our. 0+ help managing CI when using monorepos. All CI tools like Jenkins, GitLab, Nexus and SonarQube should be accessible for all team members. In this example, we have a simple nodejs project and we would like to make sure the code is good by linting and unit-test. GitLab CI/CD Examples A collection of. Today we saw how we could setup CI/CD for our example application using the free services provided by GitLab. Excess builds are happening all the time because multiple people are working on the same repository. For example, in the backend, frontend, and mobile projects, the original CI has a deploy operation, which needs to be renamed to deploy_backend, deploy_frontend, deploy_mobile, or other names that. For example here are the issues of the engagement team. gitlabci-include. GitLab CI uses a YAML file for job configuration. I turned one of these into an example repository that shows how to use GitLab together with the Rocker Docker images and the drake build system to reproducibly run a project pipeline, using the cacheing functionality across all three tools to make things reasonably speedy and enable both local and remote builds. yml to this. yml to this. The fact-checkers, whose work is more and more important for those who prefer facts over lies, police the line between fact and falsehood on a day-to-day basis, and do a great job. Today, my small contribution is to pass along a very good overview that reflects on one of Trump’s favorite overarching falsehoods. Namely: Trump describes an America in which everything was going down the tubes under  Obama, which is why we needed Trump to make America great again. And he claims that this project has come to fruition, with America setting records for prosperity under his leadership and guidance. “Obama bad; Trump good” is pretty much his analysis in all areas and measurement of U.S. activity, especially economically. Even if this were true, it would reflect poorly on Trump’s character, but it has the added problem of being false, a big lie made up of many small ones. Personally, I don’t assume that all economic measurements directly reflect the leadership of whoever occupies the Oval Office, nor am I smart enough to figure out what causes what in the economy. But the idea that presidents get the credit or the blame for the economy during their tenure is a political fact of life. Trump, in his adorable, immodest mendacity, not only claims credit for everything good that happens in the economy, but tells people, literally and specifically, that they have to vote for him even if they hate him, because without his guidance, their 401(k) accounts “will go down the tubes.” That would be offensive even if it were true, but it is utterly false. The stock market has been on a 10-year run of steady gains that began in 2009, the year Barack Obama was inaugurated. But why would anyone care about that? It’s only an unarguable, stubborn fact. Still, speaking of facts, there are so many measurements and indicators of how the economy is doing, that those not committed to an honest investigation can find evidence for whatever they want to believe. Trump and his most committed followers want to believe that everything was terrible under Barack Obama and great under Trump. That’s baloney. Anyone who believes that believes something false. And a series of charts and graphs published Monday in the Washington Post and explained by Economics Correspondent Heather Long provides the data that tells the tale. The details are complicated. Click through to the link above and you’ll learn much. But the overview is pretty simply this: The U.S. economy had a major meltdown in the last year of the George W. Bush presidency. Again, I’m not smart enough to know how much of this was Bush’s “fault.” But he had been in office for six years when the trouble started. So, if it’s ever reasonable to hold a president accountable for the performance of the economy, the timeline is bad for Bush. GDP growth went negative. Job growth fell sharply and then went negative. Median household income shrank. The Dow Jones Industrial Average dropped by more than 5,000 points! U.S. manufacturing output plunged, as did average home values, as did average hourly wages, as did measures of consumer confidence and most other indicators of economic health. (Backup for that is contained in the Post piece I linked to above.) Barack Obama inherited that mess of falling numbers, which continued during his first year in office, 2009, as he put in place policies designed to turn it around. By 2010, Obama’s second year, pretty much all of the negative numbers had turned positive. By the time Obama was up for reelection in 2012, all of them were headed in the right direction, which is certainly among the reasons voters gave him a second term by a solid (not landslide) margin. Basically, all of those good numbers continued throughout the second Obama term. The U.S. GDP, probably the single best measure of how the economy is doing, grew by 2.9 percent in 2015, which was Obama’s seventh year in office and was the best GDP growth number since before the crash of the late Bush years. GDP growth slowed to 1.6 percent in 2016, which may have been among the indicators that supported Trump’s campaign-year argument that everything was going to hell and only he could fix it. During the first year of Trump, GDP growth grew to 2.4 percent, which is decent but not great and anyway, a reasonable person would acknowledge that — to the degree that economic performance is to the credit or blame of the president — the performance in the first year of a new president is a mixture of the old and new policies. In Trump’s second year, 2018, the GDP grew 2.9 percent, equaling Obama’s best year, and so far in 2019, the growth rate has fallen to 2.1 percent, a mediocre number and a decline for which Trump presumably accepts no responsibility and blames either Nancy Pelosi, Ilhan Omar or, if he can swing it, Barack Obama. I suppose it’s natural for a president to want to take credit for everything good that happens on his (or someday her) watch, but not the blame for anything bad. Trump is more blatant about this than most. If we judge by his bad but remarkably steady approval ratings (today, according to the average maintained by 538.com, it’s 41.9 approval/ 53.7 disapproval) the pretty-good economy is not winning him new supporters, nor is his constant exaggeration of his accomplishments costing him many old ones). I already offered it above, but the full Washington Post workup of these numbers, and commentary/explanation by economics correspondent Heather Long, are here. On a related matter, if you care about what used to be called fiscal conservatism, which is the belief that federal debt and deficit matter, here’s a New York Times analysis, based on Congressional Budget Office data, suggesting that the annual budget deficit (that’s the amount the government borrows every year reflecting that amount by which federal spending exceeds revenues) which fell steadily during the Obama years, from a peak of $1.4 trillion at the beginning of the Obama administration, to $585 billion in 2016 (Obama’s last year in office), will be back up to $960 billion this fiscal year, and back over $1 trillion in 2020. (Here’s the New York Times piece detailing those numbers.) Trump is currently floating various tax cuts for the rich and the poor that will presumably worsen those projections, if passed. As the Times piece reported: