Update to v2 API (using SDK)#203
Conversation
|
@claude review |
|
Claude finished @chrisghill's task in 1m 55s —— View job Code Review
Overall this is a clean migration — the new Bugs1. Dead The // src/resource/delete.go:10-16
func Delete(ctx context.Context, svc ResourceService, id, field string) error {
...
return svc.DeleteResource(ctx, id) // field is silently dropped
}Either remove the 2. // cmd/resource.go:98-101
schemasFile, err := os.Open(schemasPath)
if err != nil {
return telemetry.LogError(span, err, "unable to open schemas file")
}
// no defer schemasFile.Close()The file handle leaks on every successful publish. Add Minor Issues3. Stale
artFilePath, err := cmd.Flags().GetString("file")
artName, err := cmd.Flags().GetString("name")
var artFile *os.FileThese are cosmetic but confusing given the package rename. Fix this → 4. Stale flag description in resourcePublishCmd.Flags().StringP("schema-file", "s", "../schema-artifacts.json", "Path to artifact schema file")
// ^^^^^^^^^^ still says "artifact"5. Both Observation (not blocking)6. Pre-release SDK version pinned in This is a pseudo-version pointing to an unreleased commit. Fine for development, but worth tagging a stable release before merging if CI isn't already blocking on this. What's working well
|
Summary of changes:
cmd/deployment.go— dropped the dead deployments.NewService(mdClient) line and passed provClient.Deployments (the pre-wired service the new provisioning.NewClient() returns) into deployment.UpdateDeploymentStatus.cmd/resource.go— replaced the missing massdriver/client import with massdriver/provisioning, and now use provClient.Resources for both publish and delete.src/resource/main_test.go— consolidated the fake service: struct + both CreateResource and DeleteResource methods live here.src/resource/publish_test.go— removed the stale duplicate method (which set CreateCalled on delete by mistake); fixed the assertion message; fixed the leading-space typo in "resourceName".src/resource/delete_test.go— removed the artifact-era DeleteArtifact method (now lives in main_test.go as DeleteResource); test now exercises the real resource.Delete path.