apigee / apigeelint

Static code analysis for Apigee proxy bundles to encourage API developers to use best practices and avoid anti-patterns.
Apache License 2.0
93 stars 71 forks source link

BN003 - LookupCache may not have a corresponding PopulateCache #480

Open ssvaidyanathan opened 3 weeks ago

ssvaidyanathan commented 3 weeks ago

The logic for BN003 might not be right

The plugin basically checks for a key from LookupCache policy matches with the PopulateCache policy. It fails if the PopulateCache policy is not part of the bundle

This is a common use case where I could have the logic to populate the cache in one proxy and have the lookup in another..

Similarly I could have populating cache in one SharedFlow and the retrieval in another sharedflow.. This should not flag as an error...

DinoChiesa commented 2 weeks ago

Ya, that is a good point.

Do you know, What happens if the PopulateCache is done within one Shared flow, and the LookupCache is done from within another shared flow, and if the Scope for the policies is anything other than Global ? Does it work?

If the Scope is "Application" does it use the shared flow name? or the proxy name? Do you know? What about the other cases?