Project

General

Profile

Actions

Feature #30069

open

Integrate Redmine with GitLab (or other free CI system for open source) to run tests

Added by Marius BĂLTEANU over 5 years ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

On my local development box, I've a lot of branches with my entire work for Redmine. These branches contain features or bug fixes in a stable phase that are already posted on Redmine.org or my work in progress for future features or bug fixes that are not public yet.

Most of the time, before posting a patch on Redmine.org, I'm running the entire test suite just to be sure that I do not break any existing test. If the tests pass, I'm uploading the patch/patches. I assume that when reviews a patch uploaded by me, Go Maeda runs the tests on his local environment (from the same reason). So there are at least 2 times in this happy scenario. If the patch needs some changes after the initial review, we run the tests more than 2 times in total. The same situation when I need to check the patch against master and other stable branch (for ex: 3.4-stable).

Other case is when some commits were been made on the trunk and the patches that I've posted need to be rechecked against the new trunk in order to be sure that they still apply cleanly and the tests pass. Here is the most consuming time for me because I need to run the tests on my local environment for each patch/branch.

I'm saying time consuming because even if the total time to run the tests is ~6 minutes, in that time my local development is blocked (I cannot touch the code). And if I need to do the same operation 5 times => 40 minutes while I cannot touch Redmine development box.

What it will be very useful for me is to integrate Redmine with an open source CI service (GitLab or Travis) in order to delegate all these tests there. I think that it will be useful also for other contributors. I'm not saying that I want to change the current workflow, I just want to have the possibility to run the tests there and if everything is ok, to upload the patch here as we currently do.

I made a branch on GitLab to prove this integration, it can be found here:

The code is automatically fetch by GitLab from the GitHub repository and because I'm member and the owner of the repo, I can push additional branches on the repository. If the file is committed to Redmine, I won't have to add the file each time when I'm pushing branch that I make and also, I won't need to pay attention to exclude the file from the patch before uploading it to Redmine.org.

I chose GitLab because I'm using it at work and have some integrations/features that we can benefit from in the future. Also, I'm very ok with any other service.


Files

pipeline.png (101 KB) pipeline.png Marius BĂLTEANU, 2020-04-18 13:22
Actions #1

Updated by Anonymous over 5 years ago

+1
However technically tough that could sound (since I'm not even a web dev XD), less time consuming = faster, and anything that has a potential to speed up the development and generally make it less stressful, is imho should be welcomed. :)

Actions #2

Updated by Pavel Rosický over 5 years ago

+1

Yes, it's very time consuming to contribute and also for maintainers to verify existing patches.

If you don't want to move to git which was discussed and rejected many times, please at least enable travis on
https://github.com/redmine/redmine
or make a GitLab account and allow to post patches for contributors.

it's an easy change that will save time to everyone.

Actions #3

Updated by Anonymous over 5 years ago

Hopefully soon™...

Actions #4

Updated by Marius BĂLTEANU almost 5 years ago

I made two changes:
1. Moved the repository from my namespace to a new one created 'redmine-org'.
2. Changed the visibility to public.

If you consider it shouldn't be public, please let me know. I'm still using it to keep my work and run the tests.

Actions #5

Updated by Pavel Rosický almost 5 years ago

are you about to open it for constributors? in such case all stable branches should be marked as protected.

for me it would be much easier. I'll instantly know about potential conflicts or if tests are green without even setting a local enviroment...

Actions #6

Updated by Marius BĂLTEANU over 4 years ago

Pavel Rosický wrote:

are you about to open it for constributors? in such case all stable branches should be marked as protected.

for me it would be much easier. I'll instantly know about potential conflicts or if tests are green without even setting a local enviroment...

I'm open only to accept new branches to be pushed in order to have the tests run in GitLab CI. Any merge to stable branches it is useless.

Actions #7

Updated by Marius BĂLTEANU over 4 years ago

In the meantime, I've added Rubocop checks to the pipeline. Test results here.

Go Maeda, I'm planning to add Postegres as well and after that, it's there any chance to have this file committed? Right now I'm cherry picking a commit for every branch that I want to run tests and it's annoying. Or do you prefer to have Jean-Philippe feedback on this?

Actions #8

Updated by Marius BĂLTEANU almost 4 years ago

Updated the branch to run the tests against SQL Server 2017 (linux version) and Style lint (#32888).

Actions #9

Updated by Peter Volkov over 1 year ago

In my opinion, the absence of this feature really slows down development. Also, such integration may help other projects that are using gitlab/redmine together. We are using redmine to work with tickets but we also have to use gitlab for CI/CD.

Actions #10

Updated by Ko Nagase over 1 year ago

+1 to add .gitlab-ci.yml to redmine svn repository, because it will not affect existence rails code and test results.

Related with this topic, I am trying to create GitHub Actions on my GitHub fork branch with referring your ".gitlab-ci.yml" and Japan Redmine Patch Meetup GitHub Actions (https://github.com/redmine-patch-meetup/redmine-dev-mirror/blob/develop/.github/workflows/test.yml).
Actions

Also available in: Atom PDF