Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Replaced Visibility with VisibilityLevel in Webhooks #1701

Closed
wants to merge 1 commit into 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).

@timofurrer
Copy link
Contributor

@smit-modi we've migrated the repository over to GitLab.com.

Please see #2060 (comment) for more context.

@timofurrer timofurrer closed this Dec 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants