Adding dependencies to a project often helps you not reinvent the wheel. But at the same time it can cause issues in many different aspects of the project:

将依赖项添加到项目中通常可以帮助您不必浪费时间。 但是同时,它可能在项目的许多不同方面引起问题:

  • Versioning: sometimes dependencies can require specific versions of other dependencies and this can cause hiccups in your app版本控制:有时依赖项可能需要其他依赖项的特定版本,这可能会导致应用程序出现故障
  • Bundling: you need to be careful not to end up with too much extra code that will bloat your bundles捆绑:您需要注意不要以过多的额外代码结束,这些额外的代码会使捆绑包膨胀
  • Updating: JavaScript moves fast, and if you don't update packages regularly you'll be playing Jenga in the future.更新:JavaScript运行Swift,如果您不定期更新软件包,则将来会玩Jenga。

There are different tools to cover the task of updating dependencies, like Dependencies.io, Snyk, and Dependabot. Since I have been using Dependabot for a while, I decided to write about my experience.

有很多工具可以满足更新依赖项的任务,例如Dependencies.io , Snyk和Dependabot 。 由于使用Dependabot已有一段时间,因此我决定写自己的经验。

Dependabot is a tool acquired by GitHub a year ago that checks dependency files from different languages (Ruby, JavaScript, Python, PHP, Elixir, to name a few) and finds new versions of libraries you are using in your project. Here is the setup:

Dependabot是GitHub一年前购买的工具,用于检查来自不同语言(例如Ruby,JavaScript,Python,PHP,Elixir等)的依赖项文件,并查找项目中使用的库的新版本。 这是设置:

Daily updates can be overwhelming, and I think that weekly updates have a better cost/benefit. Also, I assign myself the Pull Requests so I can get notifications as soon they are opened.

每日更新可能不胜枚举,我认为每周更新具有更好的成本/收益。 另外,我为自己分配了“拉取请求”,这样我就可以在打开请求后立即收到通知。

如何有效使用Dependabot (How to use Dependabot effectively)

Dependabot includes, in each PR, release notes, changelogs, commit links and vulnerability details whenever available. This is useful because you can take a look at the information and decide to proceed or not.

Dependabot在每个PR中都包括发行说明,变更日志,提交链接和漏洞详细信息(如果可用)。 这很有用,因为您可以查看信息并决定是否继续。

However, as pragmatic programmers, we want to ensure things won't break. The PR details are important but more than that, we want a simulation of all (or almost all) deliverables that the project has.

但是,作为务实的程序员,我们希望确保一切都不会中断。 PR的细节很重要,但除此之外,我们还需要模拟项目中所有(或几乎所有)可交付成果。

This screenshot shows what happens every time a PR is opened in the components library codebase of my work.

此屏幕快照显示了每次在我的组件库代码库中打开PR时发生的情况。

  • Tests (Jest / Bundle): the Jest task will test the React components while the Bundle task will simulate the bundling commands we run when we want to update the package in the NPM registry

    测试(Jest / Bundle) :Jest任务将测试React组件,而Bundle任务将模拟我们要更新NPM注册表中的包时运行的捆绑命令

  • Linters (Stylesheets / JavaScript): the stylesheet files follow a custom sass-lint setup and the JS code follows a series of ESLint rules. If a PR introduces a new version of a linter with new rules, we will be able to capture that.

    Linters(样式表/ JavaScript) :样式表文件遵循自定义的sass-lint设置,而JS代码遵循一系列ESLint规则。 如果PR引入了具有新规则的短绒棉新版本,我们将能够捕获到它。

  • Cypress (Screenshot Testing / Accessibility Testing): if a new package introduces changes that may be reflected in the look and feel of components, Cypress will capture the difference, screenshot it, and store in S3. Since Cypress needs a live version of the documentation website, we also get the Gatsby build process covered.

    赛普拉斯(屏幕快照测试/可访问性测试) :如果新软件包引入了可能反映在组件外观上的更改,则赛普拉斯将捕获差异并将其截图并存储在S3中。 由于赛普拉斯需要文档网站的实时版本,因此我们也涵盖了盖茨比的构建过程。

With all these steps, it is very unlikely an external package will break our master branch. Kudos to my co-worker Grant Lee that also works on this project.

通过所有这些步骤,外部软件包几乎不可能破坏我们的master分支。 我的同事格randint·李(Grant Lee)也参与这个项目,对此我感到很荣幸。

Also posted on my blog. If you like this content, follow me on Twitter and GitHub. Cover photo by Zhang Kenny on Unsplash

也张贴在我的博客上 。 如果您喜欢此内容,请在Twitter和GitHub上关注我。 张肯尼的封面照片在《 Unsplash》上

翻译自: https://www.freecodecamp.org/news/using-dependabot-to-keep-your-environment-up-to-date/

如何使用Dependabot保持环境最新相关推荐

  1. cocos2dx配置Android环境最新教程

    cocos2dx配置Android环境最新教程 这几天在研究cocos2mdx怎么在Android studio下配置环境,一开始根据官网的过期教程走了不少歪路,虽然现在网上也有大致正确的安装教程,但 ...

  2. hnc8进linux环境,最新发布linux指令大全总汇详解完整珍藏版-8

    最新发布linux指令大全总汇详解完整珍藏版-8.txt这是一个禁忌相继崩溃的时代,没人拦得着你,只有你自己拦着自己,你的禁忌越多成就就越少.自卑有多种档次,最高档次的自卑表现为吹嘘自己干什么都是天才 ...

  3. Ubuntu18.04安装最新R语言环境的方法

    写在前面 最近学习R语言,在Windows环境配置很简单,但是导出的PDF不尽人意,于是选择Ubuntu来搞,可惜一开始我还是太天真,直接sudo apt install r-base了,导致安装的R ...

  4. 5款最佳Linux桌面环境的优缺点比较

    如果你刚接触Linux,那么我确信你准花了大量的时间为你的Linux发行版选择桌面环境.你可能在想每一种桌面环境都试一下,不过这很耗费时间.外头有好多优秀的桌面环境.这就是为什么我测评了5款最佳Lin ...

  5. 炫彩界面库UI设计器分享, 集成开发环境,C++,易语言

    炫彩在线帮助文档 炫彩UI截图 炫彩IDE UI设计器  截图 炫彩webUI  炫彩缓动 炫彩 易语言 火山PC例子截图 简介 炫彩界面库–软件界面开发框架,让用户快速开发桌面软件变的简单高效;功能 ...

  6. 1.从零开始搭建Go语言开发环境

    搭建Go语言开发环境 最新1.14版本,一步一步,从零搭建Go语言开发环境. 安装Go语言及搭建Go语言开发环境 下载 下载地址 Go官网下载地址:https://golang.org/dl/ Go官 ...

  7. windows平台下基于QT和OpenCV搭建图像处理平台

        在之前的博客中,已经分别比较详细地阐述了"windows平台下基于VS和OpenCV"以及"Linux平台下基于QT和OpenCV"搭建图像处理框架,并 ...

  8. 在GPU上运行,性能是NumPy的11倍,这个Python库你值得拥有

    导读:NumPy是数据计算的基础,更是深度学习框架的基石.但如果直接使用NumPy计算大数据,其性能已成为一个瓶颈. 随着数据爆炸式增长,尤其是图像数据.音频数据等数据的快速增长,迫切需要突破NumP ...

  9. VMware产品支持倒计时

    VMware产品支持倒计时 此页面显示VMware产品达到其支持终止(EOS)阶段的倒计时.关注支持是非常重要的,因为"EOS"产品不再接收VMware的安全更新或错误修正.始终保 ...

最新文章

  1. Clang-Format: Visual Studio Style
  2. HDU - 3538 A sample Hamilton path(最短哈密顿路径+状压dp)
  3. 会飞的汽车来了!旋翼式陆空两栖智能飞车研发成功
  4. linq 解决winForm中控件CheckedListBox操作的问题。(转载)
  5. 禁用F12和鼠标右键,防止查看控制台代码
  6. STM32F4 使用STLink 和 EventRecoder 调试运行时间
  7. 从MapReduce的执行来看如何优化MaxCompute(原ODPS) SQL 1
  8. thinkphp中mysql添加数据_thinkphp添加数据 add()方法
  9. Runtime底层原理探究(二) --- 消息发送机制(慢速查找)
  10. [置顶] MySQL -- 创建函数(Function
  11. 【第三课】ANR和OOM——贪快和贪多的后果(上)
  12. 什么是ibatis?(供初学ibatis的人阅读)
  13. python运维平台开发_python运维平台的设计
  14. wp7 XAP部署工具
  15. svn分支管理的使用与经验
  16. 玩与学 | 《乐高EV3机器人搭建与编程》
  17. 微信小程序实现底部导航栏自定义tabBar
  18. 格力董明珠:对别人狠,对自己更狠!
  19. 非洲正在打造一个完全不同的人工智能产业
  20. svn process exited with error code: 1

热门文章

  1. 【今日CV 计算机视觉论文速览】Thu, 28 Feb 2019
  2. Spring—使用类加载从配置文件中读取配置
  3. 数据表的查询 sqlserver 基本的三个查询
  4. mysql权限相关操作
  5. 目录浏览控件fbd c# 1614612744
  6. sqlserver增删改格式整理 1123
  7. 08 在C#程序中使用注释测试分析 1214
  8. Laravel服务提供者在平台短信服务中的应用
  9. PHPmyadmin 和 MySQL 的配置笔记
  10. slider改变对话框颜色