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

Global compatibility rule execution broken for RuleApplicationType.CREATE #358

Closed
jsenko opened this issue Apr 6, 2020 · 4 comments
Closed
Assignees
Labels
type/bug Something isn't working

Comments

@jsenko
Copy link
Member

jsenko commented Apr 6, 2020

Reproduction steps:

  • Create a global compatibility rule
  • Before creating an artifact, run a RuleApplicationType.CREATE rule check on the content
  • The global rule runs, but because it requires a "current" artifact version content, which is not present, it crashes with an NPE
@jsenko jsenko added the type/bug Something isn't working label Apr 6, 2020
@jsenko
Copy link
Member Author

jsenko commented Apr 6, 2020

This could be solved by a null check, but can happen again if we add more rules, so it should be clearly documented

@jsenko jsenko changed the title Global rule execution broken for RuleApplicationType.CREATE Global compatibility rule execution broken for RuleApplicationType.CREATE Apr 6, 2020
@jsenko jsenko self-assigned this Apr 6, 2020
@alesj
Copy link
Contributor

alesj commented Apr 6, 2020

Add a test for this ;-)

@EricWittmann
Copy link
Member

Perhaps each rule should indicate whether it requires previous content or not. That way we can know to skip some rules for CREATE vs UPDATE.

jsenko referenced this issue in jsenko/apicurio-registry Apr 6, 2020
@jsenko
Copy link
Member Author

jsenko commented Apr 6, 2020

PR #357 should fix the error, but not the possible design issue as @EricWittmann mentioned.

EricWittmann added a commit that referenced this issue Apr 8, 2020
* Fix REST endpoint not following specification

* Improve validation and error handling when registering scheme

* Fix imports

* Fix ambiguous dependency injection

* Add copyright headers

* Fix failing tests

* Better fix for #358

Co-authored-by: Eric Wittmann <eric.wittmann@gmail.com>
@EricWittmann EricWittmann assigned carlesarnal and unassigned jsenko May 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants