jk's notes
  • 第一章 简介

第一章 简介

任何项目的主要问题是如何简单, 安全的发布代码的新版本. 我们已经看到人们为了处理部署问题而挣扎和沮丧地工作了几个小时. 它们越是偏离标准化的方法, 它们的发布周期就会变得越混乱. 在一个有一个项目中出现的同样的问题, 促使我编写了这本书. 编写这本书背后的想法其实很简单: 使得发布尽可能顺滑. 本书致力于解决任意技术形式的 CI/CD 的实现. 它落脚点在与为什么选择 CI, 以及如何使用现代方式实现它. 换句话说, 我们希望我们的读者在寻找任何 CI/CD 主题的帮助时, 不需要任何本书以外的东西.

我认为, 完成这一目标的第一个步骤是流程. 例如. 我们如何引入一个主题, 以及如何过渡到另一个主题. 这决定了我的行文方式, 它最容易实现: 记叙文的方式. 我们的灵感来自 吉恩·金 (Gene Kim), 凯文·贝尔 (Kevin Behr) 和乔治·斯帕福德 (George Spafford) 的《凤凰计划》(The Phoenix Project). 阅读它, 如同阅读一个跌宕起伏的故事. 最终, 你不仅理解了复杂的概念, 还阅读到了一个好的故事. 这很容易实现, 也符合我们的想法. 这有别于传统正式, 每个人都喜欢的技术书籍. 如果没有读过凤凰计划, 我建议你尝试一下.

类似的, 我们想带读者踏上一段旅程. 其中的挑战将是在 Docker 和 Jenkins 作为首选技术的帮助下, 通过应用 CI/CD 原则来提高项目的效率.

结构

本章, 我们会讨论下面的主题:

  • 人物角色介绍
  • Sprint 1 - 回顾 (retrospection)
  • Light of Hope

目标 (Objectives)

The main objective of this chapter is to provide a detailed understanding of the concepts necessary for software development and how releasing a new version of software can become a pain for many organizations. You will be introduced to many characters, who are going to be important in the overall development and journey of applications.

本章的主要目标是提供理解软件开发的细节, 以及为何发布软件新的版本会成为很多人头疼的事情. 我们会引入一些任务角色. 这些角色在后续开发整个程序的流程中很重要.

There are a few additional things that you will learn from this chapter, like the concepts of sprint and sprint planning. This chapter will give an overall idea of the concepts and principles of continuous integration.

本章还有一些附加内容. 例如 sprint 的概念, 以及 sprint 计划. 本章会设计所有的概念, 以及持续集成的原则.

角色介绍 (Character Introduction)

A new day and a fresh morning. As I looked outside my window, I saw the world moving just like last week, unchanged, unlike me. The reason being interruption; I can’t wait for a whole week to finish my ongoing thriller web series that grasped me till quite late last night. The problem with binge-watching is that it doesn’t stop time. Sooner or later, you are forced to let go and worry about the next day. But today is not so bad; in fact, the last few days have been a little exciting as I am in the middle of my first month at the office, a new start with my current organization. Therefore, I am hurtling through my stuff right now, with the goal of reaching office in time. During my interview here, I had a good chat with my now reporting manager, Sandeep, about the goals and requirements of the company. That conversation was one of the major role players in my decision to join. These people are doing some good work, which makes way for ample opportunities for career growth. I can contribute in many ways. Even while discussing, I was full of ideas. Now that I am slowly nearing the end of all the onboarding formalities and KT sessions, I can’t help but get excited. In an hour, as I geared myself up to beat the Monday blues, I kept thinking of the hint that Sandeep had given about a new assignment I would be working on. Minutes ago, I got an invite for a meeting to be held first thing in the next morning.

一天早上. 当我望向窗外时, 发现如同上周一样, 没有变化, 不同与我. 原因来自于一个插曲.

我迫不及待地想用整整一周的时间看完我正在看的惊悚网络剧,直到昨晚很晚才看完。

刷剧的问题在于它不会让时间停止。

迟早,你会被迫放手去担心第二天的事情。

但今天并没有那么糟糕;事实上,过去的几天有点令人兴奋,因为这是我在办公室的第一个月的中旬,是我在现在的公司的一个新的开始。

因此,我现在正在快速处理我的东西,目标是及时到达办公室。

在这里面试期间,我和我现在的汇报经理桑迪普 (Sandeep) 聊了聊公司的目标和要求。

那次谈话是我决定加入的主要因素之一。

这些人做得很好,这为职业发展提供了充足的机会。

我可以在很多方面做出贡献。

即使在讨论的时候,我也满脑子都是想法。

现在,我正在慢慢接近所有入职手续和KT课程的尾声,我不禁感到兴奋。

一个小时后,当我准备好战胜周一忧郁症的时候,我一直在想桑迪普给我的一个新任务的暗示。

几分钟前,我收到了第二天早上第一件事就是开会的邀请。

“Today’s a sunny day.”, I thought to myself as the car switched from the under-bridge to the over-bridge. “It’s a nice day to face some new challenges.” Since I am new to this company, I can’t help feeling an urge to prove my worth. I wonder if it’s only me. I bet people hired higher up in the hierarchy don’t care as much. Experience amounts to a lot. My thoughts continued as I neared the office building. After a pleasant trip on a sunny morning, I reached the office with endless thoughts revolving in my mind, about the exposure and challenges this new assignment would bring my way. After having a cup of coffee and sharing last weekend’s experiences with my new colleagues and friends, I walked up to the conference room 10 minutes prior to the scheduled time. At this point, I was hoping to get comfortable with the other new faces. In my experience, a formal introduction goes much better if you’ve had an informal one before. I feel more at ease and can crack better jokes. Hail Chandler! No one entered the room for the next 5 minutes. I was getting anxious as the butterflies started a brawl in my stomach. I kept looking at my phone, and just to be sure I hadn’t missed anything important, I quickly rolled down the notification dropdown which, I know, would go untouched, at least for the next hour. In the next 2-3 minutes, I was joined by two more brains. Thinking this to be my moment to shine, I got up and shook their hands enquiring, rather nonchalantly, about them. I didn’t want to give away my “not so calm” demeanor. But before they could say anything, Sandeep, who is not only my reporting manager but also the Project Owner and the organizer of this meeting, joined us.

“今天是晴天。当汽车从桥下切换到桥上时,我心想。

“今天是迎接新挑战的好天气。”

既然我是新来的,我就忍不住想要证明自己的价值。

我想知道是不是只有我这样。我敢打赌,高层雇佣的人不会那么在意。

经验很重要。当我走近办公楼时,我的思绪还在继续。

在一个阳光明媚的早晨,愉快的旅行结束后,我来到办公室,脑海中萦绕着无尽的想法,关于这个新任务将给我带来的暴露和挑战。

喝了一杯咖啡,与新同事和朋友分享了上周末的经历后,我比预定时间提前10分钟走向会议室。

在这一点上,我希望能适应其他新面孔。根据我的经验,如果你之前有过非正式的介绍,那么正式的介绍会更好。

我感觉更轻松,能讲更好的笑话。

Hail Chandler!

在接下来的五分钟里没有人进入房间。

当蝴蝶在我的胃里开始争吵时,我开始焦虑起来。

我一直在看我的手机,为了确保我没有错过任何重要的东西,我迅速地拉下通知下拉菜单,我知道,至少在接下来的一个小时里,它是不会动的。

在接下来的2-3分钟里,又有两个大脑加入了我。

我想这是我大放异光彩的时刻,我站起来和他们握手,相当冷淡地询问他们的情况。

我不想暴露我“不那么冷静”的态度。

但他们还没来得及说话,桑迪普就加入了我们,他不仅是我的汇报经理,也是这次会议的项目负责人和组织者。

The meeting started with an induction, which mostly focused on introducing me to the team. This team would be working on a fresh assignment. The others looked familiar with each other. I am sure they might have worked together recently or even multiple times. As I was the only unfamiliar face among the four people sitting in the room, I went on to introduce myself. “Hello everyone, I am Abhishek, your friendly neighborhood DevOps. I have experience of around 1 years in the industry, I've just started my DevOps journey, looking forward to become a better DevOps engineer by the end of this project. I am a skinny man who aims to be a fat cat without having to let go of my interests. My interests are a long story for some other time.” It was a sort of mixed feeling of accomplishment and pride to be the person who accounts for bridging the gap between development and operations. Keeping it short and precise, I handed it over to Sandeep to cruise the meeting further.

会议以介绍会开始,主要是把我介绍给团队。

这个团队将会完成一项新任务。

其他人看起来都很熟悉。

我相信他们最近可能在一起工作过,甚至多次。

