You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(gitlabsearch): add structure squash to keep custom parameters - #11518
Assuming that $config is the config you give in input of updatecli, doing a updatecli diff or a updatecli apply will detect repositories from your group correctly but will try to pull not on your custom gitlab url, instead it will call the default value gitlab.com.
Test
To test this pull request, you can run the following commands:
> updatecli pipeline diff --values .\fleet.yaml --debug
DEBUG: Default Updatecli manifest detected "updatecli.yaml"
Loading Pipeline "updatecli.yaml"
DEBUG: Processing gitlabsearch scm "projects"for potential multiple repository discovery
DEBUG: Processing GitLab project: awsome-project-test
DEBUG: Loaded 2 pipeline configuration(s) from "updatecli.yaml"
SCM repository retrieved: 1
DEBUG: cloning git repository: https://gitlab.com/xxx/awsome-project-test.git in Temp\1/updatecli/xxx/awsome-project-test
ERROR: failed cloning GitLab repository "https://gitlab.com/xxx/awsome-project-test.git"
ERROR: err - cloning: authentication required: HTTP Basic: Access denied. If a password was provided for Git authentication, the password was incorrect or you're required to use a token instead of a password. If a token was provided, it was either incorrect, expired, or improperly scoped. See https://gitlab.com/help/topics/git/troubleshooting_git.md#error-on-git-fetch-http-basic-access-denied
Additional Information
Checklist
I have updated the documentation via pull request in website repository.
I have tested this pull request manually with a custom Updatecli build and it works as expected.
Tradeoff
Potential improvement
Summary by CodeRabbit
Bug Fixes
Improved how embedded GitLab settings are decoded from configuration, helping ensure values are recognized consistently.
This modification is done to send to each gitlab SCM created from a gitlabsearch the correct parameters ( e.g. custom URL ) provided by the operator
Signed-off-by: Valentin Lebourg <valentin.lebourg@sofrecom.com>
This change makes GitLab SCMs created from gitlabsearch keep operator-supplied settings such as a custom GitLab URL. The change is small and touches only a decoding tag. No remaining merge risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the gitlabsearch fix and the squash tag that keeps custom parameters. The change adds mapstructure:",squash" to the embedded client.Spec in the GitLab SCM Spec, so the title matches th…
Description check
The description explains the problem clearly: a custom GitLab URL set in gitlabsearch is ignored, and clones fall back to gitlab.com. It includes a reproduction config, a test section with command and…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the gitlabsearch fix and the squash tag that keeps custom parameters. The change adds mapstructure:",squash" to the embedded client.Spec in the GitLab SCM Spec, so the title matches the single-line change. It follows the conventional-commit style and is specific enough for a teammate scanning history. Minor issue: 'structure squash' is slightly unusual wording for a mapstructure squash tag, but the meaning is clear.
Full details: Description check
Explanation
The description explains the problem clearly: a custom GitLab URL set in gitlabsearch is ignored, and clones fall back to gitlab.com. It includes a reproduction config, a test section with command and output, and a checked manual-testing box. The template's Fix # line is missing, and the tradeoff and potential improvement sections are left as placeholders. The test output shows a failed clone against gitlab.com, which does not confirm the fix works, so the test evidence is weak. The description is mostly complete, so it passes.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 48056700-bf42-4744-a284-9c3730ca42ae
Commits
Reviewing files that changed from the base of the PR and between 80d7640 and ccdb1ef.
Files selected for processing: 1
pkg/plugins/scms/gitlab/main.go
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
…les (#11599)
Specs generated by azuredevopssearch reach azuredevops.New as a Spec
struct. Without a squash tag, mapstructure nested the embedded client
spec, so the first decode returned an empty client spec. The fallbacks
then restored each field, but a username or token set in the spec was
overridden by UPDATECLI_AZURE_DEVOPS_USERNAME and
UPDATECLI_AZURE_DEVOPS_TOKEN, unlike a spec written in a manifest.
Squash the embedded client spec, as done for GitLab in #11518, and add
regression tests for both struct and manifest input.
Signed-off-by: Olblak <me@olblak.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This modification is done to send to each gitlab SCM created from a gitlabsearch the correct parameters ( e.g. custom URL ) provided by the operator.
Currently, if you put a custom gitlab url like this:
And a config file like this:
Assuming that
$configis the config you give in input of updatecli, doing aupdatecli diffor aupdatecli applywill detect repositories from your group correctly but will try to pull not on your custom gitlab url, instead it will call the default valuegitlab.com.Test
To test this pull request, you can run the following commands:
Additional Information
Checklist
Tradeoff
Potential improvement
Summary by CodeRabbit