Azure / appcat-rulesets

Repository for maintaining Rulesets for Windup
Eclipse Public License 2.0
5 stars 7 forks source link

Environment/system property rule not being trigged #225

Open brunoborges opened 3 weeks ago

brunoborges commented 3 weeks ago

Examples:

// Example 1
    private static SpringApplicationBuilder configureApplication(SpringApplicationBuilder builder) {
        System.setProperty("org.jboss.logging.provider", "slf4j");
        return builder.sources(SpringInitializer.class);
    }

// Example 2
        List<String> profiles = new ArrayList<>();
        if (Boolean.parseBoolean(System.getProperty("profile.eventScheduler", Boolean.toString(true)))) {
            profiles.add("EventScheduler");
        }
        if (Boolean.parseBoolean(System.getProperty("profile.taskScheduler", Boolean.toString(true)))) {
            profiles.add("TaskScheduler");
        }

// Example 3
    private String getSuffix() {
        String suffix = "";
        String instance = System.getenv("INSTANCE_ID");
        if (StringUtils.isNotEmpty(instance)) {
            String[] split = StringUtils.split(instance, "-");
            if (split.length > 0) {
                suffix = "-" + split[0];
            }
        }
        return suffix;
    }

// Example 4
    static {
        String port;
        if ((port = System.getProperty("test.port")) != null) {
            TEST_PORT = Integer.parseInt(port);
        }
    }

// Example 5
            HttpClient httpClient = HttpClient.create()
                    .proxy(proxy -> proxy
                            .type(ProxyProvider.Proxy.HTTP)
                            .host(System.getProperty("https.proxyHost"))
                            .port(Integer.valueOf(System.getProperty("https.proxyPort")))
                            .nonProxyHosts(createNonProxyPattern(System.getProperty("http.nonProxyHosts")))
                    );
kthatipally commented 2 days ago

No change in the pattern in both the versions. The above examples should have been triggered by the existing pattern.

agoncal commented 1 day ago

What about adding some more tests to make sure these patterns are triggered ?