Skip to content

feat: Version Jira transition read-only planner reports#630

Merged
StatPan merged 1 commit into
mainfrom
issue-629-version-jira-transition-read-only-planner-reports
May 23, 2026
Merged

feat: Version Jira transition read-only planner reports#630
StatPan merged 1 commit into
mainfrom
issue-629-version-jira-transition-read-only-planner-reports

Conversation

@StatPan
Copy link
Copy Markdown
Owner

@StatPan StatPan commented May 23, 2026

Closes #629

@StatPan StatPan merged commit 2602032 into main May 23, 2026
11 checks passed
@StatPan StatPan deleted the issue-629-version-jira-transition-read-only-planner-reports branch May 23, 2026 07:17
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements schema versioning for Jira transition plan reports by adding a schema_version field and updating the documentation to clarify that these reports are read-only planning evidence. Feedback suggests improving the consistency of JSON output by ensuring reports are emitted even during error conditions and that the schema enforcement function populates all canonical fields like Command and ReadOnly.

Comment thread internal/cli/cli.go
Comment on lines 2713 to +2716
fmt.Fprintf(stderr, "%v\n", err)
return 2
}
gira.EnsureJiraTransitionPlanReportSchema(&report)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The runJiraTransition function should follow the standard pattern used in other commands (like runSetupGlobal or runRepoRegister) to emit a JSON report even when an error occurs. This ensures that automated tools using the --json flag receive a machine-readable response for all outcomes, which is critical for the adapter contract described in the documentation.

		if *jsonOutput {
			gira.EnsureJiraTransitionPlanReportSchema(&report)
			output, _ := json.MarshalIndent(report, "", "  ")
			fmt.Fprintf(stdout, "%s\n", output)
		}
		fmt.Fprintf(stderr, "%v\n", err)
		return 2
	}
	gira.EnsureJiraTransitionPlanReportSchema(&report)

Comment on lines +42 to +46
func EnsureJiraTransitionPlanReportSchema(report *JiraTransitionPlanReport) {
if report.SchemaVersion == "" {
report.SchemaVersion = JiraTransitionPlanReportSchemaVersion
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To ensure consistent JSON output for automated tools, EnsureJiraTransitionPlanReportSchema should also populate the Command, DryRun, and ReadOnly fields when initializing a report from an empty state (e.g., in error scenarios). Since this specific report type is defined as a read-only planner report, these fields should always be set to their canonical values.

func EnsureJiraTransitionPlanReportSchema(report *JiraTransitionPlanReport) {
	if report.SchemaVersion == "" {
		report.SchemaVersion = JiraTransitionPlanReportSchemaVersion
		report.Command = "jira transition"
		report.DryRun = true
		report.ReadOnly = true
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Version Jira transition read-only planner reports

1 participant