Skip to content

Draft: Reference polling API

Mikhail Mazurskiy requested to merge ash2k/ref-disc-poll-api into master

Relates to gitlab-org/cluster-integration/gitlab-agent#23 (closed).

This is a re-work of !2510 (closed). It's not ready to be merged. At this stage I'm looking for feedback on the general approach i.e. the RPC design. Can it be done better? The intention is to replace code in kas that downloads ref descovery and parses it each time. Instead it'd be better to:

  • parse ref discovery on the Gitaly side, ideally caching the result (i.e. commit id for a ref). This MR does not cache the result, only the unparsed ref discovery like sibling RPCs. Would be best to do properly and I can do it either in this MR or (preferably) in a follow up.
  • do the parsing lazily as full list of refs can be huge. This was the main concern on the !2510 (closed) MR, which I fully agree with. This MR doesn't do that yet. Happy to submit a separate MR before this one to make parsing incremental. I've already done this in kas where I have a copy of the parsing code which I'd like to get rid of by upstreaming the improvement into Gitaly. I've made a few optimizations in my "fork" of the parsing code too, which I also want to upstream.

Please let me know how you want me to move this forward. Cheers.

p.s. actually, git probably has a direct way to look up commit id for a ref? I have no idea.

Edited by Mikhail Mazurskiy

Merge request reports