Skip to content

Commit

Permalink
Fix lingering references to old mime_type for style protos (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
shrutiparabgoogle authored Jun 17, 2022
1 parent 426d476 commit 93eeef2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions cmd/registry/scoring/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ func getMap(contents []byte, mimeType string) (map[string]interface{}, error) {
return unmarshalAndMap(contents, &metrics.Complexity{})
case "gnostic.metrics.Vocabulary":
return unmarshalAndMap(contents, &metrics.Vocabulary{})
case "google.cloud.apigeeregistry.applications.v1alpha1.ConformanceReport":
case "google.cloud.apigeeregistry.v1.style.ConformanceReport":
return unmarshalAndMap(contents, &rpc.ConformanceReport{})
case "google.cloud.apigeeregistry.applications.v1alpha1.Index":
return unmarshalAndMap(contents, &rpc.Index{})
case "google.cloud.apigeeregistry.applications.v1alpha1.Lint":
case "google.cloud.apigeeregistry.v1.style.Lint":
return unmarshalAndMap(contents, &rpc.Lint{})
case "google.cloud.apigeeregistry.v1.apihub.ReferenceList":
return unmarshalAndMap(contents, &rpc.ReferenceList{})
Expand Down
2 changes: 1 addition & 1 deletion cmd/registry/scoring/expression_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func TestGetMap(t *testing.T) {
},
},
},
mimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
mimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
wantMap: map[string]interface{}{
"name": "openapi.yaml",
"files": []interface{}{
Expand Down
42 changes: 21 additions & 21 deletions cmd/registry/scoring/score_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func TestCalculateScore(t *testing.T) {
seed: []seeder.RegistryResource{
&rpc.Artifact{
Name: "projects/score-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -202,7 +202,7 @@ func TestCalculateScore(t *testing.T) {
// score formula artifact
&rpc.Artifact{
Name: "projects/score-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -257,7 +257,7 @@ func TestCalculateScore(t *testing.T) {
// score formula artifact
&rpc.Artifact{
Name: "projects/score-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -355,7 +355,7 @@ func TestCalculateScore(t *testing.T) {
// score formula artifact
&rpc.Artifact{
Name: "projects/score-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -422,7 +422,7 @@ func TestCalculateScore(t *testing.T) {
// score formula artifact
&rpc.Artifact{
Name: "projects/score-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -550,7 +550,7 @@ func TestProcessScoreFormula(t *testing.T) {
seed := []seeder.RegistryResource{
&rpc.Artifact{
Name: "projects/score-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -714,7 +714,7 @@ func TestProcessScoreFormulaError(t *testing.T) {
seed: []seeder.RegistryResource{
&rpc.Artifact{
Name: "projects/score-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -752,7 +752,7 @@ func TestProcessScoreFormulaError(t *testing.T) {
seed: []seeder.RegistryResource{
&rpc.Artifact{
Name: "projects/score-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -842,7 +842,7 @@ func TestProcessScoreFormulaTimestamp(t *testing.T) {
// score formula artifact
&rpc.Artifact{
Name: "projects/score-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -882,7 +882,7 @@ func TestProcessScoreFormulaTimestamp(t *testing.T) {
// score formula artifact
&rpc.Artifact{
Name: "projects/score-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -932,7 +932,7 @@ func TestProcessScoreFormulaTimestamp(t *testing.T) {
// score formula artifact
&rpc.Artifact{
Name: "projects/score-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -971,7 +971,7 @@ func TestProcessScoreFormulaTimestamp(t *testing.T) {
// score formula artifact
&rpc.Artifact{
Name: "projects/score-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -1087,7 +1087,7 @@ func TestProcessRollUpFormula(t *testing.T) {
// lint artifact
&rpc.Artifact{
Name: "projects/rollup-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -1237,7 +1237,7 @@ func TestProcessRollUpFormulaError(t *testing.T) {
// lint artifact
&rpc.Artifact{
Name: "projects/rollup-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -1303,7 +1303,7 @@ func TestProcessRollUpFormulaError(t *testing.T) {
// lint artifact
&rpc.Artifact{
Name: "projects/rollup-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -1456,7 +1456,7 @@ func TestProcessRollUpFormulaTimestamp(t *testing.T) {
// lint artifact
&rpc.Artifact{
Name: "projects/rollup-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -1509,7 +1509,7 @@ func TestProcessRollUpFormulaTimestamp(t *testing.T) {
// lint artifact
&rpc.Artifact{
Name: "projects/rollup-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -1567,7 +1567,7 @@ func TestProcessRollUpFormulaTimestamp(t *testing.T) {
// lint artifact
&rpc.Artifact{
Name: "projects/rollup-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -1630,7 +1630,7 @@ func TestProcessRollUpFormulaTimestamp(t *testing.T) {
// lint artifact
&rpc.Artifact{
Name: "projects/rollup-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -1683,7 +1683,7 @@ func TestProcessRollUpFormulaTimestamp(t *testing.T) {
// lint artifact
&rpc.Artifact{
Name: "projects/rollup-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down Expand Up @@ -1741,7 +1741,7 @@ func TestProcessRollUpFormulaTimestamp(t *testing.T) {
// lint artifact
&rpc.Artifact{
Name: "projects/rollup-formula-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi.yaml/artifacts/lint-spectral",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.applications.v1alpha1.Lint",
MimeType: "application/octet-stream;type=google.cloud.apigeeregistry.v1.style.Lint",
Contents: protoMarshal(&rpc.Lint{
Name: "openapi.yaml",
Files: []*rpc.LintFile{
Expand Down

0 comments on commit 93eeef2

Please sign in to comment.