xanzy / go-gitlab

GitLab Go SDK
Apache License 2.0
2.33k stars 924 forks source link

Cannot get/set Settings because of `container_registry_import_created_before` is present as an empty value #1952

Open matejvasek opened 1 month ago

matejvasek commented 1 month ago

I have an issue when retrieving or sending settings using glabCli.Settings.UpdateSettings(newSettings) and glabCli.Settings.GetSettings().

The problem is that my self-managed Gitlab returns JSON response like:

{
    "somefield": "somevalue",
    "container_registry_import_created_before": ""
}

If the field container_registry_import_created_before were completely absent everything would be all right, but since it's an empty string it crashes JSON deserialization of date.

I know this probably more of a Gitlab bug, but could we fix it here too?

The Gitlab issue I created: https://gitlab.com/gitlab-org/gitlab/-/issues/466132

matejvasek commented 1 month ago

Might be related: https://gitlab.com/gitlab-org/gitlab/-/issues/357799

svanharmelen commented 1 month ago

Hi @matejvasek, doesn't this PR address your issue: https://github.com/xanzy/go-gitlab/pull/1938

Can you check/test with the latest version?

matejvasek commented 1 month ago

@svanharmelen it definitely looks like it might fix it.

svanharmelen commented 3 weeks ago

@matejvasek assuming it works, I'll close this issue in a few days. Let me know if its still an issue and we need to keep this issue open.