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

Replaced Visibility with VisibilityLevel in Webhooks #1701

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

Conversation

smit-modi
Copy link
Contributor

GitLab doesn't return Visibility with string type anymore. It returns VisibilityLevel with int type.

 VisibilityLevel in webhooks
@smit-modi
Copy link
Contributor Author

@svanharmelen Can you please review this?

Copy link
Member

@svanharmelen svanharmelen left a comment

Choose a reason for hiding this comment

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

Besides the one minor comment, I'm a little bit unsure what this change means for backwards compatibility. Can you tell from what version GitLab changed this behavior?

I guess the easiest way to keep supporting older versions is to not change the existing field, but instead add the new field next to the existing one...

Or do you have any other thoughts?

InternalVisibilityLevel VisibilityLevelValue = 10
PublicVisibilityLevel VisibilityLevelValue = 20
)

Copy link
Member

Choose a reason for hiding this comment

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

// VisibilityLevel is a helper routine that allocates a new
// VisibilityLevelValue to store v and returns a pointer to it.
func VisibilityLevel(v VisibilityLevelValue) *VisibilityLevelValue {
	p := new(VisibilityLevelValue)
	*p = v
	return p
}

Can you add something like this ☝🏻 I try to add such a helper function for all custom types to make it easier for people to get a pointer to such a value (which is needed in option structs).

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.

None yet

2 participants