All notable changes to the ld-find-code-refs program will be documented in this file. This project adheres to Semantic Versioning.
- Additional performance enhancements for matching flag keys with delimiters.
- Matching flags with delimiters has been implemented in a more performant way.
- File globbing for FilePattern alias support.
repoName
is now a supported configuration option for github action and bitbucket pipes 🎉. This is especially useful for a monorepo where multiple yaml configurations exist, each mapping to its own LD project key.
ld-find-code-refs
will now scan for archived flags.
- Fixes a bug causing
ld-find-code-refs
to scan non-regular files, like symlinks. Thanks @d3d-z7n!
ℹ️ This release includes breaking changes to the command line tool. If you experience errors or unexpected behavior after upgrading, be sure to read these changelog notes carefully to make adjustments for any breaking changes.
- Most command line flags can now be specified in a YAML file located in the
.launchdarkly/coderefs.yaml
subdirectory of your repository. docs- The following options cannot be specified in YAML, and must be set using the command line or as environment variables:
--dir
/LD_DIR
--accessToken
/LD_ACCESS_TOKEN
- The following options cannot be specified in YAML, and must be set using the command line or as environment variables:
- All command line flags can now be specified as environment variables. docs
- When flags with no code references are detected,
ld-find-code-refs
will search Git commit history to detect when the last reference to a feature flag was removed. Use the--lookback
command line flag to configure the number of commits you would like to search. The lookback will start at the current commit and will review up to the last n commits to find the last reference of the flag. The default is 10 commits. - Added support for scanning non-git repositories. Use the
--revision
flag to specify your repository version number. - Added the
prune
sub-command to delete stale code reference data from LaunchDarkly manually by providing a list of branch names as arguments. example:ld-find-code-refs prune [flags] "branch1" "branch2"
- The GitHub actions wrapper now supports the
pull_request
event
- Exclude negations in
.ldignore
(lines beginning with an exclamation mark) now correctly include files.
- Command line arguments names have been improved. Now, a flag specified with a single dash indicates a shorthand name, while 2 dashes indicate the longform name. Some existing configurations may be invalid, see
ld-find-code-refs --help
for details. - The default delimiters (single quotes, double quotes and backticks) can now be disabled in the
coderefs.yaml
configuration. docs. Delimiters can no longer be specified using command line flags or environment variables. If you use additional delimiters, or would like to disable delimiters completely, use YAML configuration instead.
- The
exclude
command-line option has been removed. Use the.ldignore
file instead. ld-find-code-refs
no longer requires the silver searcher (ag) as a runtime dependency.
- Added support for specifying a custom default branch for the GitHub actions and Bitbucket pipes wrappers.
- Added the ability to configure flag alias detection using a YAML configuration. See the README for instructions.
- Improved logging around limitations.
- Fixed an edge case where false positives might be picked up for flag keys containing regular expression characters.
- Added a
--ignoreServiceErrors
option to the CLI. If enabled, the scanner will terminate with exit code 0 when the LaunchDarkly API is unreachable or returns an unexpected response.
- ld-find-code-refs now requires go1.13 to build.
- Fixed a regression causing no references to be found when a relative path is supplied to
dir
- Added a
--outDir
option to the CLI. If provided, code references will be written to a csv file inoutDir
. - Added a
--dryRun
option to the CLI. If provided,ld-find-code-refs
will scan for code references without sending them to LaunchDarkly. May be used in conjunction with--outDir
to output code references data to a csv file instead of sending data to LaunchDarkly.
ld-find-code-refs
now supports scanning repositories with a large number of flags using a pagination strategy. Thanks @cuzzasoft!- Delimiters will now always be respected when searching for flags referenced in code. This fixes a bug causing references for certain flag keys to match against other flag keys that are substrings of the matched reference.
- Added a
--branch
option to the CLI. This lets a branch name be manually specified when the repo is in a detached head state. - Github actions v2 support: the github actions wrapper reads the branch name from
GITHUB_REF
and populates thebranch
option with it.
ld-find-code-refs
will no longer exit with a fatal error when Git credentials have not been configured (required for branch cleanup). Instead, a warning will be logged.
ld-find-code-refs
will now remove branches that no longer exist in the git remote from LaunchDarkly.
- Fixed a potential bug causing
.ldignore
paths to not be detected in some environments. - When
.ldignore
is found, a debug message is logged.
Official release
- Added support for Windows.
ld-find-code-refs
releases will now contain a windows executable. - Added a new option
-delimiters
(-D
for short), which may be specified multiple times to specify delimiters used to match flag keys.
- The
dir
command line option was marked as optional, but is actually required.ld-find-code-refs
will now recognize this option as required. ld-find-code-refs
was performing extra steps to ignore directories for files in directories matched by patterns in.ldignore
. This ignore process has been streamlined directly into the search so files in.ldignore
are never scanned.
- The command-line docker image now specifies
ld-find-code-refs
as the entrypoint. See our documentation for instructions on runningld-find-code-refs
via docker. ld-find-code-refs
will now only match flag keys delimited by single-quotes, double-quotes, or backticks by default. To add more delimiters, use thedelimiters
command line option.
- Added a new command line argument,
version
. If provided, the currentld-find-code-refs
version number will be logged, and the scanner will exit with a return code of 0. - The
debug
option is now available to the CircleCI orb. - Added support for parsing
.ldignore
files specified in the root directory of the scanned repository..ldignore
may be used to specify a pattern (compatible with the.gitignore
spec: https://git-scm.com/docs/gitignore#_pattern_format) for files to exclude from scanning.
- The internal API for specifying the default git branch (
defaultBranch
) has been changed. ThedefaultBranch
argument on earlier versions ofld-find-code-refs
will no longer do anything.
ld-find-code-refs
will no longer error out if an unknown error occurs when scanning for code reference hunks within a file. Instead, an error will be logged.
- Added support for parsing
.ldignore
files specified in the root directory of the scanned repository..ldignore
may be used to specify a pattern (compatible with the.gitignore
spec: https://git-scm.com/docs/gitignore#_pattern_format) for files to exclude from scanning.
- Generate deb and rpm packages when releasing artifacts.
- Automate Homebrew releases
- Added word boundaries to flag key regexes.
- This should reduce false positives. E.g. for flag key
cool-feature
we will no longer matchverycool-features
.
- This should reduce false positives. E.g. for flag key
- Added support for relative paths to CLI
-dir
parameter. - Added a new command line argument,
debug
, which enables verbose debug logging. ld-find-code-refs
will now exit early if required dependencies are not installed on the system PATH.
- Renamed
parse
package tocoderefs
. TheParse()
method in the aformentioned package is nowScan()
.
ld-find-code-refs
will no longer erroneously make PATCH API requests to LaunchDarkly when url template parameters have not been configured.
- Added openssh as a dependency for the command-line docker image.
- The default for
contextLines
is now 2. To disable sending source code to LaunchDarkly, set thecontextLines
argument to-1
. - Improved logging to provide more detailed summaries of actions performed by the scanner.
- Fixed a bug in the CircleCI orb config causing
contextLines
to be a string parameter, instead of an integer.
- Removed the
repoHead
parameter.ld-find-code-refs
now only supports scanning repositories already checked out to the desired branch. - Removed an unnecessary dependency on openssh in Dockerfiles.
- Fix a bug causing an error to be returned when a repository connection to LaunchDarkly does not initially exist on execution.
- Removed the
cloneEndpoint
command line argument.ld-find-code-refs
now only supports scanning existing repository clones.
- Use case-sensitive
ag
search so we don't get false positives that look like flag keys but have different casing.
- This project has been renamed to
ld-find-code-refs
. - Logging has been overhauled.
- Project layout has been updated to comply with https://github.com/golang-standards/project-layout.
updateSequenceId
is now an optional parameter. If not provided, data will always be updated. If provided, data will only be updated if the existingupdateSequenceId
is less than the newupdateSequenceId
.- Payload limits have been implemented
- Flags with keys shorter than 3 characters are no longer supported.
- Lines are truncated after 500 characters.
- Search is terminated after 5,000 files are matched.
- Search is terminated after 5,000 hunks are generated.
- Number of hunks per file is limited to 1,000.
- A file can only have 500 hunked lines per flag.
- Use
launchdarkly
docker hub namespace instead ofldactions
.
pushTime
CLI arg renamed toupdateSequenceId
. Its type has been changed from timestamp to integer.- Note: this is not considered a breaking change as the CLI args are still in flux. After the 1.0 release arg changes will be considered breaking.
- Upserting repos no longer fails on non-existent repos
- Automated release pipeline for github releases and docker images
- Changelog