Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support both serialized protos and YAML #1181

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

theganyo
Copy link
Member

@theganyo theganyo commented Jun 6, 2023

Task 2 in #946: Update registry subcommands that read artifacts to support both serialized protos and YAML.

@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Merging #1181 (a818d2b) into main (8dab302) will increase coverage by 0.00%.
The diff coverage is 37.77%.

@@           Coverage Diff           @@
##             main    #1181   +/-   ##
=======================================
  Coverage   71.91%   71.92%           
=======================================
  Files         146      146           
  Lines       12097    12116   +19     
=======================================
+ Hits         8700     8714   +14     
- Misses       2721     2723    +2     
- Partials      676      679    +3     
Impacted Files Coverage Δ
...md/registry/cmd/compute/conformance/conformance.go 62.02% <0.00%> (ø)
cmd/registry/cmd/compute/lintstats/lintstats.go 6.25% <0.00%> (ø)
cmd/registry/cmd/compute/score/score.go 64.06% <0.00%> (ø)
cmd/registry/cmd/compute/scorecard/scorecard.go 64.06% <0.00%> (ø)
cmd/registry/scoring/score.go 75.15% <0.00%> (ø)
cmd/registry/scoring/scorecard.go 55.46% <0.00%> (ø)
pkg/mime/types.go 98.11% <0.00%> (-1.89%) ⬇️
cmd/registry/scoring/expression.go 47.61% <40.00%> (ø)
cmd/registry/patch/artifact.go 69.23% <47.05%> (+1.46%) ⬆️
cmd/registry/cmd/check/rules/rule1000/rule1000.go 87.14% <100.00%> (ø)
... and 4 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@theganyo
Copy link
Member Author

theganyo commented Jun 6, 2023

A note on my testing this: One interesting test I did was to run the full battery of tests after forcing the archive storage to default to yaml. I say interesting because everything works as expected... except the conformance tests:

--- FAIL: TestConformance (0.19s)
    --- FAIL: TestConformance/normal_case (0.05s)
        conformance_test.go:465: Failed getting artifact contents projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest: rpc error: code = NotFound desc = "projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest" not found in database
    --- FAIL: TestConformance/default_case (0.04s)
        conformance_test.go:465: Failed getting artifact contents projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-default: rpc error: code = NotFound desc = "projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-default" not found in database
    --- FAIL: TestConformance/multiple_severity (0.03s)
        conformance_test.go:465: Failed getting artifact contents projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-multiple-severity: rpc error: code = NotFound desc = "projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-multiple-severity" not found in database
    --- FAIL: TestConformance/multiple_state (0.04s)
        conformance_test.go:465: Failed getting artifact contents projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-multiple-state: rpc error: code = NotFound desc = "projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-multiple-state" not found in database
    --- FAIL: TestConformance/multiple_linter (0.04s)
        conformance_test.go:465: Failed getting artifact contents projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-multiple-linter: rpc error: code = NotFound desc = "projects/conformance-test/locations/global/apis/petstore/versions/1.0.0/specs/openapi/artifacts/conformance-openapitest-multiple-linter" not found in database

I couldn't identify why these were failing as the conformance tests aren't really unit tests - they start processes and move data around in ways that are hidden from the test suite. In addition, nothing was logged that indicated what the root cause might be.

In any case, this maybe isn't something that necessarily needs to be addressed within this PR, but it is something that will need to be addressed before we can finish #946.

@theganyo theganyo requested a review from timburks June 6, 2023 23:39
@timburks
Copy link
Contributor

timburks commented Jun 7, 2023

after forcing the archive storage to default to yaml

Just wondering... how did you do that? By temporarily hard-coding this to true?

Copy link
Contributor

@timburks timburks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious about the conformance test problem, but that's not breaking anything since we're still using proto storage and testing everything with that. LGTM!

ctx context.Context
}{
{"application/octet-stream", context.Background()},
{"application/yaml", SetStoreArchivesAsYaml(context.Background())},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is our main test that this works, right? Verifying that all artifact types can be stored and read in both formats? (just thinking out loud... LGTM)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@theganyo
Copy link
Member Author

theganyo commented Jun 7, 2023

after forcing the archive storage to default to yaml

Just wondering... how did you do that? By temporarily hard-coding this to true?

Close, but here

@theganyo theganyo merged commit f3ddf3b into apigee:main Jun 7, 2023
@theganyo theganyo deleted the theganyo/issue946 branch June 7, 2023 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants