Skip to content

fix: let projects choose a Linear team after connecting Linear - #251

Merged
kalaspuff merged 2 commits into
mainfrom
fctl/232-after-connecting-linear-and-coming-back
Oct 24, 2026
Merged

kalaspuff merged 2 commits into
mainfrom
fctl/232-after-connecting-linear-and-coming-back

Conversation

@fctl-sh

@fctl-sh fctl-sh Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

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.

  • The team list fits Linear's limit. Linear prices a query by what it asks for, not by what it finds: 0.1 point a field, 1 an object, and a connection its children's points times its page size. The list asked for 100 teams, each with 25 workflow states and 50 projects. The control plane now counts the teams first (275 points), then asks for their workflows and open projects in pages sized to that count, at most 50 teams (4,880 points) a page. A workspace of 7 teams now costs 959 points, where it was refused at 10,640. Linear now filters out done and canceled projects, so each team's 50 are open ones, and the list goes up to 250 teams instead of 100. The API's response is unchanged, so the web app and older CLIs read it as before.
  • A test prices every query fctl sends to Linear by Linear's documented rules, and fails when one costs more than half the limit. It is checked against the examples in Linear's docs and against the 10,640 Linear answered.
  • Back from Linear, Linear is chosen again for the project's maintainers, with the team to choose next. The tab now also keeps its unsaved choice per project.

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. On main, 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 --quick passes.

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.

Before After
Before: back from Linear, GitHub Issues is chosen After: back from Linear, Linear is chosen and asks for a team

Choosing a team. Before, Linear refused the team list. Now the teams come, here with Engineering chosen, whose tickets start in In Progress.

Before After
Before: Linear's complexity error under an empty team picker After: Engineering chosen as the project's team

Worth confirming

  • Decision: Linear is chosen again whatever Linear answered, a cancelled or failed sign-in included, so that connecting again or choosing the team is the next step. It stays unsaved until someone saves it. People who can't change the tracker see what is stored.
  • Decision: the team list stops at 250 teams (100 before), each with its first 50 open projects (before: its first 50 projects, done and canceled ones included, which could crowd out the open ones).

fctl session

fctl-sh Bot added 2 commits October 24, 2026 00:26
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.
@fctl-sh
fctl-sh Bot requested a review from kalaspuff as a code owner October 24, 2026 00:43
@fctl-sh

fctl-sh Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

The two failed checks are one failure, and it doesn't come from this change. Rust tests failed in xtask's util::tests::runs_other_failures_once, and cargo xtask check only gathers the three parts. It is the race in #232: the test's stand-in wrangler couldn't start (Text file busy (os error 26), while another test's fork held its own script open for writing). The test expects an error anyway, so it carried on to read the script's run counter, which didn't exist: util.rs:397, No such file or directory.

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 Text file busy. Every other check passed, cargo xtask dev --smoke included.

The app's token can't rerun workflows (Resource not accessible by integration). Could someone with access rerun the failed job of the CI run?

@kalaspuff
kalaspuff merged commit e8298eb into main Oct 24, 2026
16 of 18 checks passed
@kalaspuff
kalaspuff deleted the fctl/232-after-connecting-linear-and-coming-back branch October 24, 2026 00:55
@fctl-sh

fctl-sh Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant