feat: issues find-branch command to find issue by Git branch name#106
Conversation
Add issueVcsBranchSearch query support: given a Git branch name, find the associated Linear issue. Returns full issue details on match, non-zero exit on no match. Key changes: - Add `execute_optional` to SDK Client for nullable query responses, refactor `execute` to delegate to it - Add `issueVcsBranchSearch` to operations.toml and regenerate SDK - Add `issues find-branch <BRANCH>` CLI subcommand - Add offline tests (help, subcommand listing, usage) - Add online tests for both SDK and CLI (found + not-found cases)
…<Option<T>> The existing execute method already handles nullable responses through serde's Option deserialization — no new SDK method needed. Also fixed usage.rs column alignment and resolved merge conflicts in online.rs.
|
Hey @lightstrike, nice feature —
So the caller just needs to request let result: Option<IssueDetail> = client
.execute(&query, variables, "issueVcsBranchSearch")
.await?;No new SDK method required — serde's I've pushed a fix to your branch removing |
|
Note: This PR currently hand-rolls the GraphQL query for Blocked by #120. |
|
Hey @lightstrike — pushed a final round of changes to your branch. Your find-branch implementation exposed a real gap in the SDK: nullable GraphQL fields (like With that merged, this PR now uses the generated Thanks for the contribution that sparked a real SDK improvement! |
# Conflicts: # crates/lineark-sdk/src/generated/client_impl.rs # crates/lineark-sdk/src/generated/queries.rs
Replace hand-rolled query with the generated function now that flipbit03#120 added nullable query support. Also: UUID suffix on SDK test names, remove redundant manual issue_delete (RAII guard handles it), reorder FindBranch enum variant next to other read operations.
0b6c9fa to
c4a7497
Compare
Summary
Add— Removed:execute_optionalmethod to SDKClientfor nullable GraphQL return types, refactorexecuteto delegate to itexecute::<Option<T>>already handles nullable responses via serde'sOptiondeserialization, no new method neededissueVcsBranchSearchquery tooperations.tomland regenerate SDKlineark issues find-branch <BRANCH>— finds the Linear issue associated with a Git branch nameissues read) on match, exits non-zero with "No issue found" on no matchlineark usagereferenceTest plan
cargo fmt --check— cleancargo clippy --workspace -- -D warnings— cleancargo test --workspace— all offline tests passlineark issues find-branch <branch>works, no-match exits non-zeroorigin/mainto resolve conflicts