Skip to content

make current Query object available via context - #10540

Merged
sipsma merged 3 commits into
dagger:mainfrom
sipsma:query-context
Jun 6, 2025
Merged

sipsma merged 3 commits into
dagger:mainfrom
sipsma:query-context

Conversation

@sipsma

@sipsma sipsma commented Jun 5, 2025 •

Copy link
Copy Markdown
Contributor

Spinning out from #10497 to double check it doesn't (somehow) break anything in isolation and to rip the bandaid on a huge source of rebase conflicts earlier.


Putting Query as a field in structs is a surprisingly significant source of pain when it comes to serializing/deserializing objects into/from the DB, mainly because the standard json marshal/unmarshal interfaces don't accept a context and thus don't allow smuggling of un-persistable things like Query (which is really just an interface to per-session/per-client state these days).

I dealt with it for a while but hitting more annoying cases (specifically when it's hidden behind objects wrapped in interfaces, i.e. GitRepository), so just want to squash it.

This whole problem is also unnecessary since now-a-days everything in query is based on the context anyways, so we can just plumb Query itself around through context for now.

There's probably even more detailed refactors possible here, but went with the approach here since it seemed to be easier to have AI do (though this still involved a somewhat painful amount of human hand-editing afterwards).


Draft while

  • I check a full integ suite test run in CI, subset passed locally.
  • Also fix new build errors from my last-minute rebase on main, apparently.

@sipsma
sipsma force-pushed the query-context branch 2 times, most recently from 1dac775 to f84835e Compare June 5, 2025 22:13
sipsma added 2 commits June 5, 2025 16:07
Signed-off-by: Erik Sipsma <[email protected]>
@sipsma
sipsma marked this pull request as ready for review June 5, 2025 23:41
@sipsma
sipsma requested review from jedevc and vito June 5, 2025 23:41

@vito vito left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! Always seemed like the winds were blowing this way 💨

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants