Feature #30069
openUse GitHub Actions as a secondary CI solution to run tests through the existing mirroring
0%
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:- https://gitlab.com/marius-balteanu/redmine/blob/feature/gitlab_integration/.gitlab-ci.yml which is the gitlab file that enables the integrations
- https://gitlab.com/marius-balteanu/redmine/pipelines: test results for each commit.
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
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. :)
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.
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.
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...
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.
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?
Updated by Marius BĂLTEANU over 4 years ago
- File pipeline.png pipeline.png added
Updated the branch to run the tests against SQL Server 2017 (linux version) and Style lint (#32888).
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.
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).- Pull Request: https://github.com/sanak/redmine/pull/2
- Test Result: https://github.com/sanak/redmine/actions
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.
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
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.
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.
Updated by Mizuki ISHIKAWA 7 days ago
- File 0002-Add-SCM-tests-bazaar-cvs-bazaar-non-ascii.patch 0002-Add-SCM-tests-bazaar-cvs-bazaar-non-ascii.patch added
- File 0001-Simplify-environment-setup-in-tests.yml.patch 0001-Simplify-environment-setup-in-tests.yml.patch added
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).
Updated by Mizuki ISHIKAWA 7 days ago
- File 0002-Add-SCM-tests-bazaar-cvs-bazaar-non-ascii.patch 0002-Add-SCM-tests-bazaar-cvs-bazaar-non-ascii.patch added
I made some adjustments to the 0002 patch.
Here's what it looks like when executed: https://github.com/ishikawa999/redmine/actions/runs/11868149611
Updated by Marius BĂLTEANU 7 days ago
Thanks Mizuki ISHIKAWA, very nice work, I've committed both patches.
Updated by Marius BĂLTEANU 7 days ago
- added autoload test
- added stylelint checks
Updated by Marius BĂLTEANU 7 days ago
Should we also add bundle-audit check --update
to lints?
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.
Updated by Marius BĂLTEANU 5 days ago
bundle exec bundle audit check --update
added to lints in r23291.