New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gitlab-ci include:local not working #6713
Comments
Can you help me understand how this functionality works? Is the included local file typically another gitlab CI file, in which case will we end up with duplicate extracted dependencies? Or is it a file we wouldn't normally index? |
The Official documentation: https://docs.gitlab.com/ee/ci/yaml/#includelocal |
OK, in that case we're going to need the extract function to add a new field to such cases, named something like |
Ok, so implementing a |
No need for a new function. We just need the extra field added to the existing results |
Including the renovate/lib/manager/gitlabci-include/extract.ts Lines 55 to 57 in 74b6669
But currently |
It needs to be resolved though, not relative |
Needs:
|
We are using renovate 23.28.0 and noticed that the remote includes are also not working. The file gets matched for the manager but the manager doesnt detect anything in the file. |
using this in 23.49.7 and renovate correctly follows the include and detects the changes but fails when applying because it tries to apply them on the main .gitlab-ci.yml file instead of the individual included file paths |
If local files are imported from the GitLab CI YAML file, the dependencies will be recognized but not updated by renovate. Renovate needs to respect the 'include:local' imports and update the depedependencies in those files. Related to renovatebot#6745 Fixes renovatebot#6713
I've created a PR (#8805) to fix this problem. |
If local files are imported from the GitLab CI YAML file, the dependencies will be recognized but not updated by renovate. Renovate needs to respect the 'include:local' imports and update the depedependencies in those files. Related to renovatebot#6745 Fixes renovatebot#6713
This comment has been minimized.
This comment has been minimized.
If local files are imported from the GitLab CI YAML file, the dependencies will be recognized but not updated by renovate. Renovate needs to respect the 'include:local' imports and update the depedependencies in those files. `extractPackageFile` is replaced by `extractAllPackageFiles` since the functionality of those two functions are the same. Related to renovatebot#6745 Fixes renovatebot#6713
If local files are imported from the GitLab CI YAML file, the dependencies will be recognized but not updated by renovate. Renovate needs to respect the 'include:local' imports and update the depedependencies in those files. `extractPackageFile` is replaced by `extractAllPackageFiles` since the functionality of those two functions are the same. Related to renovatebot#6745 Fixes renovatebot#6713
If local files are imported from the GitLab CI YAML file, the dependencies will be recognized but not updated by renovate. Renovate needs to respect the 'include:local' imports and update the depedependencies in those files. `extractPackageFile` is replaced by `extractAllPackageFiles` since the functionality of those two functions are the same. Related to renovatebot#6745 Fixes renovatebot#6713
Related - but not the same so if you want me to open a seperate issue please say :) I followed the PR's and they will be great for local: includes - but there are various other types of include which also result in a similar error
The common types of include we use are: I don't see a way where either of those cases could be handled by updating someone else's repo of course :) But can it be handled better? Perhaps ...
|
@erzz can you please paste some concrete sample pipeline and write down what there should happen. You can use any fake repos of cause. |
Hi there, The Renovate team needs your help! To fix the problem, we first need to know exactly what's causing the bug. A minimal reproduction help us to pinpoint the exact cause of the bug. To get started, please read our guide on minimal reproductions to understand what is needed. We may close the issue if you have not provided a minimal reproduction within two weeks. If you need more time, or are stuck, please ask for help or more time in a comment. Good luck, The Renovate team |
The original reproduction by @j0nm1 is no longer on gitlab.com so this issue is back to |
Hi, totally forgot about this issue. The repository is now public again. |
Thank you for providing a reproduction! 🎉 🚀 The Renovate team will take a look at the reproduction repository. Once we confirm the provided repository reproduces the problem, the label will be changed to |
I'll add a specific reproduction for the case I refer to here as well. I have started work on a Gitlab CI templates project which we use across various projects. Its public so you can see what kinds of things we are talking about and I am even trying to create good docs in it too :) But the essentials are - I don't want to write a image scanning job by hand for every project - so I create a template: Then in my various projects I can just include it: .gitlab-ci.yml
If all the defaults will work for me, then great! I literally don't need to add another character to my CI. But if I want or need to change something about it I can just specify what I want to override in my .gitlab-ci.yml by just specifying the job name and the properties I want to override. e.g. To change which stage the job works in I add the following after my include
Gitlab pre-processes at run time - including the various include files and merging everything together. It's really powerful! So anyway - to be relevant - if in the case of this template - there is a new version 0.13.0 of trivy is released, and the template uses 0.12.0 the suggested diff for my project would be:
Thats it. But there are various edge cases.
All of these are valid
|
@erzz the value you show above for |
Renovate does read in the includes - even the remotes and seems to do it very well. It discovers that the included file has an update-able value (the image tag) but then when it comes to trying to create a PR for it - it fails because it is attempting to do a string replace in the local git repo - but of course it doesn't exist. The logic is to detect "remote:" and know that it will need to instead insert the override in the local .gitlab-ci.yml |
If local files are imported from the GitLab CI YAML file, the dependencies will be recognized but not updated by renovate. Renovate needs to respect the 'include:local' imports and update the depedependencies in those files. `extractPackageFile` is replaced by `extractAllPackageFiles` since the functionality of those two functions are the same. Related to renovatebot#6745 Fixes renovatebot#6713
If local files are imported from the GitLab CI YAML file, the dependencies will be recognized but not updated by renovate. Renovate needs to respect the 'include:local' imports and update the depedependencies in those files. `extractPackageFile` is replaced by `extractAllPackageFiles` since the functionality of those two functions are the same. Related to renovatebot#6745 Fixes renovatebot#6713
If local files are imported from the GitLab CI YAML file, the dependencies will be recognized but not updated by renovate. Renovate needs to respect the 'include:local' imports and update the depedependencies in those files. `extractPackageFile` is replaced by `extractAllPackageFiles` since the functionality of those two functions are the same. Related to renovatebot#6745 Fixes renovatebot#6713
🎉 This issue has been resolved in version 24.80.2 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What Renovate type are you using?
I'm using
renovate/renovate:21.25.0
with Gitlab CI.Describe the bug
Gitlab CI
include:local
is still not working. I tried to add support with the following pr and now Renovate recognizes the dependencies but is unable to update: #6630Relevant debug logs
To Reproduce
Demo Gitlab Repo: https://gitlab.com/jonmi/gitlab-include-demo
Additional context
It seems like the problem is that Renovate searches in the wrong file for the version string. I'm not 100% sure what's necessary but after looking into the existing code I think custom
extractAllPackageFiles
andupdate
methods need to be implemented (as done for maven). Maybe somebody has the time to look into it.The text was updated successfully, but these errors were encountered: