fix(tasks): scope gh search to @me + cut spawns on auth/pr-checks - #84
Merged
Conversation
`preset_flags` fell through to no user filter for `open`, `closed`, and
`all` — `gh search issues --state=open` returned every open issue on
GitHub instead of the viewer's. Default the fallthrough to
`--involves=@me`, add a regression assertion.
Perf, all within the "keep gh as source of truth" constraint:
- tasks_github_auth: drop the `gh --version` probe, detect ENOENT on
`gh auth status` for the not-installed case. Rust-cached so remounts
don't re-spawn (one round trip instead of two on every mount).
- tasks_github_pr_checks: fold the sequential REST calls (`/pulls/{n}`
for head SHA -> `/commits/{sha}/check-runs`) into one `gh api graphql`.
Half the spawns and no serial dependency.
- tasks_cache_invalidate now takes an optional prefix; TasksPage passes
"gh:" / "linear:" so refreshing one source no longer wipes the other.
- Frontend `bump` split into ghBump/lnBump for the same reason on the
module-level CACHE.
Co-authored-by: Tempest <tempestai.dev@gmail.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #45.
The bug
preset_flags(src-tauri/src/tasks.rs) fell through to no user filter foropen,closed,all, and any unrecognized preset.gh search issues --state=openwithout an involvement flag returns every open issue on GitHub globally, not the viewer's. Defaulting the fallthrough arm to--involves=@mescopes those presets correctly. Regression assertion added inpreset_shapes.The perf work
Within the "keep
ghas source of truth" constraint from the issue. Everyghinvocation is a subprocess boot (Windows: 100-500 ms baseline), so the payoff sits in cutting spawn count and eliminating serial dependencies:tasks_github_auth: dropped thegh --versionprobe. DetectNotFoundongh auth status's IO error to distinguish "not installed" from "not logged in". One spawn instead of two, per mount. Rust-cached now, so remounts don't respawn at all.tasks_github_pr_checks: folded the two sequential REST calls (/pulls/{n}forhead.sha→/commits/{sha}/check-runs) into onegh api graphql. Half the spawns and no serial round trip. This was the "Checks tab feels like a hard pause" one.tasks_cache_invalidate(prefix?): scoped invalidation.TasksPage.refresh()passes"gh:"when on GitHub,"linear:"when on Linear — refreshing one source no longer wipes the other's cache.bumpsplit intoghBump/lnBump: same reason on the module-levelCACHEinuseTasks.ts.Deliberately not in this PR
tasks_github_thread(comments + timeline) to a single GraphQL query. Currently 2 parallel spawns — add when a hot issue with 100+ comments feels slow (the internal--paginateHTTP becomes serial).Test plan
cargo test --lib tasks::— 7/7 pass, including newcache_invalidate_prefix_leaves_other_scopesand the "no --involves=@me" regression assertion.cargo checkclean.tsc --noEmitclean.Open/Closed/Allshow only your involvements (not global).