Repository: apigee/registry
Pull request #562 (2022-05-02 17:18:51)

Remove unused function parameters
Detected using https://github.com/mvdan/unparam but it's also detecting
some unused params that aren't trivial to remove, so I won't enable the
linter on presubmit.

codecov[bot]: # [Codecov](https://codecov.io/gh/apigee/registry/pull/562?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee) Report
> Merging [#562](https://codecov.io/gh/apigee/registry/pull/562?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee) (3bbcea7) into [main](https://codecov.io/gh/apigee/registry/commit/e50abecda6911c30d0bccee331426c441d4d146f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee) (e50abec) will **increase** coverage by `0.00%`.
> The diff coverage is `62.96%`.

```diff
@@           Coverage Diff           @@
##             main     #562   +/-   ##
=======================================
  Coverage   41.49%   41.50%           
=======================================
  Files          69       69           
  Lines        8232     8228    -4     
=======================================
- Hits         3416     3415    -1     
+ Misses       4408     4406    -2     
+ Partials      408      407    -1     
```


| [Impacted Files](https://codecov.io/gh/apigee/registry/pull/562?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee) | Coverage Δ | |
|---|---|---|
| [server/registry/actions\_migrate\_database.go](https://codecov.io/gh/apigee/registry/pull/562/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-c2VydmVyL3JlZ2lzdHJ5L2FjdGlvbnNfbWlncmF0ZV9kYXRhYmFzZS5nbw==) | `0.00% <0.00%> (ø)` | |
| [cmd/registry/cmd/upload/artifact.go](https://codecov.io/gh/apigee/registry/pull/562/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NtZC91cGxvYWQvYXJ0aWZhY3QuZ28=) | `36.94% <46.66%> (ø)` | |
| [cmd/registry/diff/differ.go](https://codecov.io/gh/apigee/registry/pull/562/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2RpZmYvZGlmZmVyLmdv) | `69.39% <50.00%> (-0.34%)` | :arrow_down: |
| [cmd/registry/cmd/upload/manifest.go](https://codecov.io/gh/apigee/registry/pull/562/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NtZC91cGxvYWQvbWFuaWZlc3QuZ28=) | `57.40% <100.00%> (ø)` | |
| [cmd/registry/controller/controller.go](https://codecov.io/gh/apigee/registry/pull/562/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NvbnRyb2xsZXIvY29udHJvbGxlci5nbw==) | `76.85% <100.00%> (-0.11%)` | :arrow_down: |
| [cmd/registry/controller/parser.go](https://codecov.io/gh/apigee/registry/pull/562/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L2NvbnRyb2xsZXIvcGFyc2VyLmdv) | `85.32% <100.00%> (ø)` | |
| [...md/registry/plugins/registry-lint-spectral/main.go](https://codecov.io/gh/apigee/registry/pull/562/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L3BsdWdpbnMvcmVnaXN0cnktbGludC1zcGVjdHJhbC9tYWluLmdv) | `52.06% <100.00%> (+2.06%)` | :arrow_up: |
| [cmd/registry/scoring/parser.go](https://codecov.io/gh/apigee/registry/pull/562/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee#diff-Y21kL3JlZ2lzdHJ5L3Njb3JpbmcvcGFyc2VyLmdv) | `97.05% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/apigee/registry/pull/562?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apigee/registry/pull/562?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee). Last update [e50abec...3bbcea7](https://codecov.io/gh/apigee/registry/pull/562?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apigee).


Patch:
diff --git a/cmd/registry/cmd/count/revisions.go b/cmd/registry/cmd/count/revisions.go
index ed08fb8..dd2af8d 100644
--- a/cmd/registry/cmd/count/revisions.go
+++ b/cmd/registry/cmd/count/revisions.go
@@ -94,7 +94,7 @@ func (task *countSpecRevisionsTask) Run(ctx context.Context) error {
 		return err
 	}
 	count := 0
-	err = core.ListSpecRevisions(ctx, task.client, name, "", func(*rpc.ApiSpec) error {
+	err = core.ListSpecRevisions(ctx, task.client, name, func(*rpc.ApiSpec) error {
 		count++
 		return nil
 	})
diff --git a/cmd/registry/cmd/list/list.go b/cmd/registry/cmd/list/list.go
index fe0aa5c..abf0446 100644
--- a/cmd/registry/cmd/list/list.go
+++ b/cmd/registry/cmd/list/list.go
@@ -95,9 +95,9 @@ func matchAndHandleListCmd(
 	if strings.HasSuffix(name, "@-") {
 		name := strings.TrimSuffix(name, "@-")
 		if deployment, err := names.ParseDeployment(name); err == nil {
-			return core.ListDeploymentRevisions(ctx, client, deployment, filter, core.PrintDeployment)
+			return core.ListDeploymentRevisions(ctx, client, deployment, core.PrintDeployment)
 		} else if spec, err := names.ParseSpec(name); err == nil {
-			return core.ListSpecRevisions(ctx, client, spec, filter, core.PrintSpec)
+			return core.ListSpecRevisions(ctx, client, spec, core.PrintSpec)
 		}
 	}
 
diff --git a/cmd/registry/cmd/upload/artifact.go b/cmd/registry/cmd/upload/artifact.go
index 6b5aa12..66966c0 100644
--- a/cmd/registry/cmd/upload/artifact.go
+++ b/cmd/registry/cmd/upload/artifact.go
@@ -84,23 +84,23 @@ func buildArtifact(ctx context.Context, parent string, filename string) (*rpc.Ar
 	var artifact *rpc.Artifact
 	switch header.Kind {
 	case "DisplaySettings", patch.DisplaySettingsMimeType:
-		artifact, err = buildDisplaySettingsArtifact(ctx, jsonBytes)
+		artifact, err = buildDisplaySettingsArtifact(jsonBytes)
 	case "Lifecycle", patch.LifecycleMimeType:
-		artifact, err = buildLifecycleArtifact(ctx, jsonBytes)
+		artifact, err = buildLifecycleArtifact(jsonBytes)
 	case "Manifest", patch.ManifestMimeType:
 		artifact, err = buildManifestArtifact(ctx, parent, jsonBytes)
 	case "ReferenceList", patch.ReferenceListMimeType:
-		artifact, err = buildReferenceListArtifact(ctx, jsonBytes)
+		artifact, err = buildReferenceListArtifact(jsonBytes)
 	case "Score", patch.ScoreMimeType:
-		artifact, err = buildScoreArtifact(ctx, jsonBytes)
+		artifact, err = buildScoreArtifact(jsonBytes)
 	case "ScoreCard", patch.ScoreCardMimeType:
-		artifact, err = buildScoreCardArtifact(ctx, jsonBytes)
+		artifact, err = buildScoreCardArtifact(jsonBytes)
 	case "ScoreCardDefinition", patch.ScoreCardDefinitionMimeType:
 		artifact, err = buildScoreCardDefinitionArtifact(ctx, parent, jsonBytes)
 	case "ScoreDefinition", patch.ScoreDefinitionMimeType:
 		artifact, err = buildScoreDefinitionArtifact(ctx, parent, jsonBytes)
 	case "TaxonomyList", patch.TaxonomyListMimeType:
-		artifact, err = buildTaxonomyListArtifact(ctx, jsonBytes)
+		artifact, err = buildTaxonomyListArtifact(jsonBytes)
 	default:
 		err = fmt.Errorf("unsupported artifact type %s", header.Kind)
 	}
@@ -113,7 +113,7 @@ func buildArtifact(ctx context.Context, parent string, filename string) (*rpc.Ar
 	return artifact, nil
 }
 
-func buildDisplaySettingsArtifact(ctx context.Context, jsonBytes []byte) (*rpc.Artifact, error) {
+func buildDisplaySettingsArtifact(jsonBytes []byte) (*rpc.Artifact, error) {
 	m := &rpc.DisplaySettings{}
 	if err := protojson.Unmarshal(jsonBytes, m); err != nil {
 		return nil, err
@@ -128,7 +128,7 @@ func buildDisplaySettingsArtifact(ctx context.Context, jsonBytes []byte) (*rpc.A
 	}, nil
 }
 
-func buildLifecycleArtifact(ctx context.Context, jsonBytes []byte) (*rpc.Artifact, error) {
+func buildLifecycleArtifact(jsonBytes []byte) (*rpc.Artifact, error) {
 	m := &rpc.Lifecycle{}
 	if err := protojson.Unmarshal(jsonBytes, m); err != nil {
 		return nil, err
@@ -148,7 +148,7 @@ func buildManifestArtifact(ctx context.Context, parent string, jsonBytes []byte)
 	if err := protojson.Unmarshal(jsonBytes, m); err != nil {
 		return nil, err
 	}
-	errs := controller.ValidateManifest(ctx, parent, m)
+	errs := controller.ValidateManifest(parent, m)
 	if count := len(errs); count > 0 {
 		for _, err := range errs {
 			log.FromContext(ctx).WithError(err).Error("Manifest error")
@@ -165,7 +165,7 @@ func buildManifestArtifact(ctx context.Context, parent string, jsonBytes []byte)
 	}, nil
 }
 
-func buildReferenceListArtifact(ctx context.Context, jsonBytes []byte) (*rpc.Artifact, error) {
+func buildReferenceListArtifact(jsonBytes []byte) (*rpc.Artifact, error) {
 	m := &rpc.ReferenceList{}
 	if err := protojson.Unmarshal(jsonBytes, m); err != nil {
 		return nil, err
@@ -180,7 +180,7 @@ func buildReferenceListArtifact(ctx context.Context, jsonBytes []byte) (*rpc.Art
 	}, nil
 }
 
-func buildTaxonomyListArtifact(ctx context.Context, jsonBytes []byte) (*rpc.Artifact, error) {
+func buildTaxonomyListArtifact(jsonBytes []byte) (*rpc.Artifact, error) {
 	m := &rpc.TaxonomyList{}
 	if err := protojson.Unmarshal(jsonBytes, m); err != nil {
 		return nil, err
@@ -200,7 +200,7 @@ func buildScoreDefinitionArtifact(ctx context.Context, parent string, jsonBytes
 	if err := protojson.Unmarshal(jsonBytes, m); err != nil {
 		return nil, err
 	}
-	errs := scoring.ValidateScoreDefinition(ctx, parent, m)
+	errs := scoring.ValidateScoreDefinition(parent, m)
 	if count := len(errs); count > 0 {
 		for _, err := range errs {
 			log.FromContext(ctx).WithError(err).Error("ScoreDefinition error")
@@ -223,7 +223,7 @@ func buildScoreCardDefinitionArtifact(ctx context.Context, parent string, jsonBy
 	if err := protojson.Unmarshal(jsonBytes, m); err != nil {
 		return nil, err
 	}
-	errs := scoring.ValidateScoreCardDefinition(ctx, parent, m)
+	errs := scoring.ValidateScoreCardDefinition(parent, m)
 	if count := len(errs); count > 0 {
 		for _, err := range errs {
 			log.FromContext(ctx).WithError(err).Error("ScoreCardDefinition error")
@@ -241,7 +241,7 @@ func buildScoreCardDefinitionArtifact(ctx context.Context, parent string, jsonBy
 	}, nil
 }
 
-func buildScoreArtifact(ctx context.Context, jsonBytes []byte) (*rpc.Artifact, error) {
+func buildScoreArtifact(jsonBytes []byte) (*rpc.Artifact, error) {
 	m := &rpc.Score{}
 	if err := protojson.Unmarshal(jsonBytes, m); err != nil {
 		return nil, err
@@ -256,7 +256,7 @@ func buildScoreArtifact(ctx context.Context, jsonBytes []byte) (*rpc.Artifact, e
 	}, nil
 }
 
-func buildScoreCardArtifact(ctx context.Context, jsonBytes []byte) (*rpc.Artifact, error) {
+func buildScoreCardArtifact(jsonBytes []byte) (*rpc.Artifact, error) {
 	m := &rpc.ScoreCard{}
 	if err := protojson.Unmarshal(jsonBytes, m); err != nil {
 		return nil, err
diff --git a/cmd/registry/cmd/upload/bulk/protos.go b/cmd/registry/cmd/upload/bulk/protos.go
index ef6513a..1d0f395 100644
--- a/cmd/registry/cmd/upload/bulk/protos.go
+++ b/cmd/registry/cmd/upload/bulk/protos.go
@@ -80,7 +80,7 @@ func protosCommand() *cobra.Command {
 					log.FromContext(ctx).WithError(err).Fatal("Invalid path")
 				}
 
-				if err := scanDirectoryForProtos(ctx, client, projectID, baseURI, path, taskQueue); err != nil {
+				if err := scanDirectoryForProtos(client, projectID, baseURI, path, taskQueue); err != nil {
 					log.FromContext(ctx).WithError(err).Debug("Failed to walk directory")
 				}
 			}
@@ -91,7 +91,7 @@ func protosCommand() *cobra.Command {
 	return cmd
 }
 
-func scanDirectoryForProtos(ctx context.Context, client connection.Client, projectID, baseURI, root string, taskQueue chan<- core.Task) error {
+func scanDirectoryForProtos(client connection.Client, projectID, baseURI, root string, taskQueue chan<- core.Task) error {
 	return filepath.Walk(root, func(filepath string, info os.FileInfo, err error) error {
 		if err != nil {
 			return err
diff --git a/cmd/registry/cmd/upload/manifest.go b/cmd/registry/cmd/upload/manifest.go
index 6a5ef89..9c24183 100644
--- a/cmd/registry/cmd/upload/manifest.go
+++ b/cmd/registry/cmd/upload/manifest.go
@@ -65,7 +65,7 @@ func manifestCommand() *cobra.Command {
 			}
 
 			// validate the manifest
-			errs := controller.ValidateManifest(ctx, fmt.Sprintf("projects/%s/locations/global", projectID), manifest)
+			errs := controller.ValidateManifest(fmt.Sprintf("projects/%s/locations/global", projectID), manifest)
 			if len(errs) > 0 {
 				for _, err := range errs {
 					log.FromContext(ctx).WithError(err).Errorf("Invalid manifest entry")
diff --git a/cmd/registry/controller/controller.go b/cmd/registry/controller/controller.go
index 65b647c..5634ece 100644
--- a/cmd/registry/controller/controller.go
+++ b/cmd/registry/controller/controller.go
@@ -39,7 +39,7 @@ func ProcessManifest(
 	manifest *rpc.Manifest) []*Action {
 	var actions []*Action
 	//Check for errors in manifest
-	errs := ValidateManifest(ctx, fmt.Sprintf("projects/%s", projectID), manifest)
+	errs := ValidateManifest(fmt.Sprintf("projects/%s", projectID), manifest)
 	if len(errs) > 0 {
 		for _, err := range errs {
 			log.FromContext(ctx).WithError(err).Debugf("Error in manifest")
@@ -197,7 +197,6 @@ func generateUpdateActions(
 			targetResource.UpdateTimestamp(),
 			dependencyMaps,
 			generatedResource,
-			false,
 		)
 
 		if err != nil {
@@ -331,8 +330,7 @@ func needsUpdate(
 	targetResourceName patterns.ResourceName,
 	targetResourceTime time.Time,
 	dependencyMaps []map[string]time.Time,
-	generatedResource *rpc.GeneratedResource,
-	createMode bool) (bool, error) {
+	generatedResource *rpc.GeneratedResource) (bool, error) {
 	for i, dependency := range generatedResource.Dependencies {
 		dMap := dependencyMaps[i]
 		// Get the entity to look for in dependencyMap
diff --git a/cmd/registry/controller/parser.go b/cmd/registry/controller/parser.go
index 465f80b..617c681 100644
--- a/cmd/registry/controller/parser.go
+++ b/cmd/registry/controller/parser.go
@@ -15,7 +15,6 @@
 package controller
 
 import (
-	"context"
 	"fmt"
 	"regexp"
 	"strings"
@@ -24,7 +23,7 @@ import (
 	"github.com/apigee/registry/rpc"
 )
 
-func ValidateManifest(ctx context.Context, parent string, manifest *rpc.Manifest) []error {
+func ValidateManifest(parent string, manifest *rpc.Manifest) []error {
 	totalErrors := make([]error, 0)
 	for _, resource := range manifest.GeneratedResources {
 		errs := validateGeneratedResourceEntry(parent, resource)
diff --git a/cmd/registry/core/list.go b/cmd/registry/core/list.go
index e6fcc5a..71a061f 100644
--- a/cmd/registry/core/list.go
+++ b/cmd/registry/core/list.go
@@ -110,7 +110,6 @@ func ListDeployments(ctx context.Context,
 func ListDeploymentRevisions(ctx context.Context,
 	client *gapic.RegistryClient,
 	name names.Deployment,
-	filterFlag string,
 	handler DeploymentHandler) error {
 	it := client.ListApiDeploymentRevisions(ctx, &rpc.ListApiDeploymentRevisionsRequest{
 		Name: name.String(),
@@ -185,7 +184,6 @@ func ListSpecs(ctx context.Context,
 func ListSpecRevisions(ctx context.Context,
 	client *gapic.RegistryClient,
 	name names.Spec,
-	filterFlag string,
 	handler SpecHandler) error {
 	it := client.ListApiSpecRevisions(ctx, &rpc.ListApiSpecRevisionsRequest{
 		Name: name.String(),
diff --git a/cmd/registry/diff/differ.go b/cmd/registry/diff/differ.go
index 51e8517..2b0c08e 100644
--- a/cmd/registry/diff/differ.go
+++ b/cmd/registry/diff/differ.go
@@ -44,14 +44,12 @@ func (s *stack) push(str string) {
 	*s = append(*s, str)
 }
 
-func (s *stack) pop() (string, bool) {
+func (s *stack) pop() {
 	if s.isEmpty() {
-		return "", false
+		return
 	}
 	index := len(*s) - 1
-	element := (*s)[index]
 	*s = (*s)[:index]
-	return element, true
 }
 
 // GetDiff takes two yaml or json Open API 3 Specs and diffs them.
diff --git a/cmd/registry/patch/api.go b/cmd/registry/patch/api.go
index 5486a57..08e9e58 100644
--- a/cmd/registry/patch/api.go
+++ b/cmd/registry/patch/api.go
@@ -73,7 +73,7 @@ func newApi(ctx context.Context, client *gapic.RegistryClient, message *rpc.Api)
 	deployments := make([]*ApiDeployment, 0)
 	if err = core.ListDeployments(ctx, client, apiName.Deployment("-"), "", func(message *rpc.ApiDeployment) error {
 		var deployment *ApiDeployment
-		deployment, err = newApiDeployment(ctx, client, message)
+		deployment, err = newApiDeployment(message)
 		if err != nil {
 			return err
 		}
diff --git a/cmd/registry/patch/deployment.go b/cmd/registry/patch/deployment.go
index fe8acff..32de60f 100644
--- a/cmd/registry/patch/deployment.go
+++ b/cmd/registry/patch/deployment.go
@@ -19,7 +19,6 @@ import (
 	"strings"
 
 	"github.com/apigee/registry/connection"
-	"github.com/apigee/registry/gapic"
 	"github.com/apigee/registry/rpc"
 	"github.com/apigee/registry/server/registry/names"
 )
@@ -40,14 +39,14 @@ type ApiDeployment struct {
 }
 
 // relativeSpecRevisionName returns the versionid+specid if the spec is within the specified API
-func relativeSpecRevisionName(apiName names.Api, spec string) (string, error) {
+func relativeSpecRevisionName(apiName names.Api, spec string) string {
 	if spec == "" {
-		return "", nil
+		return ""
 	}
 	if strings.HasPrefix(spec, apiName.String()) {
-		return strings.TrimPrefix(spec, apiName.String()+"/versions/"), nil
+		return strings.TrimPrefix(spec, apiName.String()+"/versions/")
 	}
-	return spec, nil
+	return spec
 }
 
 // optionalSpecRevisionName returns a spec revision name if the subpath is not empty
@@ -58,15 +57,12 @@ func optionalSpecRevisionName(deploymentName names.Deployment, subpath string) s
 	return deploymentName.Api().String() + "/versions/" + subpath
 }
 
-func newApiDeployment(ctx context.Context, client *gapic.RegistryClient, message *rpc.ApiDeployment) (*ApiDeployment, error) {
+func newApiDeployment(message *rpc.ApiDeployment) (*ApiDeployment, error) {
 	deploymentName, err := names.ParseDeployment(message.Name)
 	if err != nil {
 		return nil, err
 	}
-	revisionName, err := relativeSpecRevisionName(deploymentName.Api(), message.ApiSpecRevision)
-	if err != nil {
-		return nil, err
-	}
+	revisionName := relativeSpecRevisionName(deploymentName.Api(), message.ApiSpecRevision)
 	return &ApiDeployment{
 		Header: Header{
 			ApiVersion: RegistryV1,
diff --git a/cmd/registry/patch/spec.go b/cmd/registry/patch/spec.go
index 1707bc3..5a02c40 100644
--- a/cmd/registry/patch/spec.go
+++ b/cmd/registry/patch/spec.go
@@ -26,7 +26,6 @@ import (
 
 	"github.com/apigee/registry/cmd/registry/core"
 	"github.com/apigee/registry/connection"
-	"github.com/apigee/registry/gapic"
 	"github.com/apigee/registry/rpc"
 	"github.com/apigee/registry/server/registry/names"
 )
@@ -43,7 +42,7 @@ type ApiSpec struct {
 	Data   ApiSpecData `yaml:"data"`
 }
 
-func newApiSpec(ctx context.Context, client *gapic.RegistryClient, message *rpc.ApiSpec) (*ApiSpec, error) {
+func newApiSpec(message *rpc.ApiSpec) (*ApiSpec, error) {
 	specName, err := names.ParseSpec(message.Name)
 	if err != nil {
 		return nil, err
diff --git a/cmd/registry/patch/version.go b/cmd/registry/patch/version.go
index d53b18f..ba1f075 100644
--- a/cmd/registry/patch/version.go
+++ b/cmd/registry/patch/version.go
@@ -45,7 +45,7 @@ func newApiVersion(ctx context.Context, client *gapic.RegistryClient, message *r
 
 	specs := make([]*ApiSpec, 0)
 	if err = core.ListSpecs(ctx, client, versionName.Spec("-"), "", func(message *rpc.ApiSpec) error {
-		spec, err := newApiSpec(ctx, client, message)
+		spec, err := newApiSpec(message)
 		if err != nil {
 			return err
 		}
diff --git a/cmd/registry/plugins/registry-lint-spectral/main.go b/cmd/registry/plugins/registry-lint-spectral/main.go
index c5b896d..6f09cc3 100644
--- a/cmd/registry/plugins/registry-lint-spectral/main.go
+++ b/cmd/registry/plugins/registry-lint-spectral/main.go
@@ -104,10 +104,7 @@ func (linter *spectralLinterRunner) RunImpl(
 		}
 
 		// Get the lint results as a LintFile object from the spectral output file
-		lintProblems, err := getLintProblemsFromSpectralResults(lintResults)
-		if err != nil {
-			return err
-		}
+		lintProblems := getLintProblemsFromSpectralResults(lintResults)
 
 		// Formulate the response.
 		lintFile := &rpc.LintFile{
@@ -158,7 +155,7 @@ func (linter *spectralLinterRunner) createConfigurationFile(root string, ruleIds
 
 func getLintProblemsFromSpectralResults(
 	lintResults []*spectralLintResult,
-) ([]*rpc.LintProblem, error) {
+) []*rpc.LintProblem {
 	problems := make([]*rpc.LintProblem, len(lintResults))
 	for i, result := range lintResults {
 		problem := &rpc.LintProblem{
@@ -178,7 +175,7 @@ func getLintProblemsFromSpectralResults(
 		}
 		problems[i] = problem
 	}
-	return problems, nil
+	return problems
 }
 
 func runSpectralLinter(specPath, configPath string) ([]*spectralLintResult, error) {
diff --git a/cmd/registry/scoring/parser.go b/cmd/registry/scoring/parser.go
index 294c9a9..75952e2 100644
--- a/cmd/registry/scoring/parser.go
+++ b/cmd/registry/scoring/parser.go
@@ -15,7 +15,6 @@
 package scoring
 
 import (
-	"context"
 	"fmt"
 	"sort"
 	"strings"
@@ -25,7 +24,7 @@ import (
 	"github.com/apigee/registry/cmd/registry/patterns"
 )
 
-func ValidateScoreDefinition(ctx context.Context, parent string, scoreDefinition *rpc.ScoreDefinition) []error {
+func ValidateScoreDefinition(parent string, scoreDefinition *rpc.ScoreDefinition) []error {
 	totalErrs := make([]error, 0)
 
 	// target_resource.pattern should be a valid resource pattern
@@ -87,7 +86,7 @@ func ValidateScoreDefinition(ctx context.Context, parent string, scoreDefinition
 	return totalErrs
 }
 
-func ValidateScoreCardDefinition(ctx context.Context, parent string, scoreCardDefinition *rpc.ScoreCardDefinition) []error {
+func ValidateScoreCardDefinition(parent string, scoreCardDefinition *rpc.ScoreCardDefinition) []error {
 	totalErrs := make([]error, 0)
 
 	// target_resource.pattern should be a valid resource pattern
diff --git a/server/registry/actions_migrate_database.go b/server/registry/actions_migrate_database.go
index 6ca1884..a1d7e39 100644
--- a/server/registry/actions_migrate_database.go
+++ b/server/registry/actions_migrate_database.go
@@ -35,7 +35,7 @@ func (s *RegistryServer) MigrateDatabase(ctx context.Context, req *rpc.MigrateDa
 	}
 	defer db.Close()
 
-	err = db.Migrate(ctx, req.Kind)
+	err = db.Migrate(ctx)
 	if err != nil {
 		return nil, status.Error(codes.Internal, err.Error())
 	}
diff --git a/server/registry/internal/storage/client.go b/server/registry/internal/storage/client.go
index 7d8c9b3..954edd3 100644
--- a/server/registry/internal/storage/client.go
+++ b/server/registry/internal/storage/client.go
@@ -142,7 +142,7 @@ func (c *Client) EnsureTables() error {
 	return nil
 }
 
-func (c *Client) Migrate(ctx context.Context, kind string) error {
+func (c *Client) Migrate(ctx context.Context) error {
 	return c.db.WithContext(ctx).AutoMigrate(entities...)
 }
 
diff --git a/server/registry/internal/storage/list.go b/server/registry/internal/storage/list.go
index 61021a0..a08ede7 100644
--- a/server/registry/internal/storage/list.go
+++ b/server/registry/internal/storage/list.go
@@ -845,7 +845,7 @@ func (c *Client) ListSpecArtifacts(ctx context.Context, parent names.Spec, opts
 		op = op.Where("spec_id = ?", id)
 	}
 
-	return c.listArtifacts(ctx, op, opts, func(a *models.Artifact) bool {
+	return c.listArtifacts(op, opts, func(a *models.Artifact) bool {
 		return a.ProjectID != "" && a.ApiID != "" && a.VersionID != "" && a.SpecID != ""
 	})
 }
@@ -889,7 +889,7 @@ func (c *Client) ListVersionArtifacts(ctx context.Context, parent names.Version,
 		op = op.Where("version_id = ?", id)
 	}
 
-	return c.listArtifacts(ctx, op, opts, func(a *models.Artifact) bool {
+	return c.listArtifacts(op, opts, func(a *models.Artifact) bool {
 		return a.ProjectID != "" && a.ApiID != "" && a.VersionID != ""
 	})
 }
@@ -933,7 +933,7 @@ func (c *Client) ListDeploymentArtifacts(ctx context.Context, parent names.Deplo
 		op = op.Where("deployment_id = ?", id)
 	}
 
-	return c.listArtifacts(ctx, op, opts, func(a *models.Artifact) bool {
+	return c.listArtifacts(op, opts, func(a *models.Artifact) bool {
 		return a.ProjectID != "" && a.ApiID != "" && a.DeploymentID != ""
 	})
 }
@@ -971,7 +971,7 @@ func (c *Client) ListApiArtifacts(ctx context.Context, parent names.Api, opts Pa
 		op = op.Where("api_id = ?", id)
 	}
 
-	return c.listArtifacts(ctx, op, opts, func(a *models.Artifact) bool {
+	return c.listArtifacts(op, opts, func(a *models.Artifact) bool {
 		return a.ProjectID != "" && a.ApiID != ""
 	})
 }
@@ -1000,12 +1000,12 @@ func (c *Client) ListProjectArtifacts(ctx context.Context, parent names.Project,
 		}
 	}
 
-	return c.listArtifacts(ctx, op, opts, func(a *models.Artifact) bool {
+	return c.listArtifacts(op, opts, func(a *models.Artifact) bool {
 		return a.ProjectID != ""
 	})
 }
 
-func (c *Client) listArtifacts(ctx context.Context, op *gorm.DB, opts PageOptions, include func(*models.Artifact) bool) (ArtifactList, error) {
+func (c *Client) listArtifacts(op *gorm.DB, opts PageOptions, include func(*models.Artifact) bool) (ArtifactList, error) {
 	token, err := decodeToken(opts.Token)
 	if err != nil {
 		return ArtifactList{}, status.Errorf(codes.InvalidArgument, "invalid page token %q: %s", opts.Token, err.Error())
@@ -1036,11 +1036,7 @@ func (c *Client) listArtifacts(ctx context.Context, op *gorm.DB, opts PageOption
 		}
 
 		for _, v := range page {
-			m, err := artifactMap(v)
-			if err != nil {
-				return ArtifactList{}, status.Error(codes.Internal, err.Error())
-			}
-
+			m := artifactMap(v)
 			match, err := filter.Matches(m)
 			if err != nil {
 				return ArtifactList{}, err
@@ -1065,7 +1061,7 @@ func (c *Client) listArtifacts(ctx context.Context, op *gorm.DB, opts PageOption
 	return response, nil
 }
 
-func artifactMap(artifact models.Artifact) (map[string]interface{}, error) {
+func artifactMap(artifact models.Artifact) map[string]interface{} {
 	return map[string]interface{}{
 		"name":        artifact.Name(),
 		"project_id":  artifact.ProjectID,
@@ -1077,5 +1073,5 @@ func artifactMap(artifact models.Artifact) (map[string]interface{}, error) {
 		"update_time": artifact.UpdateTime,
 		"mime_type":   artifact.MimeType,
 		"size_bytes":  artifact.SizeInBytes,
-	}, nil
+	}
 }


Test patch:
diff --git a/cmd/registry/scoring/parser_test.go b/cmd/registry/scoring/parser_test.go
index 1e8f3c9..dceda35 100644
--- a/cmd/registry/scoring/parser_test.go
+++ b/cmd/registry/scoring/parser_test.go
@@ -15,7 +15,6 @@
 package scoring
 
 import (
-	"context"
 	"testing"
 
 	"github.com/apigee/registry/cmd/registry/patterns"
@@ -743,8 +742,7 @@ func TestValidateScoreDefinition(t *testing.T) {
 
 	for _, test := range tests {
 		t.Run(test.desc, func(t *testing.T) {
-			ctx := context.Background()
-			gotErrs := ValidateScoreDefinition(ctx, test.parent, test.scoreDefinition)
+			gotErrs := ValidateScoreDefinition(test.parent, test.scoreDefinition)
 			if len(gotErrs) != test.wantNumErr {
 				t.Errorf("ValidateScoreDefinition(%s, %v) returned unexpected no. of errors: want %d, got %s", test.parent, test.scoreDefinition, test.wantNumErr, gotErrs)
 			}
@@ -1716,8 +1714,7 @@ func TestValidateScoreCardDefinition(t *testing.T) {
 
 	for _, test := range tests {
 		t.Run(test.desc, func(t *testing.T) {
-			ctx := context.Background()
-			gotErrs := ValidateScoreCardDefinition(ctx, test.parent, test.scoreCardDefinition)
+			gotErrs := ValidateScoreCardDefinition(test.parent, test.scoreCardDefinition)
 			if len(gotErrs) != test.wantNumErr {
 				t.Errorf("ValidateScoreCardDefinition(%s, %v) returned unexpected no. of errors: want %d, got %s", test.parent, test.scoreCardDefinition, test.wantNumErr, gotErrs)
 			}