Hi there,
According to the API docs, the Configuration
interface should provide project-level settings for Compute Engine extensions:
Component to get effective configuration. Values of properties depend on the runtime environment:
- immutable project configuration in scanner.
- global configuration in web server. It does not allow to get the settings overridden on projects.
- project configuration in Compute Engine.
However if implementing a PostProjectAnalysisTask
it appears to not be the case, only the global configuration is available - any global setting that was overridden at a project-level is not reflected in the Configuration object.
Example:
PropertyDefinition.builder("DEMO_SETTING")
.category("DEMO PLUGIN")
.onQualifiers(Qualifiers.PROJECT)
.build()
public class DemoTask implements PostProjectAnalysisTask {
private final Configuration config;
public DemoTask(Configuration config) {
this.config = config;
}
@Override
public String getDescription() {
return "Demo";
}
@Override
public void finished(Context context) {
String setting = this.config.get("DEMO_SETTING")
// THE VALUE OF "setting" IS THE GLOBAL VALUE, NOT THE PROJECT-LEVEL VALUE
}
Are you able to confirm if this is a bug or if it is intended behaviour, in which case the API documentation should probably be updated
Thanks!
Sam