-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Version Jira transition read-only planner reports #630
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,10 @@ type JiraTransitionPlanInput struct { | |
| DryRun bool `json:"dry_run"` | ||
| } | ||
|
|
||
| const JiraTransitionPlanReportSchemaVersion = "jira-transition-plan/v1" | ||
|
|
||
| type JiraTransitionPlanReport struct { | ||
| SchemaVersion string `json:"schema_version,omitempty"` | ||
| Command string `json:"command"` | ||
| Repo string `json:"repo"` | ||
| Key string `json:"key"` | ||
|
|
@@ -36,6 +39,12 @@ type JiraTransitionPlanReport struct { | |
| ReadOnly bool `json:"read_only"` | ||
| } | ||
|
|
||
| func EnsureJiraTransitionPlanReportSchema(report *JiraTransitionPlanReport) { | ||
| if report.SchemaVersion == "" { | ||
| report.SchemaVersion = JiraTransitionPlanReportSchemaVersion | ||
| } | ||
| } | ||
|
Comment on lines
+42
to
+46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To ensure consistent JSON output for automated tools, func EnsureJiraTransitionPlanReportSchema(report *JiraTransitionPlanReport) {
if report.SchemaVersion == "" {
report.SchemaVersion = JiraTransitionPlanReportSchemaVersion
report.Command = "jira transition"
report.DryRun = true
report.ReadOnly = true
}
} |
||
|
|
||
| type JiraTransitionCandidate struct { | ||
| ID string `json:"id"` | ||
| Name string `json:"name"` | ||
|
|
@@ -84,6 +93,7 @@ func BuildJiraTransitionPlan(input JiraTransitionPlanInput) (JiraTransitionPlanR | |
| return JiraTransitionPlanReport{}, err | ||
| } | ||
| report := JiraTransitionPlanReport{ | ||
| SchemaVersion: JiraTransitionPlanReportSchemaVersion, | ||
| Command: "jira transition", | ||
| Repo: input.Repo.FullName(), | ||
| Key: key, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
runJiraTransitionfunction should follow the standard pattern used in other commands (likerunSetupGlobalorrunRepoRegister) to emit a JSON report even when an error occurs. This ensures that automated tools using the--jsonflag receive a machine-readable response for all outcomes, which is critical for the adapter contract described in the documentation.