launchdarkly / ld-find-code-refs

Build tool for automatically sending feature flag code references to LaunchDarkly
https://launchdarkly.com
Other
45 stars 34 forks source link

Multi-Project Scanning exits early when empty projects are found #429

Closed arekmano closed 4 months ago

arekmano commented 4 months ago

Problem

Multi-project scanning exits early when no valid flags are found in an individual project. When determining which feature flags to scan for, upon encountering a project without any flags, execution exits early (link).

This is somewhat unexpected, as the CLI tool already handles edge cases gracefully. For example, by filtering feature flag names that are less than 3 characters long.

Impact

Our organization would like to rely on this tool to perform code scanning on projects. This bug is causing some issues that require hacky work-arounds with our current multi-project code scanning. Specifically, we now have to "pre-filter" the projects for those that contain feature flags, before using this tool.

Repro

  1. Create a LaunchDarkly project with no feature flags
  2. Create a LaunchDarkly project with a valid feature flag
  3. Run the cli tool scanning for references using both projects.
  4. Execution exits early

Solution

Rather than exiting early when an empty project is encountered, simply ignore that project, and log a warning

Additional Context

I am willing to contribute the code change, as long as I this is seen as a change that would be approved here.

jazanne commented 4 months ago

@arekmano this is definitely an oversight, thanks for reporting! Feel free to submit a fix, we really appreciate it

arekmano commented 4 months ago

A tentative PR was created to address this ^

jazanne commented 4 months ago

Fixed in 2.11.8. thank you @arekmano