This article was originally published on this site

Welcome to Press This, the WordPress community podcast from WMR. Here host David Vogelpohl sits down with guests from around the community to talk about the biggest issues facing WordPress developers. The following is a transcription of the original recording.

David Vogelpohl: Hello everyone and welcome to Press This the WordPress community podcasts on WMR. This is your host, David Vogelpohl, I support the WordPress community through my role at WP Engine, and I love to bring the best of the community to you hear every week on press this as a reminder, you can find me on Twitter @wpdavidv, or you can subscribe to press this on iTunes, iHeartRadio, Spotify, or download the latest episodes at wmr.fm. In this episode we’re going to be talking about something I find very exciting which is CI/CD and WordPress and how it’s overlooked and how we can change that and join me for that conversation. Someone who knows this topic very well. Joining us from buddy.works. I’d like to welcome Maciek Palmowski to Press this. Maciek, Welcome.

Maciek Palmowski: Hi, David. Thanks. Thanks for having us.

DV: I‘m so glad to have you here. This is a topic we’ve covered a few times over the years here at press this. And of course the wonderful world of sea ice is always changing and everyone has unique perspectives. And I’m really looking forward to this conversation, those listening. What magic is going to cover is the importance of CICD his thoughts on why CI CD is often overlooked in the WordPress world like the last a while bless coders out there. And of course, some approachable auctions for adopting CI CD and WordPress practice. So lots of good stuff we’re going to cover here today and I’m looking forward to jumping in magic. I’m gonna ask you the same question I asked every guest you probably remember it from your wordpress.org profile. But could you briefly tell me your WordPress version story?

MP: Because I am WordPress. PHP developer at first WordPress developer Leiter. At some point of my career, I was developing my own CMS. I mean, almost every PHP developer has this phase of his of his life to create his own CMS. At some point, point I realized that it’s really hard to maintain you have to update everything’s you have to keep everything working and you have to do it all alone. So at some point, I realized that maybe maybe it will be it will be a good thing to look for something that was created by a bigger group of people, maybe something installers. After After some testing, I found WordPress. That’s and since then, I’m working with WordPress, so it will be more than 10 years already.

DV: So you were you know, it’s funny out of all I think I’ve been 230 some odd interviews like this, and I don’t know if anyone has had that exact origin story, but I’m very familiar with lots of people who have, including my team and our agency days we didn’t start as a WordPress CMS based business, that our own custom one and then later adopted things like WordPress and cake and Laravel. So I think that but it’s really interesting. What year did you discover WordPress?

MP: Oh, it was so long ago. I I think it was I was starting my study over 46 years, so it was really long, long time. ago. Like you said smarter than us for sure.

DV: Okay, okay. Yeah. 2010 for me when custom post types and fields were enter or were part of core was like that critical moment where I viewed it as like a full functioning CMS without you know, heavy modification.

MP: I remember I remember this moment, it was just really revolutionary. Because before this, I had to use posts and pages and create some, some kind of workarounds of custom post types that literally changed everything.

DV: Yeah, just like your custom CMS. You probably had your custom face type of credit. So we had as well. That was a big year. And a big release WP Engine came into existence company I work for right after that. A bunch of the big agencies like 10 out web dev studios, but also things like WooCommerce those are really revolutionary time and WordPress history. Cool. Well I got I got kind of a little uniqueness there and that origin story is pretty neat. So I talked about earlier when in the intro I kind of mentioned to their listening that you know buddy dot works. And you tell everyone there What buddy that works or what buddy does what you do. There.

MP: So I think it works is that applicant CIC application, so it does almost the same as GitHub actions, or GitLab actions are all others applications that help to automate your deployments. The difference is that we have very friendly UI, so and you try to start your adventure adventure with CAC. In, for example, GitHub actions, you have to play around with this Yamo file. And when you start using body, you have a really nice UI he just it’s kind of similar to get Gutenberg, it just creates your CI CD pipeline from blocks. So it’s very easy. And this was also the reason the reason why I started using it many many years ago. I wanted to automate by my, my development flow and I did not you have to do it.

DV: He did this thing thing but even before you work there, yes, of course I was your user affairs.That’s cool.

