Skip to content

dev#37

Merged
jamesjohnsdev merged 8 commits into
mainfrom
dev
Jun 21, 2026
Merged

dev#37
jamesjohnsdev merged 8 commits into
mainfrom
dev

Conversation

@jamesjohnsdev

@jamesjohnsdev jamesjohnsdev commented Jun 21, 2026

Copy link
Copy Markdown
Owner
  • feat: comment compatability
  • doc: comments feature added to readme
  • test: comments
  • feat: cli commands for issue comments
  • feat: enable metadata support for comments
  • feat: run issues commands from subdirectories
  • perf(sync): skip unchanged issues and parallelize comment fetches
  • feat: merge issues together and mark duplicates

Summary by cubic

Adds first-class comment support with local drafts and a new issues merge command for handling duplicates. Sync is much faster by skipping unchanged issues and fetching comments in parallel, and commands now work from subdirectories.

  • New Features

    • Comments: per-issue .comments.json with metadata; issues comment <number> drafts; issues view <number> -c prints; issues push posts drafts and refreshes IDs; issues pull/push handle comments for all or a single issue.
    • Merge duplicates: issues merge <a> <b> adds cross-reference comments and closes the duplicate; works for GitHub↔local and local↔local with safe prompts.
    • Run from subdirectories: CLI searches upward for .issues so commands work from nested folders.
  • Performance

    • Skip unchanged issues using GitHub updatedAt vs local syncedAt.
    • Parallel comment fetches (20 workers) and a single-pass local index.
    • Cold sync ~500s → ~42s; warm sync ~500s → ~12s.

Written for commit da40e4f. Summary will update on new commits.

Review in cubic

doc: basic updates of missing gaps
add recursive search for `.issues` directory to enable cli commands from
any subdirectories of a parent directory that is initialised
Use updatedAt from GitHub to skip issues where updatedAt <= syncedAt.
Fan out comment fetches with 20 concurrent workers. Build local index
once per sync instead of re-scanning on every pullOne call.

Cold sync: ~500s -> 42s. Warm sync: ~500s -> 12s (list call only).

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

6 issues found across 17 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="cmd/push.go">

<violation number="1" location="cmd/push.go:130">
P2: Draft detection is too narrow; it ignores comments with metadata but no ID. Those local comments are not pushed.</violation>
</file>

<file name="cmd/merge.go">

<violation number="1" location="cmd/merge.go:120">
P2: `mergeOnlineLocal` commits local merge metadata before remote deletion succeeds. This can leave incorrect local history on error paths.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread cmd/push.go
Comment thread cmd/pull.go Outdated
Comment thread cmd/push.go

pushed := 0
for _, c := range local {
if c.Metadata == nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Draft detection is too narrow; it ignores comments with metadata but no ID. Those local comments are not pushed.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cmd/push.go, line 130:

<comment>Draft detection is too narrow; it ignores comments with metadata but no ID. Those local comments are not pushed.</comment>

<file context>
@@ -104,5 +112,38 @@ func pushOne(root string, iss *issue.Issue) error {
+
+	pushed := 0
+	for _, c := range local {
+		if c.Metadata == nil {
+			if err := gh.AddComment(iss.Number, c.Body); err != nil {
+				return err
</file context>
Suggested change
if c.Metadata == nil {
if c.Metadata == nil || c.Metadata.ID == "" {

Comment thread cmd/merge.go
return fmt.Errorf("reading comments: %w", err)
}
comments = append(comments, &issue.Comment{Body: commentBody})
if err := issue.WriteComments(commentsPath, comments); err != nil {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: mergeOnlineLocal commits local merge metadata before remote deletion succeeds. This can leave incorrect local history on error paths.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cmd/merge.go, line 120:

<comment>`mergeOnlineLocal` commits local merge metadata before remote deletion succeeds. This can leave incorrect local history on error paths.</comment>

<file context>
@@ -0,0 +1,172 @@
+		return fmt.Errorf("reading comments: %w", err)
+	}
+	comments = append(comments, &issue.Comment{Body: commentBody})
+	if err := issue.WriteComments(commentsPath, comments); err != nil {
+		return fmt.Errorf("saving comment: %w", err)
+	}
</file context>

Comment thread cmd/merge.go
Comment thread cmd/merge.go
@jamesjohnsdev jamesjohnsdev merged commit 40f2ca8 into main Jun 21, 2026
5 checks passed
@jamesjohnsdev jamesjohnsdev deleted the dev branch June 21, 2026 05:55
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.

1 participant