Awesome Reviewers

Reviewer · API

Preserve API backward compatibility

Never change the signature, return type, or observable behavior of an existing public API method—doing so breaks every downstream consumer. If new functionality requires a different return type or extra parameters, add a new method instead of mutating the existing one, e.g. introduce `RegisterPluginDetailed` (not `RegisterPluginV2`) that returns...

Instruction

Never change the signature, return type, or observable behavior of an existing public API method—doing so breaks every downstream consumer. If new functionality requires a different return type or extra parameters, add a new method instead of mutating the existing one, e.g. introduce RegisterPluginDetailed (not RegisterPluginV2) that returns (*RegisterPluginResponse, error), while the original RegisterPlugin(i *RegisterPluginInput) error keeps its original contract. When a new API is added as a successor, mark the old one // Deprecated: Use <NewMethod> instead. but keep it functional indefinitely, since widely-used exported functions can’t realistically be removed. For variadic or optional parameters introduced for compatibility, prefer adding a new explicit function and making the old one a thin wrapper around it (e.g. OldFunc(m) { NewFunc(m, "default") }), documenting clearly why the variadic form exists if it must be kept. Beyond signatures, also guard against inadvertent behavioral breaks: if a change to response content affects derived behavior such as HTTP status codes (e.g., returning a non-nil response now yields 200 instead of 204), explicitly preserve the old behavior, for example:

if len(resp.Warnings) == 0 {
    return nil, nil
}
return &resp, nil

Always consider existing clients’ expectations (serialization format, status codes, nil vs empty responses) before merging any change to a shared API surface, and favor additive, versioned, or deprecated-with-fallback approaches over modifying existing public interfaces.