Skip to content

operations: Honor feature flag for structured errors in UserCherryPick

With b253d7c8 (operations: Convert UserCherryPick to return structured errors, 2022-06-16), we have converted the UserCherryPick RPC to return structured errors instead of errors that are embedded into a successful response. While some of the new errors are covered by a feature flag, this flag currently really only covers the case where the RPC ran into a merge conflict. All the other newly introduced structured errors don't honor to the feature flag at all and are returned unconditionally.

This breaks backwards compatibility during zero-downtime upgrades where Rails may not yet be prepared to handle our new structured errors, and thus it may start to misbehave when running an old version with a new Gitaly server. So let's fix this by properly paying attention to the feature flag so that we continue to return the old-style errors embedded inside of the successful response in case the flag is disabled.

Merge request reports