Skip to content

feat: issues batch-update for bulk issue updates#107

Merged
flipbit03 merged 3 commits intoflipbit03:mainfrom
lightstrikelabs:feat/issues-batch-update
Mar 7, 2026
Merged

feat: issues batch-update for bulk issue updates#107
flipbit03 merged 3 commits intoflipbit03:mainfrom
lightstrikelabs:feat/issues-batch-update

Conversation

@lightstrike
Copy link
Copy Markdown
Contributor

Summary

  • Enhance codegen emit_mutations.rs to detect list entity fields and generate Result<Vec<T>> return types
  • Add execute_batch_mutation to SDK Client for mutations returning entity arrays
  • Add issueBatchUpdate mutation to operations.toml and regenerate SDK
  • New CLI subcommand: lineark issues batch-update ID1 [ID2...] --status/--priority/--assignee/--labels/--project/--cycle
  • Applies the same IssueUpdateInput to multiple issues at once, returns updated issue table
  • Update lineark usage reference

Test plan

  • cargo fmt --check — clean
  • cargo clippy --workspace -- -D warnings — clean
  • cargo test --workspace — all offline tests pass (81)
  • CLI online tests pass: --priority, --status "Done", invalid ID error path
  • Manual e2e: batch update with priority and status verified
  • SDK online tests blocked by feat: make test team configurable via environment variable #105 — pre-existing test panics and aborts the test_with runner before new tests execute

Blocker: #105 must be resolved for the full SDK online test suite to run.

First batch mutation in the codebase. Enhances codegen to detect list
entity fields in mutation payloads and generate `Result<Vec<T>>` return
types with a new `execute_batch_mutation` client method. Adds full CLI
subcommand with status, priority, assignee, labels, project, and cycle
flags.
@flipbit03
Copy link
Copy Markdown
Owner

Hey @lightstrike, thanks for working on this!

We've been looking at the approach here and think there's a simpler path that avoids the codegen duplication and the new execute_batch_mutation method entirely.

The key insight is that execute_mutation<T> already works for list entity fields — if T = Vec<Issue> and entity_field = "issues", then payload.get("issues") returns a JSON array, and serde_json::from_value::<Vec<Issue>>() deserializes it correctly. No special client method needed.

What's needed instead:

  1. Blanket impl GraphQLFields for Vec<T> (same pattern as fix: blanket impl GraphQLFields for Option<T> for nullable queries #121 did for Option<T>) — just 3 lines in field_selection.rs:

    impl<T: GraphQLFields> GraphQLFields for Vec<T> {
        type FullType = T::FullType;
        fn selection() -> String { T::selection() }
    }

    This works because the GraphQL selection set is identical whether requesting a single entity or a list — only the JSON response shape differs.

  2. Minimal codegen tweak in emit_mutations.rs: when the entity field is a list type, generate Result<Vec<T>, LinearError> as the return type and call self.execute_mutation::<Vec<T>>(...) instead of self.execute_mutation::<T>(...). Same method, different type parameter. No need for duplicated if/else code paths.

We have push access to your branch, so we'll push a simplified version that takes this approach. The mutation itself (issueBatchUpdate) and the CLI integration stay — just the plumbing gets simpler.

…or Vec<T>

Instead of a separate execute_batch_mutation method and duplicated codegen
paths for list entity fields, use the same approach as Option<T>: a blanket
impl that delegates selection to the inner type. execute_mutation::<Vec<T>>
handles JSON array deserialization via serde natively.

Also migrates batch-update tests to TeamGuard pattern, fixes usage column
alignment, and merges with origin/main.

Closes flipbit03#120
@flipbit03 flipbit03 marked this pull request as ready for review March 7, 2026 15:42
@flipbit03 flipbit03 added the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 7, 2026
@github-actions github-actions Bot removed the safe-to-test Maintainer-approved: run online tests with API secrets label Mar 7, 2026
@flipbit03 flipbit03 merged commit dca1139 into flipbit03:main Mar 7, 2026
9 checks passed
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.

2 participants