MCPcopy Index your code
hub / github.com/rilldata/rill / TriggerParser

Method TriggerParser

admin/projects.go:452–473  ·  view source on GitHub ↗

TriggerParser triggers the deployment's project parser to do a new pull and parse.

(ctx context.Context, depl *database.Deployment)

Source from the content-addressed store, hash-verified

450
451// TriggerParser triggers the deployment's project parser to do a new pull and parse.
452func (s *Service) TriggerParser(ctx context.Context, depl *database.Deployment) (err error) {
453 s.Logger.Info("reconcile: triggering pull", zap.String("deployment_id", depl.ID), observability.ZapCtx(ctx))
454 defer func() {
455 if err != nil {
456 s.Logger.Error("reconcile: trigger pull failed", zap.String("deployment_id", depl.ID), zap.Error(err), observability.ZapCtx(ctx))
457 } else {
458 s.Logger.Info("reconcile: trigger pull completed", zap.String("deployment_id", depl.ID), observability.ZapCtx(ctx))
459 }
460 }()
461
462 rt, err := s.OpenRuntimeClient(depl)
463 if err != nil {
464 return err
465 }
466 defer rt.Close()
467
468 _, err = rt.CreateTrigger(ctx, &runtimev1.CreateTriggerRequest{
469 InstanceId: depl.RuntimeInstanceID,
470 Parser: true,
471 })
472 return err
473}
474
475// TriggerParserAndAwaitResource triggers the parser and polls the runtime until the given resource's spec version has been updated (or ctx is canceled).
476func (s *Service) TriggerParserAndAwaitResource(ctx context.Context, depl *database.Deployment, name, kind string) error {

Callers 2

processGithubPushMethod · 0.95
TriggerReconcileMethod · 0.80

Calls 7

OpenRuntimeClientMethod · 0.95
ZapCtxFunction · 0.92
InfoMethod · 0.80
StringMethod · 0.65
CloseMethod · 0.65
CreateTriggerMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected