feat(tracker): bind GitHub intake to user and labels#2527
feat(tracker): bind GitHub intake to user and labels#2527anirudh5harma wants to merge 3 commits into
Conversation
whoisasx
left a comment
There was a problem hiding this comment.
Review summary:
I found one blocker: the frontend repo preview parser still derives an owner/repo value from non-GitHub remotes, while the daemon rejects those origins. That can show a GitHub link for a GitLab or other remote and make the displayed intake scope misleading.
The rest of the GitHub identity, label catalog, preview, persistence, daemon wiring, and typed client surfaces look consistent to me. I verified the focused backend suites, CLI/daemon wiring suites, frontend typecheck, and changed frontend component tests locally; GitHub checks are also green.
@anirudh5harma, before shipping please also provide backing screenshots and clips for the settings/create flows, label picker, preview count, and the invalid or non-GitHub origin state after the parser mismatch is fixed.
e06227f to
22701b2
Compare
|
Feature demo github-intake-demo.mp4 |
746fd1e to
0a33776
Compare
|
GitHub’s usual multi-label filtering uses AND, while this picker uses OR. Could we add a short hint: “Matches any label; none includes all.” |
0a33776 to
8259ead
Compare
whoisasx
left a comment
There was a problem hiding this comment.
Requesting changes. The intake flow is close, but the Git remote parser can still mis-scope non-GitHub scp-like origins, and disabling intake can leave stale label config persisted.
Bind GitHub issue intake to the authenticated GitHub account, support repository-native label filters, and preview the count of matching issues before settings are saved. Removes the broad free-text assignee mode and makes intake scope visible without moving GitHub logic into Electron. Backend: - resolve the active login via GitHub GET /user and use it for every intake poll; the user is no longer configurable in project state - fetch the full repository label catalog (paginated) with a five-minute service cache and page-aware ETag revalidation - persist selected label names in the JSON-backed TrackerIntakeConfig (AND semantics; empty selection means all eligible open issues) - add a side-effect-free preview endpoint counting issues through the same repository, user, state, and label rules the observer uses - regenerate the OpenAPI contract and frontend schema from the controllers Frontend: - show repository and authenticated assignee as compact GitHub links - searchable multi-select label popover with colors, descriptions, missing-label handling, and manual refresh - inline matching open-issue count that refreshes as labels change - keep project creation compact and opt-in Rebased onto upstream/main.
8259ead to
b4ea9a0
Compare
whoisasx
left a comment
There was a problem hiding this comment.
Reviewed the latest head. The previous concerns around non-GitHub remote parsing and disabled-label handling look addressed, but I am requesting changes on two intake correctness issues: selected labels currently behave as OR despite the documented AND contract, and authenticated identity can stay cached across token changes.
|
|
||
| // MatchesAnyLabel reports whether the issue has at least one selected label. | ||
| // An empty selection means "all labels", so every issue matches. | ||
| func MatchesAnyLabel(issueLabels, selected []string) bool { |
There was a problem hiding this comment.
TrackerIntakeConfig.Labels documents that selected labels must all be present, but this helper returns true when any one selected label matches. Because both the observer and preview call Tracker.List without Labels and then rely on this helper, a config like bug + ready will spawn/count issues that have either label instead of both. Please change this to require every selected label, or update the contract and UI copy to explicitly be OR.
| func (t *Tracker) AuthenticatedUser(ctx context.Context) (domain.TrackerUser, error) { | ||
| t.identityMu.Lock() | ||
| defer t.identityMu.Unlock() | ||
| if t.authenticatedUser != nil { |
There was a problem hiding this comment.
This caches the authenticated user for the lifetime of the tracker, while the daemon token source can refresh gh auth token every five minutes and roundTrip reads the current token for each request. If the user switches GitHub auth while AO is running, intake can keep filtering by the old login while GitHub API calls use the newer token. Please tie the identity cache to token changes or give it a bounded TTL, and align the frontend identity cache with that.
|
From the NotesBot call on Relevant discussion excerpts:
Source thread: https://discord.com/channels/1476302178913357958/1528463891200217212/1528463891200217212 Generated by AO Bot based on the transcript from NotesBot. |
Summary
GitHub issue intake is now bound to the authenticated GitHub account, supports repository-native label filters, and previews the number of issues that match before settings are saved. This removes the broad
*assignee mode and makes intake scope visible and trustable without moving GitHub logic into Electron.Related: #2325
What this adds
Backend
GET /userendpoint and uses it for every intake poll; the user is no longer configurable in project state.GET /repos/{owner}/{repo}/labels, including pagination, names, colors, and descriptions.TrackerIntakeConfig; no SQLite migration is required. Multiple labels use AND semantics, while an empty selection means all eligible open issues assigned to the authenticated user.Frontend
Design notes
assigneeJSON field is ignored, and enabled intake binds to the account currently authenticated with GitHub.Validation
npm run frontend:typechecknpm --prefix frontend test— 49 files, 475 tests passedcd frontend && npx vite build --config vite.renderer.config.tscd backend && GOTOOLCHAIN=go1.25.7 go build ./... && GOTOOLCHAIN=go1.25.7 go vet ./...npm run apiwith no generated OpenAPI or TypeScript schema driftgolangci-lint v2.12.2— 0 issuesnpm run lintreaches the unchangedkilocodeinteractive-shell test and times out atTestAuthStatusUnknownWhenKeyOnlyComesFromInteractiveShell; all intake packages pass, and the linter was run separately above.Post-Deploy Monitoring & Validation
tracker intake: resolve authenticated user failed,tracker intake: list issues failed,GITHUB_LABELS_FAILED, andGITHUB_PREVIEW_FAILED.gh auth, repository labels load or revalidate without exhausting rate limits, preview counts match the observer's eligible set, and repeated polls do not create duplicate sessions.trackerIntake.enabledfor the affected project; roll back if the behavior reproduces across repositories.