-
-
Notifications
You must be signed in to change notification settings - Fork 201
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 context data are missing #687
Comments
Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️ |
@dark0dave wanna take a look into this? :) |
I am having this same issue on gitlab.com as well, same version of git-cliff on Linux and macOS. |
I don't have the word + : GIT_CLIFF_CONFIG: project-rp-npm/cliff.toml
+ : GIT_CLIFF_INCLUDE_PATH: 'project-rp-npm/**'
+ : GIT_CLIFF_TAG_PATTERN: 'project-rp-npm-v[0-9].*'
+ : GIT_CLIFF_IGNORE_TAGS: ''
+ : GIT_CLIFF_OUTPUT: ./project-rp-npm/CHANGELOG.LATEST.md
+ : GIT_CLIFF_PREPEND: ./project-rp-npm/CHANGELOG.md
+ test -f project-rp-npm/cliff.toml
+ test -f ./project-rp-npm/CHANGELOG.md
+ git-cliff --verbose --bump -u
DEBUG git_cliff > Failed to get remote from GitLab repository: UrlParseError(RelativeUrlWithoutBase)
DEBUG git_cliff_core::changelog > Processing the commits...
DEBUG git_cliff_core::changelog > Processing the releases... |
Today i compiled git-cliff from main source. The problem still exists. the context does not have any info of a self managed gitlab instance included although it is configured: "commits": [ git-cliff verbose output of the remote part: the remote was configured in the config file, GITLAB_TOKEN was set as environment as well as the GITLAB_API_URL here i also stumbled over a different issue. first i configured the GITLAB_REPO also as environment variable and here i realized the the parsing of owner and repos seems to be broken. because if you have a sub group after the group, something like GITLAB_REPO =my-group/my-subgroup/my-repo, the owner was set only to my-subgroup, missing the my-group. same goes if you hand over the repo via cli argument. however, if you specify owner and repo via config file it seems to be parsed correct, as you can see above in the git-cliff verbose output however, gitlab integration is still not availabe in the context withe the latest build from source |
i just tested it withe the latest release v2.4.0 version. its is still not fixed. the is no info available on any commit from a self hosted gitlab instance. gitlab details were configured via config file, token and api endpoint were handed over via environment variable. the context does not contain any infos of the remote, and therefor also the infos are not available via template in the final changelog file |
@orhun This is due to self managed gitlab projects api needing an encoded path to retrieve the project information. Docs here For self hosted instances where subgroups are managed with the logic here will likely need to be changed(I would url encode strings set by the end user in this case). In OPs case, owner is likely set like the following. [remote]
owner = "myGroup/mySubGroup"
repo = "theRepo" @nqdrizzt if you instead set it like this(encoding all slashes) git cliff will work as you expect. [remote]
owner = "myGroup%2FmySubGroup"
repo = "theRepo" |
well, this also does not work. i executed the following command based on git-cliff 2.4.0: I tried each possible combo specifying the gitlab configuration. config.toml contains: GITLAB_TOKEN="my-secret-token" debug output: TRACE git_cliff_core::repo > Upstream URL: git@my.private-gitlab.com:my-group/my-sub-group/my-repo.git and still the context still does not contain any gitlab relevant data:
.... |
@nqdrizzt Thanks, this lead me the to actual issues and I hacked a solution. @orhun This is missing fields in GitlabCommit and GitlabMergeRequest so serde is failing to deserialize into the type and for some reason that deserialize error is being swallowed and not being logged anywhere so this was super hard find. |
Hi, I was testing cliff in the context of a gitlab.com project and I think I just hit this issue. The connection to the remote project looks ok however when I print the context I'm only able to see the username like this:
all the fields related to the PR/MR are empty. Is there a workaround/fix for that? |
Thanks for looking into this! @nqdrizzt @tonybutt #742 is now merged.
Can you share which fields are missing? |
I have the exact same problem with the empty attributes, and the firstname + lastname instead of the gitlab username. @tonybutt - could you get a change to fix the deserialization issue you found? |
i have the same problem also but with GITHUB |
Can you share your configuration? @JacobAmar |
Is there an existing issue for this?
Description of the bug
While using a self hosted gitlab instance, the gitlab context of each commit is always empty like in the example bekow:
{
"id": "49bf75934a826c6d182e958405d680938bb474c3",
"message": "change all input variables to lower case",
"body": "Merge branch 'fix_lower_case_inputs' into 'main'",
"footers": [
{
"token": "Closes",
"separator": " #",
"value": "2",
"breaking": false
},
{
"token": "BREAKING CHANGE",
"separator": ":",
"value": "change all input variables to lower case\n\nSee merge request me-and-only-me/git-cliff-changelog!2",
"breaking": true
}
],
"group": "🐛 Bug Fixes",
"breaking_description": "change all input variables to lower case\n\nSee merge request me-and-only-me/git-cliff-changelog!2",
"breaking": true,
"scope": "inputs",
"links": [
{
"text": "#2",
"href": "/-/issues/2"
},
{
"text": "!2",
"href": "/-/merge_requests/2"
}
],
"author": {
"name": "John Snow",
"email": "john.snow@got.com",
"timestamp": 1710149612
},
"committer": {
"name": "John Snow",
"email": "john.snow@got.com",
"timestamp": 1710149612
},
"conventional": true,
"merge_commit": true,
"github": {
"username": null,
"pr_title": null,
"pr_number": null,
"pr_labels": [],
"is_first_time": false
},
"gitlab": {
"username": null,
"pr_title": null,
"pr_number": null,
"pr_labels": [],
"is_first_time": false
},
...
...
},
git-cliff verbose output:
TRACE git_cliff_core::repo > Upstream URL: https://my.gitlabinstance.com/me-and-only-me/git-cliff-changelog.git
DEBUG git_cliff > No GitHub remote is set, using remote: me-and-only-me/git-cliff-changelog
TRACE git_cliff > Arguments: Opt {
help: None,
version: None,
verbose: 4,
init: None,
config: "/config/git-cliff.toml",
workdir: None,
repository: None,
include_path: None,
exclude_path: None,
tag_pattern: None,
with_commit: None,
skip_commit: None,
prepend: None,
output: None,
tag: None,
bump: false,
bumped_version: false,
body: None,
latest: false,
current: false,
unreleased: true,
topo_order: false,
no_exec: false,
context: true,
strip: None,
sort: Newest,
range: None,
github_token: None,
github_repo: None,
gitlab_token: Some(
Secret([REDACTED alloc::string::String]),
),
gitlab_repo: Some(
RemoteValue(
Remote {
owner: "me-and-only-me",
repo: "git-cliff-changelog",
token: None,
},
),
),
bitbucket_token: None,
bitbucket_repo: None,
}
Steps To Reproduce
Expected behavior
any data in context of gitlab
"gitlab": {
"username": "John Snow",
"pr_title": null,
"pr_number": null,
"pr_labels": [],
"is_first_time": false
},
Screenshots / Logs
No response
Software information
Additional context
No response
The text was updated successfully, but these errors were encountered: