Project

General

Profile

Actions

Feature #30069

open

Use GitHub Actions as a secondary CI solution to run tests through the existing mirroring

Added by Marius BĂLTEANU almost 6 years ago. Updated 5 days ago.

Status:
New
Priority:
Normal
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

Actions #1

Updated by Anonymous almost 6 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ý almost 6 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 almost 6 years ago

Hopefully soon™...

Actions #4

Updated by Marius BĂLTEANU over 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ý over 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 5 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 5 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 over 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 2 years 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 about 2 years 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 #11

Updated by Marius BĂLTEANU 11 days ago

  • Subject changed from Integrate Redmine with GitLab (or other free CI system for open source) to run tests to Use GitHub Actions as a secondary CI solution to run tests through the existing mirroring
  • Assignee set to Marius BĂLTEANU
  • Target version set to 6.1.0

In May, we integrated in r22813 a simple Github action to run the Rubocop lint on Github mirror maintained by the community (https://github.com/redmine/redmine). The integration was quite useful to catch faster the offenses.

Yesterday, I've also added in r23254 an action to run the core tests on a matrix (ruby 3.1, 3.2, 3.3 on postgresql and mysql) and it works well until now.

Please feel free to post to this tickets improvements for those tests if you already have an working action, I think it will be very useful to have at least the system tests (selenium or playwright) running there.

Actions #12

Updated by Katsuya HIDAKA 9 days ago

Currently, the CI is failing due to an error when executing apt-get install.

...
E: Failed to fetch mirror+file:/etc/apt/apt-mirrors.txt/pool/main/g/ghostscript/libgs9-common_9.55.0%7edfsg1-0ubuntu5.9_all.deb  404  Not Found [IP: 52.252.75.106 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Following the above error message, it seems this issue can be resolved by applying the following modification.

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index d35d57406..7017286d4 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -47,10 +47,9 @@ jobs:
         uses: actions/checkout@v4

       - name: Install package dependencies
-        run: >
-          sudo apt-get install --yes --quiet
-          ghostscript
-          gsfonts
+        run: |
+          sudo apt-get update
+          sudo apt-get install --yes --quiet ghostscript gsfonts

       - name: Allow imagemagick to read PDF files
         run: |

After applying this patch, the CI ran successfully.
https://github.com/hidakatsuya/redmine/actions/runs/11840409772/job/32994163366

Actions #13

Updated by Katsuya HIDAKA 9 days ago

I think it will be very useful to have at least the system tests (selenium or playwright) running there.

I agree. In my opinion, to ensure the sustainability of the test code for system tests, it is essential to always run them in CI.

Actions #14

Updated by Go MAEDA 9 days ago

Katsuya HIDAKA wrote in #note-12:

Currently, the CI is failing due to an error when executing apt-get install.

[...]

Following the above error message, it seems this issue can be resolved by applying the following modification.

[...]

After applying this patch, the CI ran successfully.
https://github.com/hidakatsuya/redmine/actions/runs/11840409772/job/32994163366

I have committed the fix in r23270. Thank you.

Actions #15

Updated by Mizuki ISHIKAWA 7 days ago

It's wonderful that tests are being executed via GitHub Actions.
I've added two patches to improve tests.yml. The 0002 patch adds support for testing additional SCM types (Bazaar, CVS, and Bazaar non-ASCII).

Actions #17

Updated by Marius BĂLTEANU 7 days ago

Thanks Mizuki ISHIKAWA, very nice work, I've committed both patches.

Actions #18

Updated by Marius BĂLTEANU 7 days ago

I made more improvements:
  • added autoload test
  • added stylelint checks
Actions #19

Updated by Marius BĂLTEANU 7 days ago

Should we also add bundle-audit check --update to lints?

Actions #20

Updated by Mizuki ISHIKAWA 5 days ago

Should we also add bundle-audit check --update to lints?

I think that's a great idea! Adding bundle-audit check --update to lints would help ensure dependency security checks are consistently enforced. I've seen other repositories running bundle-audit check --update in their GitHub Actions workflows as well.

Actions #21

Updated by Marius BĂLTEANU 5 days ago

bundle exec bundle audit check --update added to lints in r23291.

Actions

Also available in: Atom PDF