MP: Yes I was a user first than I was. I can say that I was let’s call it an official ambassador because wherever I work, I always tried to, to convince the people working during to switch the body because it was easy to use for everyone. And it was very nice. It was very nice to hear a year ago that the guys from from buddy asked me hey, would you like to work for us

DV: What do you do at bat? What’s your job?

MP: I work in Messenger which means that I tried to educate people from mostly from WordPress space about CIC. How to contribute how to how to automate their processes, what you can do, thanks to DevOps automation, because it’s not only about deploying your code from your local server, or from your local host due to a server but there’s a lot of things you can do. In between, you can test your code you can we’re gonna buy something.

DV: We’re gonna give you plenty of opportunity to share that story. I’m just curious before we jump into the particulars of CI CD, I’m assuming Betty has things that help WordPress, ci CD, easier to adapt. Is that true? Specific WordPress stuff or is it more generalized and it’s also good for WordPress

MP: First of all, we have so many actions that a lot of them can be used in a very easy way together with WordPress for example, everything related to composer NPM. So those are a bit general but almost every every developer in WordPress space uses but we are also working on some some specific actions for example, right now we are preparing environment for for WordPress unit testing. Probably we will also extend that PHP code sniffer to have WordPress WordPress standards built in to our actions so think things like this and we are always trying to do to draw to add some new stuff. So if anyone would like to have a new action, it would be a great thing just to contact us because when we have more and more voices about the need for some action there’s a bigger chance that we will just create and if not, it’s very easy to just do it yourself. There is always a chance to configure any action the way

DV: you know there’s so many teams you created that PHP and WordPress coding standards, mashups. Never so great to hear you’re working on something where people can kind of pick it up and go. Alright, well let’s jump into more particulars on the CI CD stuff in from the super high level because we were fairly knowledgeable crowd here but Could you could you make for those that might be not super familiar how folks understand what a CI CD is.

MP: Yeah, so first of all, like we know CI, CD part of CI CD has nothing to do with companies even saying, yes, but CI CD stands for two things. That CI is continuous integration. And means that every time we change stuff in our code, we should we should run all the tests that have so every, every little change does that we should always be sure that our code is constantly working. So this is the CI part. And then we have the CB part and this means two things because it can mean either continuous development or continuous deployment. continuous development means that every time that we have our built builded version ready to ship, a person responsible for for the release just have to hit the president button to push it live. And they continue as deployment means that everything is automatic. So every time someone pushes pushes change, it does that and it’s automatically deployed to production.

DV: I think that’s the part where as people start to think about adopting CI CD they just imagine all the headaches they can avoid by having these automated checks in their in their workflows, and I think that’s what you know, attracts a lot of people to it. I’m curious though, kind of your thoughts on the notion of like, you know, using CIC and your workflows and kind of why bother or what’s the benefits, but I want you I’d like to explore that after our next break after after this break. Time to plug into a commercial break. Stay tuned for more press this in just a moment. Hello, everyone. Welcome back to press this the WordPress community podcast on W EMR. This is your host David Vogel Paul, and it’ll have an interview with magic Lebowski have offski Buddy works around see ICD and WordPress magic right before the break you were sharing a little bit about what CI CD was. That was a very succinct explanation. Thank you for that. So like obviously CI CD is maybe some extra work. It definitely I guess is extra work in terms of setting up your workflows and maybe even working with your workflows in some capacity. And I know a lot of folks may WordPress and I guess even beyond love cowboy or cowgirl coding, I called it wild list coding earlier. But what do you think the benefits are of CI CD? Like why bother that extra bit of work there?

MP: For me, it was always about being sure that my small little change in one part of code on the break some part of counting that I even don’t know because it was done by someone else from my team. Like on the other end of of our script of our application. And this is something that constantly happens, especially when we are building applications in bigger teams. We don’t know the whole code, and it can really happen that our small change can break something else and thanks to having factory so having some tests, we can be sure that it won’t happen or at least it will happen. Not so often as if you didn’t have those tests. The only problem with with the testing is while many developers know that we should test our code. There is always the problem mostly with with managers with company owners. And the famous saying we don’t have time to create tests, which is of course, wrong because every time when I hear that I don’t have time to create tests. After two weeks. We I will be probably fixing something that was missed because of the lack of tests. That we are wasting time on fixing the stuff that we can avoid just by spending an hour or two earlier.

DV: So it’s kind of like moving slow to go fast. Yeah, it takes you a little bit of extra time but you’re gonna save a lot more time later. Not having to fight fires and unwind being exact reaction.

MP: Also, it’s it’s much easier to plan writing tests because you have full control over you. You just need to just add those two or three hours to create tests as a part of creating your product or your application, whatever and not in the middle of doing something else. And writing quick fixes on quick fixes deploying in the middle of the night and stuff like this, then it’s always better to do something when the whole world around is burning, right?

DV: Yeah, that work life balance, the quality of work and the winds during a crisis like that. Those are all good points. Also kind of reminds me of that song, you know, or it’s like 99 or any little bugs in the code 99 little bags, like around 107 bucks in the case that the that song is could be in fast, but the reality is if you don’t have the test, you don’t know about the bugs in the code until somebody on the outside starts screaming about a problem if you haven’t caught it and you’re being Yeah,

MP: exactly with without the test, the sun would be very long there is there is an undefined number of bugs in the code. This is this is the problem.

DV: There’s another kid song. It’s a song that never ends. And maybe maybe that’s the version for the NCIC. All right, cool. Well, our song analogies behind this and we can dig a little deeper here. What does you or your team’s own CAC stack look like outside of buddy, like you talked about? I’m assuming but he uses their own stack within the flow. But what other tools do you feel are important, and in particular, for WordPress CAC.

MP: Maybe for for my example, because outside the body I am also working on constantly on my web services letter. And of course, I’m using body to have everything updated. This case I’m using Baddeck for example, to make my website static to convert it to static using WP static plugin. I also use it to release one or two plugins to GitHub because I’m a big fan of updates. So, there are so many ways we can we can use it. Like I said, not only for for, for deploying stuff.

DV: Like I mean like earlier you underside to be examples of like the PHPs stability Snipper and the WordPress code quality like those are things that stand out to me is like, you know, major items in a WordPress CAC stack. I’m just curious, like, Are there any other key ones you can think of offhand?

MP: I mean, in most cases look, let’s call them classics, because phpcs is one thing PHP unit for unit tests. I’m also a big fan of Cypress IO for end to end testing. So yeah, those are Oh, and of course, I also like and this is built in into body we have something called Visual test. So it just compares screen before and after deployment to see did we break something?

DV: There’s also WordPress unit tests right that the WordPress Core Team main Jas, anything like that.

MP: Yeah, so I mean, in most cases, I prefer to use WP mock by 10 up. But yes, sometimes I use those, those two core unit tests to and I mean, they’re sometimes annoying. I don’t know how to set up. For example, on my computer on Windows, I always have problems.

DV: So as you say, sometimes it says that mean, on the unit test side, does that mean that you’re kind of favoring writing your own unit tests? I would guess so. But I’m just curious.

MP: In most cases, some like I’m using WP mock because they don’t require connection to database and unit test should not have a connection to those WordPress in as big a big pharma in this case are more often integration test. Book Yeah, WP mock. Let me just concentrate or on what I have to check in my plugin and not worry about some creating the whole environment for for tests. So it’s much easier. Sometimes I also use the other script called Brain monkey it’s kind of similar. So overall, I prefer the non database approach when it comes to use unit test.

DV: That’s really interesting to hear. When we ask kind of a side question on this you kind of mentioned how you discovered WordPress along the way. Were you always using CAC recherches when you made WordPress applications, or did you kind of start with like cowboy coding and get to see ICD?

MP: Of course I started with cowboy coding. I will No no I can say smarter more line pure ones right yeah, we’re pushing everything through through FTP then wondering which file it did not upload it. Yeah. Yeah. So So I started like this like, I think like everyone, like opening a file in Notepad trying to fix the fix something almost on the server, just to discover after a moment that for some reason, the file didn’t upload it and then I close the window and file is gone. So yeah, there were many, many cases like this, but at some point, I learned that first of all, it’s much better to develop on your localhost and then move to to production and because developers are are lazy people, let’s be honest and out of this laziness comes a lot of interesting discoveries. So I started learning about how to automate some some processes. For example, how to help you come back to this with the good how to deploy it on the server without having to worry about not using FileZilla or something like that. Think the end Yes, I’m I found by the end and here I am,

DV: There you go. This is getting really into our kind of our next topic around like that adoption, flow and process a little bit but it’s interesting to hear about your motivations there. I would say I think I think a lot of people are lazy. And I think that efficiency is a big draw, but we have to pay it back later with problems and your time and your energy in a crisis. You know that laziness comes back to bite you if you’re not careful. So I think this is a very, very topical. We’re gonna take our last break and we’ll be right back. Time to plug into a commercial break. Stay tuned for more press this in just a moment. Everyone welcome back to press this. We’re in the middle of talking about the importance of CI CD in WordPress and how we can get more adoption there and more safety I guess, as people are pushing their code live. Right before the break. Magic was talking a little bit about his history with adopting CAC and nuking files and burning applications down to the ground, I guess with the bad feature releases, like that kind of thing. Certainly, I’ve been there, right, we can imagine. So let me ask you this question. Like you kind of alluded earlier that you think laziness is why, you know, maybe people don’t adopt CI CD. You think like, I mean, obviously there’s a vector for some in the WordPress world. Do you think it’s also related to like the technical nature of it like what do you why do you think C ICD is often overlooked in WordPress?

MP: First of all, the first biggest problem when it comes to CIC is to start your start your adventure which says do you first have to learn something about version control? Because without without knowledge about Git, you just can’t use the eyes. And when I talk during different WordCamps with some people during a all those corridor talks are Victoire carried governance because now we aren’t mostly looking for zoom. I learned that there are lots and lots of developers who still aren’t using any version control just like this. I don’t know why. I mean, most of them say that. using Git just made everything slower for them. The whole development process became harder and things like that. And honestly, I don’t understand it. But this is something interesting. This is the first step that that not only we as body but I think any company related with CSV should start educating people why they should use version because without this, they want to do the next step into the automation. And when they, when they start using it, I think that C ICD will become something natural, especially now when we are having more and more complicated development flows, right, because now we not only push our files from a local machine to the server, in many cases, we have to build our CSS from CSS. We have to compress our JavaScript we have to compress our images we have to sometimes when it comes to headless app routing have to build the whole the whole application. So there are many things that has to happen before we push our code to production. So it’s really remember that sometimes, many years ago, I just opened the notepad wrote the code and push it to production. That was all and now it’s more difficult

DV: Yeah. I think it’s a really profound point. about thinking about the adoption journey and stages and how version control is, you know, a critical first stage more approachable than than the totality of what you’d have to master to adopt CI CD. In our last couple of minutes or last minute here, I guess. You have any other resources you would share with those listening are thinking of adopting CI CD?

MP: I think I will trick a man. First of all, I after this person learned of course about version control, because like I said, this is this is the basics, without which, there is some chance to go further. I would just try using body because just like that because of this graphical interface. It’s very easy. It’s very intuitive to start, even with trial and error. But it’s very easy. And I know how I did and really trying playing around with Buddy just helped me to understand the whole CIC counter, just like I can see being as powerful. Yes, it really helps. It really helps a lot and when someone will understand the basics. Next step is learning about all those unit testing about different ways to deploy code because there are many ways we can do it. And I don’t mean by using different protocols because we don’t have to use FTP or SFTP Windows arcing within our we can, for example, log into a server and download it from from Git or any other way there. are so many ways to do it. But first, just try to learn the basic and see how easy it can be. And then the next part that the whole testing can bring, it will come it will come step by step. The worst thing

DV: I found like the thing you referenced earlier from tunap with like the pre done unit tests and being able to like riff on that it’s kind of a nice bridge as well. That’d be helpful for a lot of other folks. But this is all been super cool, really very interesting stuff. And I think, you know, I certainly know my share, and maybe even sometimes myself who pushed your production in Calgary getting your cover, okay, anyway, so I’ve had to dig a little deeper here on some of these points. But when GQ was very great, good to have you on the show today.

MP: Thank you David. It was really great to to share some thoughts about CI CD and I really hope more and more people will will give it a try.

DV: Excellent. What do you like to learn more about what magic is up to or to check out your journey on CI/CD you can visit buddy.works. Thanks everyone for listening to press this WordPress community podcast on WMR. This has been your host David Vogelpohl. I support the WordPress community through my role at WP Engine. And I love to bring the best of the community to here every week on Press This.