简体   繁体   English

gitflow-如何合并以掌握和保持依赖关系正常工作?

[英]gitflow - how to merge to master and keep dependencies working?

I have a project with 2 repositories. 我有一个包含2个存储库的项目。 Repository 1 depends on repository 2 using git urls. 存储库1依赖于使用git url的存储库2。

We are using gitflow, but we don't understand how to do a release that works. 我们正在使用gitflow,但我们不知道如何制作有效的版本。

Our dependency between repository1 and repository2 is pointing to develop branch, and once we release, all the code moves to master branch, but the dependency is still looking at develop branch! 我们在repository1和repository2之间的依赖关系指向develop分支,一旦发布,所有代码都移至master分支,但是该依赖关系仍在develop分支上!

On the other hand, we cannot have the dependency looking at master branch all the time too.. 另一方面,我们也不能一直使依赖项一直在查看master分支。

It seems as if we need to make a change in the code when releasing, one that will change the dependency url, but that is against git flow as master should not have commits that are not merges 似乎我们在发布时需要对代码进行更改,这将更改依赖项url,但是这与git flow背道而驰,因为master不应具有未合并的提交

What are we doing wrong and how can we achieve a proper release? 我们做错了什么,如何实现适当的发布?

Example

2 teams working on different git repositories for nodejs projects. 2个团队为不同的git存储库工作,分别用于nodejs项目。

One team is dependent on the other, so in order to get all their latest changes every day, they write the following npm dependency 一个团队依赖另一个团队,因此为了每天获取所有最新更改,他们编写了以下npm依赖关系

"otherTeam": "git://github.com/sameProject/otherTeam.git#develop",

see the develop at the end of the dependency url? 看到依存网址末尾的发展?

at the end of development, this should be master - the a tag name. 在开发结束时,这应该是主标记-标签名称。

How can I achieve that without making commits directly to master during the release time? 如何在发布期间不直接向master提交的情况下实现该目标?

Different Release Cycle 不同的发布周期

Thank you @Graham for this comment. 谢谢@Graham的评论。

If I understand correctly - you suggest to release component1, and then update dependency version continuously on component2 to point to the new realse for 1. Then component1 should stop development for current version at some point - which means component2 does not need to update dependency anymore, and then component2 will eventually reach end of version and then we can release the entire product. 如果我理解正确,那么建议您发布component1,然后在component2上连续更新依赖项版本,以指向1的新领域。然后component1应该在某个时候停止当前版本的开发-这意味着component2不再需要更新依赖项,然后component2最终会到达版本的末尾,然后我们可以发布整个产品。

correct me if I misunderstood you. 如果我误解了你,请纠正我。

This solution was raised in the company, but concerns were raised about this procedure not being automatic enough. 该公司提出了该解决方案,但对于此过程的自动化程度不足感到担忧。 The company wants all the components to be built together, have the same version etc... 该公司希望所有组件都可以一起构建,并具有相同的版本等。

You'll have to forgive my Java background and relate certain points to the node.js ecosystem. 您必须原谅我的Java背景,并将某些要点与node.js生态系统相关联。

Given a dependency on a library, for example a template rendering library, I would treat it completely separately from the main web application. 给定对库(例如模板渲染库)的依赖,我将与主Web应用程序完全分开对待。

To enable usage in the web app usually I would pull a version of the library down using a dependency manager, eg Ivy/Maven. 为了在Web应用程序中启用使用,通常我会使用依赖管理器(例如Ivy / Maven)下拉库的版本。

Generally I prefer explicit versions when eventually releasing. 通常,我最终发布时更喜欢显式版本。 This enables you to know what is being used and helps narrow down issues related to a certain version of a dependency. 这使您可以了解正在使用的内容,并有助于缩小与特定版本的依赖项有关的问题。 The overhead of knowing what you have shipped to a customer, so you know what to fix greatly out ways an automatic process. 了解您向客户运送的商品的开销,因此您知道如何通过自动流程极大地解决问题。 As in an automatic process this information is lost. 在自动过程中,此信息会丢失。

Additionally the version for the template library would relate only for this library and would be different to the main web app. 此外,模板库的版本仅与此库相关,并且与主Web应用程序不同。 This allows you to reuse the library elsewhere. 这使您可以在其他地方重用该库。

To enable a more automatic process whilst developing a release of the main web app you could pull down the latest version until the release branch is ready. 要在开发主Web应用程序的发行版时启用更自动化的过程,可以下拉最新版本,直到发行版分支就绪为止。 At this point making a release of the template library and making the web app use an explicit version. 此时,发布模板库并使Web应用使用显式版本。

You could always pull down the latest versions of the dependency if you wish, (at least I know how to do that with Ivy) but I would consider it slightly risky. 如果愿意,您可以始终获取最新版本的依赖关系(至少我知道如何使用Ivy),但是我认为这样做有些冒险。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM