(ctx context.Context)
| 189 | } |
| 190 | |
| 191 | func (node *ModTreeNode) tryRunGeneratorAsCheckScaleOut(ctx context.Context) (_ bool, rerr error) { |
| 192 | q, err := CurrentQuery(ctx) |
| 193 | if err != nil { |
| 194 | return true, err |
| 195 | } |
| 196 | |
| 197 | cloudClient, useCloud, err := q.CloudEngineClient(ctx, |
| 198 | node.RootAddress(), |
| 199 | node.PathString(), |
| 200 | nil, |
| 201 | ) |
| 202 | if err != nil { |
| 203 | return true, fmt.Errorf("engine-to-engine connect: %w", err) |
| 204 | } |
| 205 | if !useCloud { |
| 206 | return false, nil |
| 207 | } |
| 208 | defer func() { |
| 209 | rerr = errors.Join(rerr, cloudClient.Close()) |
| 210 | }() |
| 211 | |
| 212 | query, err := node.buildScaleOutModuleQuery(cloudClient.Dagger().QueryBuilder()) |
| 213 | if err != nil { |
| 214 | return true, err |
| 215 | } |
| 216 | |
| 217 | query = query.Select("generator").Arg("name", node.moduleLocalPathString()) |
| 218 | query = query.Select("run") |
| 219 | query = query.Select("isEmpty") |
| 220 | |
| 221 | var empty bool |
| 222 | if err := query.Bind(&empty).Execute(ctx); err != nil { |
| 223 | return true, err |
| 224 | } |
| 225 | |
| 226 | if !empty { |
| 227 | return true, fmt.Errorf("generate function %s produced changes; run 'dagger generate %s' to apply", |
| 228 | node.PathString(), node.PathString()) |
| 229 | } |
| 230 | |
| 231 | return true, nil |
| 232 | } |
| 233 | |
| 234 | func (node *ModTreeNode) runCheckLocally(ctx context.Context) error { |
| 235 | var status dagql.AnyResult |
no test coverage detected