Repository navigation
fix: let projects choose a Linear team after connecting Linear - #251
Conversation
Linear prices a query by how much it asks for, whatever it finds: a field 0.1 point, an object 1, a connection its children's points times its page size. The team list asked for 100 teams, each with 25 states and 50 projects, which Linear counts as 10,640 points and refuses over 10,000, so no Linear workspace could choose a team. The control plane now counts the teams first (275 points) and asks for their workflows and open projects in pages sized to that, 50 teams at most (4,880 points). Linear filters out done and canceled projects, so the 50 a team gets are open ones. A test prices every query fctl sends to Linear by Linear's documented rules, checked against its examples and the 10,640 it answered.
Choosing Linear in a project's Tickets tab and connecting it there left for Linear before anything could be saved, since saving Linear takes a team. Back from Linear, the tab showed what was stored, GitHub Issues, under a banner asking for a team. Now Linear is chosen again for the project's maintainers, whatever Linear answered, and the tab keeps its draft per project.
|
The two failed checks are one failure, and it doesn't come from this change. Rust tests failed in xtask's This pull request doesn't touch xtask, which depends on none of the crates it changes. On this branch, the same test failed the same way in 1 of 20 local runs, and printing the error it swallows showed The app's token can't rerun workflows ( |
|
Deployed: main's CI run for e8298eb deployed it to app.fctl.sh, smoke test included, and pinned fctl.sh to its docs. It isn't in a release yet, and nothing in it waits for one: the change is all control plane and web app. |
Summary
Connecting Linear from a project's Tickets tab left people stuck in two ways. Back from Linear, the tab showed GitHub Issues chosen: Linear can't be saved without a team, so the tab fell back to what was stored. With Linear chosen again, the team picker failed with "Linear: The query is too complex. Complexity: 10640. Maximum allowed complexity: 10000.", for every Linear workspace, whatever its size.
Nothing here could reach Linear itself: there are no Linear credentials in this sandbox, and Linear checks authentication before it prices a query. Instead, I validated every Linear query against Linear's published schema with graphql-js. I also ran the flow end to end in
cargo xtask dev, against a Linear stand-in that runs queries on that schema and refuses those over 10,000 points, as Linear does. Onmain, the stand-in refused the team list at 10,640, as in production. On this branch, it answered 275 + 684 points for 7 teams. Pages came as 50 + 50 + 20 for 120 teams, and stopped at 250 teams for 260. Connecting, choosing a team and saving worked.cargo xtask check --quickpasses.Screenshots
At 1fe82b8: a project's Tickets tab in
cargo xtask dev, dark theme (the change looks the same in the light one).Back from connecting Linear. Before, GitHub Issues was chosen under the banner asking for a team. Now Linear is, with its team to choose next.
Choosing a team. Before, Linear refused the team list. Now the teams come, here with Engineering chosen, whose tickets start in In Progress.
Worth confirming
fctl session