Bug 557992 - [Passage] default requirement with no RequirementResolvers
Summary: [Passage] default requirement with no RequirementResolvers
Status: CLOSED FIXED
Alias: None
Product: Passage
Classification: Technology
Component: API (show other bugs)
Version: 0.6.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.9.0   Edit
Assignee: Elena Parovyshnaia CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks: 561380
  Show dependency tree
 
Reported: 2019-12-07 11:50 EST by Elena Parovyshnaia CLA
Modified: 2020-04-06 09:31 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Elena Parovyshnaia CLA 2019-12-07 11:50:53 EST
Say,

there is absolutely no RequirementResolvers in the proper registry.

And I ask BaseAccessManager to `resolveRequirements` for the following configuration: 
    product = "HappyHalloween"
    version = "31.10.2019"

The AccessManager comes up with the single-entry collection (that itself is not obvious, and either should be documented or reported as a bug). 

This single entry looks like this:
    licensing.feature.identifier = "HappyHalloween"
    licensing.feature.version = "0.0.0"

I'd expect "31.10.2019" to be the version. Is this a bug? 

This is rather a question then an actual bug report. 

But definitely a piece of documentation must appear as the result.
Comment 1 Alexander Fedorov CLA 2019-12-07 13:24:09 EST
Well, the initial idea was to handle any illegal state during requrement resolution with creating special instance of LicensingRequirement.
Now it does not look perfect and you may want to suggest better contract.

Returning version "0.0.0" in your case is a bug
Comment 2 Elena Parovyshnaia CLA 2019-12-08 04:49:51 EST
Can we treat `my case` as `there is no resolvers registerd` and fix the issue for that latter?
Comment 3 Elena Parovyshnaia CLA 2019-12-08 04:54:49 EST
The construction comes from [BaseAccessmanager, line 148]. Can I just construct version-aware instance here?
Comment 4 Alexander Fedorov CLA 2020-04-04 13:56:30 EDT
Please consider this during API revision
Comment 5 Elena Parovyshnaia CLA 2020-04-06 06:44:35 EDT
PR: https://github.com/eclipse-passage/passage/pull/186
Comment 6 Elena Parovyshnaia CLA 2020-04-06 06:45:15 EDT
 - `Access`s deals with requirement resolution by means of new
`Requirements` unit, which is public only because of tests
 - `Requirements` unit keeps an eye on the ResolvedRequirements
services registry behaviour and returns specially constructed
unsatisfiable requirement in case there is no services in the registry.
Comment 7 Elena Parovyshnaia CLA 2020-04-06 09:31:11 EDT
Verified by `RequirementsTest`