Feature 112/jira imports #117

Merged
noe.trevino merged 7 commits from feature-112/jira-imports into main 2026-02-21 19:55:48 -06:00
Owner

Checklist

  • Read CONTRIBUTING.md
  • Ran tests (go test ./... -race) locally
  • Formatted and linted with gofmt -w . and golangci-lint run ./... respectively
  • Added tests if necessary (significant changes/complex logic)
  • Updated documentation if applicable
  • Updated README.md if applicable

Summary

Closes: #112

## Checklist - [x] Read `CONTRIBUTING.md` - [x] Ran tests (`go test ./... -race`) locally - [x] Formatted and linted with `gofmt -w .` and `golangci-lint run ./...` respectively - [x] Added tests if necessary (significant changes/complex logic) - [x] Updated documentation if applicable - [x] Updated `README.md` if applicable ## Summary <!-- What does this PR change and/or fix? Examples: Closes: 54 Fixes: 67 --> Closes: #112
claude[bot] (Migrated from github.com) reviewed 2026-02-21 18:30:18 -06:00
@ -0,0 +1,155 @@
// Package jira provides types and functionality for fetching Jira issues.
claude[bot] (Migrated from github.com) commented 2026-02-21 18:30:18 -06:00

The single layout "2006-01-02T15:04:05.000-0700" does not parse ISO 8601 timestamps that use Z as the UTC designator (e.g. "2026-02-16T10:00:00.000Z"), which the Jira REST API can emit. When parsing fails, the error is silently discarded and CreatedAt is set to the zero value — imported comments carry wrong timestamps without any user-visible warning.

		createdAt, err := time.Parse("2006-01-02T15:04:05.000-0700", c.Created)
		if err != nil {
			createdAt, err = time.Parse("2006-01-02T15:04:05.000Z", c.Created)
		}
		if err != nil {
			createdAt = time.Time{}
		}

Or use time.RFC3339 / time.RFC3339Nano which handles both Z and numeric offsets.

The single layout `"2006-01-02T15:04:05.000-0700"` does not parse ISO 8601 timestamps that use `Z` as the UTC designator (e.g. `"2026-02-16T10:00:00.000Z"`), which the Jira REST API can emit. When parsing fails, the error is silently discarded and `CreatedAt` is set to the zero value — imported comments carry wrong timestamps without any user-visible warning. ```suggestion createdAt, err := time.Parse("2006-01-02T15:04:05.000-0700", c.Created) if err != nil { createdAt, err = time.Parse("2006-01-02T15:04:05.000Z", c.Created) } if err != nil { createdAt = time.Time{} } ``` Or use `time.RFC3339` / `time.RFC3339Nano` which handles both `Z` and numeric offsets.
claude[bot] (Migrated from github.com) reviewed 2026-02-21 18:30:19 -06:00
@ -0,0 +1,161 @@
package jira
claude[bot] (Migrated from github.com) commented 2026-02-21 18:30:20 -06:00

This guard is unreachable. The command declares Args: cobra.ExactArgs(1), so cobra rejects the invocation before Execute is ever called if no argument is provided. Dead code.

This guard is unreachable. The command declares `Args: cobra.ExactArgs(1)`, so cobra rejects the invocation before `Execute` is ever called if no argument is provided. Dead code.
claude[bot] (Migrated from github.com) reviewed 2026-02-21 18:30:22 -06:00
@ -0,0 +39,4 @@
}
// IssueFetcher defines the interface for fetching Jira issues.
type IssueFetcher interface {
claude[bot] (Migrated from github.com) commented 2026-02-21 18:30:22 -06:00

IssueFetcher is defined in the implementing (jira) package, but AGENTS.md — updated in this very PR — states that interfaces belong in the package that uses them, not the one that implements them. The consuming package is app, so the interface should live there (or in a shared types package), not here.

`IssueFetcher` is defined in the implementing (`jira`) package, but AGENTS.md — updated in this very PR — states that interfaces belong in the package that *uses* them, not the one that implements them. The consuming package is `app`, so the interface should live there (or in a shared types package), not here.
claude[bot] commented 2026-02-21 18:30:37 -06:00 (Migrated from github.com)

Summary

Three concrete issues found:

  1. Silent data corruption (internal/jira/jira.go:133) — The timestamp parser uses a single fixed layout that does not handle Z-suffix UTC strings, which the Jira REST API can produce. Parse failures are silently discarded and zero-time is stored without any warning to the user.

  2. Dead code (internal/cli/jira/import.go:59) — The len(args.Args) == 0 guard is unreachable because cobra.ExactArgs(1) enforces the arity constraint before Execute is ever invoked.

  3. Interface placement (internal/jira/jira.go:42) — IssueFetcher is defined in the implementing package, contradicting the convention explicitly reinforced in the AGENTS.md changes included in this same PR.

Score: 7/10

**Summary** Three concrete issues found: 1. **Silent data corruption** (`internal/jira/jira.go:133`) — The timestamp parser uses a single fixed layout that does not handle `Z`-suffix UTC strings, which the Jira REST API can produce. Parse failures are silently discarded and zero-time is stored without any warning to the user. 2. **Dead code** (`internal/cli/jira/import.go:59`) — The `len(args.Args) == 0` guard is unreachable because `cobra.ExactArgs(1)` enforces the arity constraint before `Execute` is ever invoked. 3. **Interface placement** (`internal/jira/jira.go:42`) — `IssueFetcher` is defined in the implementing package, contradicting the convention explicitly reinforced in the AGENTS.md changes included in this same PR. **Score: 7/10**
@ -0,0 +39,4 @@
}
// IssueFetcher defines the interface for fetching Jira issues.
type IssueFetcher interface {
Author
Owner

skipping this one

skipping this one
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
noe.trevino/paso!117
No description provided.