Documentation
¶
Overview ¶
Package parenthint is the single owner of parent-rejection detection and the mirror hierarchy hint that follows it (CLI create/edit and REST PUT parent / POST create). Both surfaces call Wrap so a new path cannot inherit the bare origin 400.
The field key differs by verb, and both shapes were measured against a real Cloud site on 2026-08-21: POST /issue answers with `parent` AND `parentId`, PUT /issue/{key} answers with `pid`. The messages themselves are localized per account, so the keys are the only stable part. GDK-424 tested `parent` inline in the create path, which could never have matched the edit path (GDK-525).
Detection is typed, not textual: every Jira-family origin (connected, standalone issuetap, paired) rides *jira.Client, so the 400 arrives as *jira.APIError and Rejection reads its field keys. The old err.Error() scan matched any sentence containing "parent" — including the Linear adapter's local refusal, which is not an origin parent rejection at all (GDK-819).
The hint names CLI --parent because that wording is the existing contract (GDK-330); REST appends the same sentence rather than a second copy. This package does not compose HTTP status.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Hint ¶
Hint reads the rejected parent from the mirror and states the hierarchy rule Jira's 400 leaves out. Best-effort: no querier, no row, or any error returns "" and the origin error stands alone.
func Rejection ¶
Rejection reports whether err is the origin refusing the parent we sent. The answer is read off the typed *jira.APIError the whole Jira REST family returns (connected, standalone issuetap, paired — one client), never off the message text: `parent`/`parentId` answer POST /issue, `pid` answers PUT /issue/{key}. The Linear adapter never reaches here with a parent rejection; it refuses the field locally, and that refusal's sentence is not scanned (GDK-819).
Types ¶
type Hinted ¶
type Hinted struct {
Hint string
// contains filtered or unexported fields
}
Hinted wraps an origin error with the mirror hierarchy sentence. Unwrap keeps the origin error matchable; Error appends the hint the same way the CLI used to (origin + newline + hint).
type Querier ¶
type Querier interface {
QueryRow(query string, args ...any) *sql.Row
Query(query string, args ...any) (*sql.Rows, error)
}
Querier is the mirror read the hint needs. *sql.DB (CLI openReadOnly) and *store.DB (REST's existing connection) both satisfy it; this package never opens a connection of its own.