Skip to content

Improve Asana tracker adapter - fill implementation gaps #78

@amondnet

Description

@amondnet

Overview

The Asana tracker adapter (src/tracker/asana.ts) has a baseline implementation, but several gaps exist compared to the GitHub Projects v2 adapter. This issue tracks the improvements needed.

Tasks

1. Generate Task URLs (url field always null)

Files: src/tracker/asana.ts:148,186 (normalizeAsanaTask, fetchIssueStatesByIds)

Currently the url field is always set to null. Asana task URLs can be constructed from known data:

https://app.asana.com/0/{project_gid}/{task_gid}

The project_gid is available from the tracker config and task_gid is the task's GID. Both normalizeAsanaTask and fetchIssueStatesByIds should populate this field.


2. Parallelize fetchIssueStatesByIds

Files: src/tracker/asana.ts:121-157

Currently performs a sequential per-ID fetch. The GitHub adapter batches all IDs into a single GraphQL nodes(ids:) query. The Asana adapter should use Promise.allSettled or a concurrency-limited parallel fetch to reduce latency.


3. Use asana_missing_next_page Error Code

Files: src/tracker/asana.ts:99, src/tracker/types.ts:17

The asana_missing_next_page error code is defined in the TrackerError union but never emitted. Pagination integrity validation should be added so that if next_page is expected but missing (e.g., truncated response), this error is surfaced.


4. Parallelize Section Fetches in fetchTasks

Files: src/tracker/asana.ts:65-70

Tasks for multiple sections are currently fetched sequentially. Since each section fetch is independent, they can be parallelized using Promise.all to reduce total polling time.


5. Include description in fetchIssueStatesByIds

Files: src/tracker/asana.ts:127

The opt_fields parameter in fetchIssueStatesByIds does not include notes, causing the description field to always be null. Adding notes to opt_fields will ensure description data is returned.

Acceptance Criteria

  • url is populated in both normalizeAsanaTask and fetchIssueStatesByIds
  • fetchIssueStatesByIds uses parallel fetching
  • asana_missing_next_page error is emitted on pagination integrity failure
  • Section fetches in fetchTasks run in parallel via Promise.all
  • notes is included in opt_fields for fetchIssueStatesByIds
  • All existing tests pass; new tests added for changed behavior

Metadata

Metadata

Assignees

Labels

type:choreMaintenance, build, dependencies

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions