改进GitHub上的项目工作流程

时间:2017-10-31 07:53:41

标签: git github travis-ci

我目前正在开发一个开源云项目。该项目在GitHub上有它的存储库,它不在我的控制之下。 我有自己的分叉存储库,我已经在其上集成了Travis CI,以自动构建我的代码并运行我的测试用例。您需要许多文件,例如.travis.yml文件,您需要在其上推送GitHub来触发Travis。我正在使用Rakefile来运行我的单元测试。

问题是项目的主存储库不在我的控制之下,并且存储库的所有者不想使用它配置Travis CI。因此,如果我生成一个pull请求,我需要确保我的测试文件(例如.travis.yml或Rakefile)都不会在pull请求中生成。当然我可以删除这些文件,但它们仍然会出现在提交历史记录中,这正是我想要避免的。每当生成拉取请求时,我都不希望Travis CI的任何痕迹到达主存储库。

为实现这一目标,商定了以下工作流程:

 1. Fork project repository in your own GitHub account.
 2. Clone it in your local computer. Set up the main repository as your upstream 
    repository.
 3. Create a testing branch from the master branch and push it on origin (your account).
 4. Before you start working on a new feature, pull the latest code from the upstream 
    repository into both the master as well as the testing branch.
 5. Add the .travis.yml and other test files that you need to activate Travis CI in the 
    testing branch and once again push to origin.
 6. Create a feature branch from the master branch. 
 7. Do all your work on the feature branch. Write code, run tests.
 8. When feature is ready, take the latest code pull from the upstream repo. 
    Resolve any merge conflicts that happen.
 9. Generate Peer Reviews.
10. [Peer Reviews Passed] Merge feature branch into the testing branch.
11. Push the testing branch on origin. This will activate Travis CI
12. [Travis Passed] Generate Pull Request. Your work is done.
13. [Travis Failed] Travis CI has failed your tests. Repeat Step 7.

要想象这一点,请看下面的图表

=> Project Workflow Diagram

我的问题是可以帮助我改进这个工作流程吗?正如您所看到的,每次将代码合并到测试分支中以触发Travis CI都会产生大量开销。

0 个答案:

没有答案