Skip to content
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

Add hidden field to ProjectVariable struct #2065

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yogeshlonkar
Copy link

No description provided.

@timofurrer timofurrer self-requested a review November 21, 2024 19:18
Copy link
Collaborator

@timofurrer timofurrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yogeshlonkar thanks for the contribution 🤝 I've left some clarification questions on the correctness of the field / field naming. Back to you 🏓

@@ -132,6 +133,7 @@ type CreateProjectVariableOptions struct {
Description *string `url:"description,omitempty" json:"description,omitempty"`
EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
Masked *bool `url:"masked,omitempty" json:"masked,omitempty"`
Hidden *bool `url:"hidden,omitempty" json:"hidden,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the docs it looks like it's called masked_and_hidden. Did hidden work for you?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API in docs perspective masked_and_hidden is consistent name. I have not tested this against the api.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There also might be validation error as masked and masked_and_hidden should be mutually exclusive as per UI

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we need to support in go-gitlab exactly with what the upstream API supports.

I have not tested this against the api.

I highly recommend doing this :)

@@ -173,6 +175,7 @@ type UpdateProjectVariableOptions struct {
EnvironmentScope *string `url:"environment_scope,omitempty" json:"environment_scope,omitempty"`
Filter *VariableFilter `url:"filter,omitempty" json:"filter,omitempty"`
Masked *bool `url:"masked,omitempty" json:"masked,omitempty"`
Hidden *bool `url:"hidden,omitempty" json:"hidden,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the docs I don't see that this field is supported in the update API. Did hidden work for you?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature is not matured, You can close the MR or leave it open until this field is available in update api.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's up to you. We can already merge what is supported and iterate. No need to wait for a "matured" upstream API.

IMHO, we should move on with what is supported upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants