MCPcopy Index your code
hub / github.com/coder/coder / Graph

Method Graph

provisioner/echo/serve.go:235–259  ·  view source on GitHub ↗
(sess *provisionersdk.Session, req *proto.GraphRequest, canceledOrComplete <-chan struct{})

Source from the content-addressed store, hash-verified

233}
234
235func (*echo) Graph(sess *provisionersdk.Session, req *proto.GraphRequest, canceledOrComplete <-chan struct{}) *proto.GraphComplete {
236 responses, err := readResponses(
237 sess,
238 strings.ToLower(req.GetMetadata().GetWorkspaceTransition().String()),
239 "graph.protobuf")
240 if err != nil {
241 return &proto.GraphComplete{Error: err.Error()}
242 }
243 for _, response := range responses {
244 if log := response.GetLog(); log != nil {
245 sess.ProvisionLog(log.Level, log.Output)
246 }
247 if complete := response.GetGraph(); complete != nil {
248 if len(complete.AiTasks) > 0 {
249 // These two fields are linked; if there are AI tasks, indicate that.
250 complete.HasAiTasks = true
251 }
252 return complete
253 }
254 }
255
256 // some tests use Echo without a complete response to test cancel
257 <-canceledOrComplete
258 return provisionersdk.GraphError("canceled")
259}
260
261// Plan reads requests from the provided directory to stream responses.
262func (*echo) Plan(sess *provisionersdk.Session, req *proto.PlanRequest, canceledOrComplete <-chan struct{}) *proto.PlanComplete {

Callers

nothing calls this directly

Calls 9

GraphErrorFunction · 0.92
readResponsesFunction · 0.85
ProvisionLogMethod · 0.65
StringMethod · 0.45
GetMetadataMethod · 0.45
ErrorMethod · 0.45
GetLogMethod · 0.45
GetGraphMethod · 0.45

Tested by

no test coverage detected