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

Method UpdateProjectVariables

cli/pkg/local/admin.go:137–160  ·  view source on GitHub ↗

UpdateProjectVariables implements drivers.AdminService.

(ctx context.Context, environment string, variables map[string]string)

Source from the content-addressed store, hash-verified

135
136// UpdateProjectVariables implements drivers.AdminService.
137func (l *localAdminService) UpdateProjectVariables(ctx context.Context, environment string, variables map[string]string) error {
138 if l.ch.AdminToken() == "" {
139 return drivers.ErrNotAuthenticated
140 }
141
142 client, err := l.ch.Client()
143 if err != nil {
144 return err
145 }
146
147 projects, err := l.ch.InferProjects(ctx, l.ch.Org, l.root)
148 if err != nil {
149 return err
150 }
151 project := projects[0]
152
153 _, err = client.UpdateProjectVariables(ctx, &adminv1.UpdateProjectVariablesRequest{
154 Org: project.OrgName,
155 Project: project.Name,
156 Environment: environment,
157 Variables: variables,
158 })
159 return err
160}
161
162// HasAnonymousSourceAccess implements [drivers.Driver].
163func (l *localAdminService) HasAnonymousSourceAccess(ctx context.Context, srcProps map[string]any, logger *zap.Logger) (bool, error) {

Callers

nothing calls this directly

Calls 4

AdminTokenMethod · 0.80
InferProjectsMethod · 0.80
ClientMethod · 0.45

Tested by

no test coverage detected