Skip to content

Lookup resolver: name → UUID caching #81

@mateicanavra

Description

@mateicanavra

TL;DR

Implement a lookup resolver that converts human-readable names (state, labels, projects, milestones) to Linear UUIDs, with caching to minimize API calls.

Deliverables

  • scripts/linear-sync/lookups.ts module
  • State name → UUID resolver (e.g., plannedacc37e31-...)
  • Label name → UUID resolver (e.g., Improvementd8655b06-...)
  • Project slug → UUID resolver
  • Milestone slug → UUID resolver
  • Issue identifier → UUID resolver (for parent references)
  • In-memory cache populated once per sync run

Acceptance Criteria

  • Single API call per entity type (states, labels, projects) at sync start
  • Cache persists for duration of sync run
  • Graceful handling of unknown values (log warning, skip field)
  • State mapping handles local names: planned→Backlog, in_progress→In Progress, done→Done
  • Works with team-scoped and workspace-scoped labels

Testing / Verification

# Verify lookups resolve correctly
bun run scripts/linear-sync/lookups.ts --test

# Expected: Prints resolved UUIDs for known states/labels

Dependencies / Notes

  • Depends on: @linear/sdk npm package
  • Depends on: LINEAR_API_KEY environment variable
  • Blocks: Sync engine (needs UUIDs to create/update issues)
  • API calls: ~5 calls per sync run (states, labels, projects, milestones, team)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions