All notable changes to the ld-find-code-refs program will be documented in this file. This project adheres to Semantic Versioning.
subdirectory
option to set path to.launchdarkly/coderefs.yaml
config file if not located in the root, in order to support monorepo subdirectories.
- Updated dependencies
- Enable scanning of github workflow files #441
- Streamline HTTP client used in requests #438
- Use same http client with rate-limited retries for ld api client calls #437
- Respect rate-limit headers during retries #434
- Updated dependencies
- Multi-project scans now ignore projects without valid flags #430
- Updated docker images to use alpine 3.19.1 (#426)
- Dependencies updated
- Fixes index out of range error during extinction scanning #425
- Allow prune stage to be disabled #405
- Disable branch pruning by default in GitHub action #405
- Dependency updates
- Dependencies updated
- Dependencies updated
- Docker image was not being built with correct alpine version (does not affect github or bitbucket integrations)
- Updates to release process
- Update docker images
- Update app to go 1.20
- Update dependencies
- Update module-path to v2 #362
- Performance improvements around searching for flag extinctions in commit diffs, including changing search to use Aho-Corasick algorithm to find flags.
- Updated dependencies
- Error parsing git tag name when tag is annotated #329
- Bug introduced in 2.5.0 caused extinction scanning to run for hours and timeout.
- Typo in CircleCI orb caused failures
- CircleCI - pipeline exits with error when
$BASH_ENV
doesn't exist.
Added:
- CircleCI orb - manually source
BASH_ENV
since the orb usessh
entrypoint instead ofbash
Changed:
- Update dependencies
Fixed:
- Monorepo configuration should not require that a
dir
be specified for each project key, as described in the documentation
Added:
- Support doublestar glob patterns in
filepattern
aliases
Changed:
- Update dependencies
- Log a warning when a
filepattern
alias configuration does not match any files instead of failing - Bumped dependencies
- Error running code refs when using a newer API token with version
20220603
and later.
- update documentation
- bumped dependencies
- error running CircleCI orb
- git repo permissions in GitHub Action
gitlab
is a supportedrepoType
- Optional
defaultBranch
will fallback tomain
when not provided, instead ofmaster
- Bumped dependencies
- Added debug logging
- Update release configuration
- Change in release process lead to build with incorrect docker image tag
- Slice bounds out of range error when saving hunks (#224)
- Enable builds for arm64 (#221)
- Only a single flag per run was being searched for extinctions
extinctions
command that will only generate and send extinctions using thelookback
parameter
- Added additional examples for GitHub Action repo on how to configure the action
- Only a single flag per run was being searched for extinctions
extinctions
command that will only generate and send extinctions using thelookback
parameter
- Added additional examples for GitHub Action repo on how to configure the action
- Snake case aliases we not being correctly generated due to bug in dependency.
- If new
projects
block is used with CSV output, the first project key is used in the output file name. If still usingprojKey
there is no change.
- Monorepo with starting directory support. More info can be read at Projects.
- Relative paths were not being expanded to an absolute path when used.
- Find Code References GitHub Action is moving to semver versioning. Previously it was a major version that was incremented on every release of the underlying command line tool. Now the GitHub Action version will mirror the command line tooling version. This is moving it from
v14
tov2.4.1
- Performance improvements around searching for flags and aliases in the code base. Including changing search to use Aho-Corasick algorithm to find flags in file.
- If
--dryRun
is set, extinctions will not be attempted.
--allowTags
which allows Code Refs to run against a tag instead of the branch.
- Bug where alias filepattern's were not being validated. This meant
ld-find-code-refs
would run but if that file did not exist no aliases were generated.
- Performance improvements around searching for flags and aliases in the code base.
- 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