Skip to content

Conversation

@theganyo
Copy link
Member

Allow nil when creating:

  • apis
  • artifacts
  • deployments
  • projects
  • specs
  • versions

Fixes #1198

Api: nil,
},
want: codes.InvalidArgument,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be difficult to keep these tests and change the expected value to codes.OK?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, I actually did that first... but: 1. it's redundant with the other test and, 2: there are no other OK checks here.

Copy link
Contributor

@timburks timburks Jun 20, 2023

Choose a reason for hiding this comment

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

Does 1. mean there are other tests that pass nil resources to create operations? I understand 2. but that's an artifact of the test organization and not really an indication of what we want to test.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added test for nil bodies that ensure that both there is no error and that the result is correct: https://github.com/apigee/registry/pull/1202/files#diff-25fea043835f743787d3ac3e0409c0e763af6e9bfdf07b0c7956394e3b604c48R78

Copy link
Member Author

Choose a reason for hiding this comment

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

But it's fine. I'll add it back in if you'd like.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, I thought that adding those back might have kept our coverage from dropping (very slightly, but that was surprising) - anyway, this LGTM. Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe coverage percentage dropped because there is less code to cover. :)

@codecov
Copy link

codecov bot commented Jun 20, 2023

Codecov Report

Merging #1202 (ac14214) into main (c601ea6) will decrease coverage by 0.05%.
The diff coverage is n/a.

❗ Current head ac14214 differs from pull request most recent head 183d1bd. Consider uploading reports for the commit 183d1bd to get more accurate results

@@            Coverage Diff             @@
##             main    #1202      +/-   ##
==========================================
- Coverage   71.90%   71.86%   -0.05%     
==========================================
  Files         146      146              
  Lines       12193    12175      -18     
==========================================
- Hits         8767     8749      -18     
  Misses       2746     2746              
  Partials      680      680              
Impacted Files Coverage Δ
server/registry/actions_apis.go 84.09% <ø> (-0.36%) ⬇️
server/registry/actions_artifacts.go 87.70% <ø> (-0.15%) ⬇️
server/registry/actions_deployments.go 79.24% <ø> (-0.39%) ⬇️
server/registry/actions_projects.go 92.10% <ø> (-0.21%) ⬇️
server/registry/actions_specs.go 81.48% <ø> (-0.26%) ⬇️
server/registry/actions_versions.go 84.09% <ø> (-0.36%) ⬇️

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

@theganyo theganyo merged commit 995ef9f into apigee:main Jun 20, 2023
@theganyo theganyo deleted the theganyo/issue1198 branch June 20, 2023 21:05
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.

Registry server: Allow nil bodies in create resource endpoints

2 participants