因为我是坐在房间里的四个人中唯一不熟悉的面孔,所以我继续介绍自己。

大家好,我是Abhishek,你们友好的邻居DevOps。我在这个行业有大约1年的经验,我刚刚开始我的DevOps之旅,期待在这个项目结束时成为一名更好的DevOps工程师。我是一个瘦骨嶙峋的人,我的目标是成为一只肥猫,而不必放弃我的兴趣。我的兴趣是另一个时间的长话短说。

作为一个在开发和运营之间架起桥梁的人,这是一种既成就感又自豪感的混合感觉。

为了保持简短和精确,我把它交给桑迪普,让他继续进行会议。

我好奇的种子还没发芽,还没被坐在房间里的年轻人问起,桑迪普就替我做了。

Before the sprouted seed of my curiosity could have grown a little and asked about by the young personalities sitting in the room, Sandeep took over and did it for me. The first guy is Scrum master, Sajal, confident and visionary, who previously facilitated Scrum methodology among multiple development teams and projects, leading them to successful deliveries. Yes, this is what I concluded while listening and interpreting him, imagining myself to be a part of the next successful delivery in his ongoing streak. Sajal seemed like a guy fit for the job. I say so for two reasons: observation and experience. He talked like he knew his stuff. He was confident and funny, and his working history spoke for itself. I’ve known guys in the past who, to say the least, weren’t exactly cut out for their job roles.

第一个人是Scrum管理员Sajal,他自信而有远见,曾在多个开发团队和项目中推广Scrum方法,并带领他们成功交付。是的,这就是我在倾听和解读他的演讲时得出的结论,我想象自己是他持续成功演讲的一部分。萨亚尔 (Sajal) 看起来很适合这份工作。我这么说有两个原因:观察和经验。他说话好像很在行似的。他自信又风趣,他的工作经历说明了一切。过去我认识一些人,至少可以说,他们并不适合自己的工作角色。

Well, for the second guy, I somehow guessed his job even before he introduced himself as the development lead. I am kidding, he was the only guy left in the room not yet introduced. His name was Adeel, and his background was impressive. Graduated from a prestigious NIT, and he had been into developing from the beginning of his career. He’s the one with whom I would often be aligned in the coming weeks. With this, we knew each other, at least by our names and roles, but I wished to share a good professional bond with these intelligent guys.

嗯,对于第二个家伙,我甚至在他介绍自己是开发主管之前就猜到了他的工作。我开玩笑的,他是房间里唯一一个还没被介绍的人。他的名字叫阿迪尔 (Adeel),他的背景令人印象深刻。毕业于著名的NIT,从职业生涯开始就一直致力于发展。他是我在接下来的几周里经常与之结盟的人。就这样,我们彼此认识了,至少知道了我们的名字和角色,但我希望与这些聪明的家伙分享良好的职业关系。

After introductions took around half of the scheduled time, I noticed Sandeep quickly wrapped it up to get on with the real agenda. In his introduction, he didn’t say much that didn’t matter, as I had known Sandeep for quite a while, not only from the interview we had, but also from before. I had heard about his leadership and technical skills from ample people in the industry even before joining the company. He was the one I as most excited to work with.

在介绍了大约一半的时间后,我注意到桑迪普很快就结束了介绍,开始了真正的议程。

在他的介绍中,他没有说太多无关紧要的话,因为我认识桑迪普已经有一段时间了,不仅是从我们的采访中认识的,而且从之前就认识了。

在加入公司之前,我就从很多业内人士那里听说过他的领导能力和技术能力。

他是我最愿意合作的人。

As Sandeep connected his laptop to the projector, I took out my notebook like a school kid waiting for the action to begin. He then started his presentation, explaining the project from the technical as well as business perspectives.

当桑迪普把他的笔记本电脑和投影仪连接起来时,我拿出笔记本,就像一个等待表演开始的小学生一样。然后他开始了他的演讲,从技术和商业的角度解释了这个项目。

“So, guys let’s kick it off”, he said, “I had a meeting with the client regarding a product he wants us to build: a video consultation app that will help patients to interact with doctors over video conferencing. This application will not only have crucial personal information but also the medical history of all the patients. Also, the system should have the capability to search for and filter the consultant doctor and schedule appointments. Now, the first thing that comes to my mind while talking about personal data and medical history is to have a secure and robust code and system. For this, we need to take some additional measures in terms of security while developing this product. Does anyone have any questions or ideas regarding the product until now?”

“那么,伙计们,让我们开始吧,”他说,“我和客户开了个会,讨论他想让我们开发的产品:一个视频咨询应用程序,可以帮助病人通过视频会议与医生互动。

这个应用程序不仅包含重要的个人信息,还包括所有患者的病史。

此外,系统应该具有搜索和过滤咨询医生和时间表预约的能力。

现在,当谈到个人数据和病史时,我首先想到的是要有一个安全可靠的代码和系统。

为此,在开发这款产品的同时,我们需要在安全方面采取一些额外的措施。

到目前为止,有没有人对产品有什么问题或想法?

“Yes, we are clear on the big picture of the product”, Sajal acknowledged. The rest of us nodded in agreement, implying that Sandeep could continue. “That’s great”, said Sandeep. He sounded a bit excited to me as he continued while looking at me and Adeel, “So, the next thing I want you both to do is collaboratively identify the technology stack we will be using to develop this product and come up with a proposal. Meanwhile, Sajal and I will continue to discuss the high-level timeline and team build-up activity. Adeel, you must also create a proposed list of available developers for this project, and Abhishek, you can collaborate with Adeel on the tech stack. You should also get acquainted with the processes we follow and come with your queries along the way.” Why wouldn’t he be excited, this was the time for action! He concluded the meeting with an ending note, “There are two things I am sure about: first, the project is not too complex, and second, we have a strict timeline of 6 months. We have to make sure that delivery is within the agreed time period.”

是的,我们很清楚产品的总体情况. Sajal承认。

我们其他人点头表示同意,暗示桑迪普可以继续。“太好了,”桑迪普说。

他看着我和阿迪尔,听起来有点兴奋,继续说道:“那么,接下来我希望你们俩共同确定我们将用于开发这款产品的技术栈,并提出一个建议。同时,Sajal和我将继续讨论高层次的时间表和团队建设活动。Adeel,你还必须为这个项目创建一个可用开发人员的建议列表,Abhishek,你可以在技术堆栈上与Adeel合作。你也应该熟悉我们遵循的流程,并在此过程中提出你的问题。”

他为什么不兴奋呢,现在是行动的时候了!他在结束会议时说:“有两件事我可以肯定:第一,这个项目不是太复杂,第二,我们有严格的6个月的时间表。我们必须确保在约定的时间内交货。”

“Aye Aye, Sir!”, I said in my head. The excitement caused me to say it but anxiousness didn’t let it come out. Having received our tasks, Adeel and I stepped outside. Adeel asked me to meet him post-lunch as he was working on a prior task. “Meanwhile,”, he said, “you should go see Vishant. He will be working with us on this project. I’ve already informed him that you’ll be coming. He will introduce you to our processes. You both should also decide on what tech stack we should go with. Then, we’ll finalize the proposal post lunch.” As I walked to my seat, my thoughts were overriding my consciousness. I couldn’t help but think about what we were going to use: Java, Golang, React, Nodejs, Python, MySQL, Mongo, so many options to consider. I was curious about the team processes Sandeep mentioned as well. “Maybe, I’ll write it in my notebook or print it.”, I thought.

"是的是的" 我在脑子里说。兴奋使我想说出来,但焦虑使我没能说出来。接到任务后,阿迪尔和我走了出去。阿迪尔让我在午饭后见他,因为他正在处理一个事先要完成的任务。“与此同时,”他说,“你应该去找维桑特。他将和我们一起做这个项目。我已经通知他你要来。他会向你介绍我们的流程。你们俩还应该决定我们应该用什么技术堆栈。然后,午饭后我们再敲定提案。”当我走向座位时,我的思想压倒了我的意识。

我忍不住想我们要用什么:Java、Golang、React、Nodejs、Python、MySQL、Mongo,有这么多选择要考虑。我对桑迪普提到的团队流程也很好奇。“也许,我会把它写在笔记本上或打印出来。我想。

Vishant’s cubicle was right opposite mine, so finding him wasn’t a challenge. I went on to introduce myself, shared the formalities, and got on with the task. Later, we met with Adeel to draft a formal proposal.

维桑特的隔间就在我的对面,所以找到他并不是什么难事。我继续自我介绍,分担手续,然后继续工作。后来,我们与阿迪尔会面,起草了一份正式的提案。

It was just like the aura of Day One of a new project, back-to-back meetings, thoughts running, introduction with new faces, aspirations, expectations, and so on. In between all this, we all were finally prepared with our assigned responsibilities and gathered to continue where we had left off a day before.

这就像一个新项目的第一天,背靠背的会议,思想运行,介绍新面孔,愿望,期望,等等。在这一切之间,我们终于都准备好了分配给我们的责任,并聚集在一起继续我们前一天离开的地方。

“Welcome back team!”, Sandeep greeted, “Sajal and I analyzed the project and the approximate number of man-hours required to timely deliver the project. Did you guys do some groundwork in terms of the technology stack we will be going forward with?”

“欢迎回来!”桑迪普打了个招呼,“萨加尔和我分析了这个项目,以及及时交付项目所需的大约工时。”你们在我们将要使用的技术堆栈方面做了一些基础工作吗?”

“Yes, Sandeep”, replied Adeel. “I went through the requirements in detail and totally agree with you that it isn’t too complex. We prepared a high-level architecture where the approach is to divide the application into three major parts, that is, front end, back end, and database. Front end, the user-facing end of the application, can be developed on ReactJS. For the back end, user abstract logic, I opted for GoLang. And as it’s a microservice approach for the back end as well, there will be two services: one will handle the employee details and the other will be a scheduler that will transfer salary to the employees’ account. Finally, for the database requirements, we’ll be using MySQL.”, he added.

“是的,桑迪普。”阿迪尔回答。"我详细地看了一下需求,完全同意你的看法,它并不太复杂。

我们准备了一个高级体系结构,其中的方法是将应用程序划分为三个主要部分. 换言之. 前端、后端和数据库。前端,即应用程序面向用户的端,可以在ReactJS上开发。对于后端,用户抽象逻辑,我选择了GoLang。由于它在后端也是一种微服务方法,因此将有两种服务: 一个将处理员工的详细信息,另一个将是一个调度器,将工资转移到员工的帐户。最后,对于数据库需求,我们将使用MySQL。他补充道。

“Okay, sounds good. Just out of curiosity, why did you choose to go with GoLang for the back end?”, inquired Sandeep.

好吧,听起来不错。只是出于好奇,你为什么选择GoLang做后端?桑迪普问道。

Adeel smiled and said, “Well, GoLang is fast. It is compiled into machine code and doesn’t require any virtual runtime. Not only this, since we are going with distributed architecture, its concurrency feature will help us a lot in scaling. Also, we have a team available who are good at GoLang programming.”

阿黛尔笑着说:“好吧,戈朗跑得很快。它被编译成机器码,不需要任何虚拟运行时。不仅如此,由于我们采用的是分布式架构,它的并发特性将在扩展方面对我们有很大帮助。此外,我们还有一个擅长GoLang编程的团队。”

“I am all good with this if Sajal is okay. I assume you guys have already discussed and planned the resource alignment. Sajal, do you want to add anything here before we start?”, Sandeep asked.

“如果萨贾尔没事,我也没问题。我想你们已经讨论并计划了资源对齐。Sajal,在我们开始之前你还有什么要补充的吗?桑迪普问道。

“Yes, Adeel’s architecture looks good to me as well. I just want to introduce the team that will be aligned with this project. Starting from the development team, we will have four developers working under Adeel, one QA, and one DevOps. Abhishek will handle all our DevOps requirements, which will involve infrastructure, build and release, monitoring and automation required from the product development to production release”, Sajal said.

“是的,阿迪尔的建筑在我看来也不错。我只是想介绍一下将与这个项目保持一致的团队。从开发团队开始,我们将有四名开发人员在Adeel下工作,一名QA和一名DevOps。Abhishek将处理我们所有的DevOps需求,包括从产品开发到生产发布所需的基础设施、构建和发布、监控和自动化。”

The following figure is an illustration of the project stakeholders:

下图是项目干系人的图示:

Figure-1.1

With not enough to speak in the meeting and clarity around the tasks, I was mostly listening. Finally, the meeting ended with Sandeep’s boosters as he roared, “Bang-bang”.

由于在会议上没有足够的发言,也没有明确的任务,我大部分时间都在倾听。最后,会议在桑迪普的助推器声中结束,他咆哮着“砰——砰”。

Sprint-1 回顾(Retrospection)

As the high-level planning meeting ended, Sajal started sharing the real ground-level planning that he outlined for the project, which was estimated to be completed in 6 months. He ballparked the development in a 12-sprint plan of 2 weeks each, and we were currently focusing on Sprint 1 to get started. On the sprint planning day, I was trying to catch up informally with the rest of the team members.

随着高层规划会议的结束,Sajal开始分享他为该项目概述的实际地面规划,该项目预计将在6个月内完成。

他将开发分为12个Sprint计划,每个2周,我们目前专注于Sprint 1开始。在sprint计划日,我试图非正式地赶上团队的其他成员。

I have to admit, with the people involved in the project and planning sessions at the beginning, I thought this was going to be a smooth task. But who was I kidding? After 2 weeks, when the sprint was completed, the retrospective board looked something like this:

我必须承认,一开始就有很多人参与到项目和计划会议中,我认为这将是一个顺利的任务。但我在骗谁呢?两周后,当sprint完成时,回顾板看起来是这样的:

Figure-1.2

The two things that we noticed after entering the room were the whiteboard with three columns and the silence. Everyone present in the room, including me, knew the reason for the latter. Sajal finally broke the awkward silence, “With Sprint 1 coming to an end, I would like to brief the output that we delivered.”. He sounded disappointed as he further added, “We had targeted to deliver their features successfully by the end of Sprint 1, but we were able to complete only 1 feature successfully. The second feature is breaking during QA, and we haven’t started development on the third feature yet. Sandeep was also unsatisfied with the output we generated in the last sprint. So, the agenda of this meeting is to retrospect the last sprint. I want everyone to express their opinions on the same so that we can overcome the flaws and come up with better output with improved quality. Adeel, would you like to start?”

进入房间后,我们注意到的两件事是三栏的白板和沉默。在场的每个人,包括我在内,都知道后者的原因。

Sajal终于打破了尴尬的沉默,“随着Sprint 1的结束,我想简要介绍一下我们交付的输出。”

他听起来很失望,并进一步补充道:“我们的目标是在Sprint 1结束时成功交付他们的功能,但我们只成功完成了一个功能。第二个功能在QA期间中断了,我们还没有开始开发第三个功能。

Sandeep对我们在上一个sprint中生成的输出也不满意。所以,这次会议的议程是回顾上一次冲刺。我希望每个人都能发表自己的意见,这样我们就可以克服缺陷,提高质量,做出更好的产出。阿黛尔,你愿意开始吗?”

Before we go into the meeting dialogue, I’d like to add that I am the first DevOps hire of this company. Like me, Sandeep is new here as well; he joined a month before me. The last sprint was more of a noun to us than a verb as we were getting acquainted with the way things are done here. As I expected after a glance at the retrospective board, Sandeep wasn’t too happy about it as well. In the meeting, apart from me, are Sajal; Adeel; Sonia, who is aligned as QA; and the development team, including Vishant and Harsh, both of whom I know.

在我们进入会议对话之前,我想补充一下,我是这家公司的第一个DevOps员工。和我一样,桑迪普也是新来的;他比我早一个月加入。最后一次冲刺对我们来说更像是一个名词,而不是一个动词,因为我们正在熟悉这里的工作方式。正如我看了一眼回顾板后所料,桑迪普对此也不太高兴。在会议上,除了我之外,还有萨加尔;阿迪尔;索尼娅担任QA;以及开发团队,包括我认识的Vishant和Harsh。

**Adeel: “**One of the prime obstacles we are facing is increased build time because of parallel feature development. We need to create continuous features, and every compilation phase of the application takes some time; also, we need to compile code after each change, which is affecting the development cycle. This usually becomes a drag for developers. Due to this, we faced issues when a developer commits an unstable code without properly verifying, and it takes a lot of effort and time to fix the problem if they are not around.”

Adeel:“我们面临的主要障碍之一是由于并行功能开发而增加了构建时间。我们需要创建连续的特性,应用程序的每个编译阶段都需要一些时间;此外,我们需要在每次更改后编译代码,这会影响开发周期。这通常会成为开发人员的累赘。因此,当开发人员提交不稳定的代码而没有进行适当的验证时,我们就会面临问题,如果他们不在,我们就需要花费大量的精力和时间来解决问题。”

**Sajal: “**Hmm, it seems you guys are facing problems with code stability. Anyhow, let’s talk about the solution later. Let’s hear out all issues first.”

Sajal:“嗯,看起来你们面临着代码稳定性的问题。不管怎样,我们稍后再讨论解决方案。让我们先听听所有的问题。”

Sonia: “We’ve had to invest a lot of time addressing basic problems like insecure dependencies. If we don’t consider this check, we will have a big risk of a security breach in our application. So, we have to ensure that our code does not have any vulnerabilities.”

索尼娅:“我们不得不投入大量时间来解决不安全依赖等基本问题。如果我们不考虑这个检查,我们的应用程序将有很大的安全漏洞风险。所以,我们必须确保我们的代码没有任何漏洞。”

Adeel: “Our coding standard is not assured because there is no method and variable naming convention that makes it difficult for developers to understand code. We do have to spend a huge amount of time doing simple application checks, such as code smells and redundant code.”

Adeel:“我们的编码标准不确定,因为没有方法和变量命名约定,这使得开发人员难以理解代码。我们必须花费大量时间进行简单的应用程序检查,例如代码异味和冗余代码。”

**Sajal: “**Seems like we don’t have good-quality code. Let’s bring it into action items as well. What about testing, do we face any problems while testing code?”

Sajal:“似乎我们没有高质量的代码。让我们把它也变成行动项目。那么测试呢,我们在测试代码的时候会遇到什么问题吗?”

**Adeel: “**Yes, I was about to come to this one. Well, it’s not too much, but we face problems while integrating code as well because it takes a lot of effort to find bugs and most of the time, defects are in other dependent modules.”

阿迪尔:“是的,我正要说到这一点。嗯,这并不是太多,但是我们在集成代码时也会遇到问题,因为查找错误需要花费很多精力,而且大多数时候,缺陷存在于其他相关模块中。”

**Harsh: “**I would like to add a comment as well. We have to put a lot of work into code review to find integration problems. As a result, our development time gets affected.”

哈什:“我也想补充一点评论。我们必须在代码审查中投入大量工作来发现集成问题。因此,我们的开发时间受到了影响。”

**Sonia: “**Conditional scenarios were also not covered properly, which resulted in a lot of bugs, and in some cases, business units were also not covered. There were many places where certain vulnerable dependencies were used, and other parts of the code were subject to potential threats. So, it would be easy for anyone to break into the system.”

Sonia:“有条件的场景也没有得到适当的覆盖,这导致了很多bug,在某些情况下,业务单元也没有被覆盖。有许多地方使用了某些易受攻击的依赖,并且代码的其他部分受到潜在威胁。所以,任何人都很容易闯入这个系统。”

Sajal: “Okay, any other issues in the testing part?”

Sajal:“好的,测试部分还有其他问题吗?”

**Sonia: “**Well, since you have asked, we have to execute Regression, Smoke, and Browser testing manually for each snapshot release of the code, and it takes a lot of time.”

索尼娅:“嗯,既然你问了,我们必须为每个快照版本的代码手动执行回归、烟雾和浏览器测试,这需要花费很多时间。”

**Sajal: “**Well, seems like there is a lot of scope for improvement in code testing. So, any other issues that need to be discussed before we start the discussion over these problems?”

Sajal:“嗯,看起来代码测试还有很大的改进空间。那么,在我们开始讨论这些问题之前,还有其他问题需要讨论吗?”

Adeel: “I think we need to define a better branching strategy as well because right now we have only one development branch. This creates issues for one developer because another developer’s code is still in the development phase, and since they are using the same branch, developers have to wait for one another to complete their code.”

Adeel:“我认为我们也需要定义一个更好的分支策略,因为现在我们只有一个开发分支。这给一个开发人员带来了问题,因为另一个开发人员的代码仍处于开发阶段,而且由于他们使用的是同一个分支,开发人员必须等待彼此完成代码。”

Sajal: “Well that’s a good point! Does anyone want to add anything we haven’t discussed yet?”

Sajal:“这是一个很好的观点!有没有人想补充一些我们还没有讨论过的内容?”

Everyone: “Nothing from our side.”

大家:“我们这边没有。”

Sajal: “Okay, anyone wants to talk about why we’re struggling with these problems and share some ideas for addressing them?”

Sajal:“好吧,有没有人想谈谈我们为什么要与这些问题作斗争,并分享一些解决这些问题的想法?”

Light of Hope

Finally, the moment that I had dreamed about had arrived, landing like Iron Man at the Stark expo event. All the problems discussed can be handled quite efficiently using a CI/CD pipeline. By now, it was clear that these folks had not been introduced to such a system of releases. Well, now is as good a time as any to get started.

终于,我梦寐以求的时刻到来了,像钢铁侠一样出现在史塔克的博览会上。使用CI/CD管道可以非常有效地处理讨论的所有问题。到目前为止,很明显,这些人还没有接触过这样一个发布系统。好吧,现在就是开始的好时机。

Me: “As you said earlier, we don’t get good quality and consistency in code. I completely agree with that. I also think that we have issues with unit testing, code coverage, security scanning, and even functional testing.”

我:“就像你之前说的,我们没有得到好的质量和一致性的代码。我完全同意这一点。我还认为我们在单元测试、代码覆盖、安全扫描甚至功能测试方面也存在问题。”

Sajal: “Exactly, do you have anything on your mind to fix this, or anybody else would like to share their thoughts?”

Sajal:“没错,你有什么想法来解决这个问题吗?或者还有其他人想分享他们的想法吗?”

Me: “I think we can incorporate CI into the microservice we are developing, from which the development team will receive continuous feedback that will improve the efficiency and quality of development. We can also include testing in our CI pipeline where the pipeline itself can conduct basic testing, which would allow the QA team to concentrate on more pressing business requirement testing. I have a good understanding of CI and can guide you.”

我:“我认为我们可以将CI整合到我们正在开发的微服务中,开发团队将从中获得持续的反馈,从而提高开发的效率和质量。我们还可以在CI管道中包含测试,管道本身可以执行基本测试,这将允许QA团队专注于更紧迫的业务需求测试。我对CI很了解,可以指导您。”

**Sajal: “**Sounds good. Does anyone have any questions or views on this strategy?”

Sajal:听起来不错。有人对这一战略有什么问题或看法吗?”

Adeel: “I like the idea of incorporating CI. It will surely increase our development and testing efficiency. I think this is a good time to pick this up. I have been reading and found that it increases the SDLC process efficiency by a huge amount. I had this discussion with Harsh some time ago. We were only waiting for somebody with expertise in it.”

Adeel:“我喜欢整合CI的想法。这必将提高我们的开发和测试效率。我觉得现在是讨论这个问题的好时机。我一直在阅读,发现它极大地提高了SDLC的流程效率。不久前我和哈什讨论过这个问题。我们只是在等一个在这方面有专长的人。”

Sonia: “The plan sounds good to me.”

索尼娅:这个计划听起来不错。

Sajal: “Great! So, Abhishek, do you have any plan in your mind as to how we can implement this process?”

Sajal:“太好了!那么,阿比舍克,你心中有什么计划,我们如何实施这一进程?”

Me: “Yes, I do have some points in my mind, but I would like some time to evaluate them further so that we can implement them with the best practices.”

我:“是的,我确实有一些想法,但我需要一些时间来进一步评估它们,以便我们可以用最佳实践来实现它们。”

Sajal: “Sure, so you can draw a detailed plan, and we can discuss it in the next meeting. I will share the next meeting invite.”

Sajal:“当然,这样你就可以画一份详细的计划,我们可以在下次会议上讨论。我将分享下次会议的邀请。”

“Great, I will try to come up with a plan of action.”, I affirmed as my team saw a light of hope.

“太好了,我会想出一个行动计划。我肯定地说,我的团队看到了希望之光。

And here, the real challenge started for me as I had to draft a proposal. Thankfully, I had already been involved in the sprint, which made it easy. Sometimes I feel so grateful to our open-source community, especially the pioneers like Eric Raymond, Linus Torvalds, and Martin Fowler who laid the foundation. Where would we have been without them? Our whole career exists because of the decisions we made and the actions we took. The DevOps movement is just another fruit of their humongous tree.

在这里,真正的挑战开始了,我必须起草一份提案。谢天谢地,我已经参与了冲刺,这让事情变得容易了。有时候我很感激我们的开源社区,尤其是像Eric Raymond、Linus Torvalds和Martin Fowler这样的先驱,他们奠定了开源社区的基础。如果没有他们,我们会在哪里?我们的整个职业生涯都是因为我们做出的决定和采取的行动而存在的。DevOps运动只是他们巨大树上的另一个果实。

We are planning to include bits of trivia at different places in the book. The following links are part of that.

我们计划在书的不同地方包括一些琐事。以下链接是其中的一部分。

CI Trivia

  • https://dzone.com/articles/continuous-integration-and-its-whereabouts
  • https://en.wikipedia.org/wiki/Continuous_integration
Last Updated:
Contributors: jk