All notable changes to the ld-find-code-refs program will be documented in this file. This project adheres to Semantic Versioning.
--skipArchivedFlagsoption to instruct the tool to ignore any flag keys it finds from archived flags
- replaced the stdlib
regexpwithgo-re2for improved regexp compilation and pattern matching - now using caching to optimize file globbing and regex compilation
- move off of legacy
olekukonko/tablewriterand ontov1.x - updated to the latest version of the LaunchDarkly API (17.2.0)
subdirectoryoption now works withprojects[*].dirconfiguration, and produces correct "View in source" links in the LD UI
subdirectoryoption to set path to.launchdarkly/coderefs.yamlconfig 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_ENVdoesn't exist.
Added:
- CircleCI orb - manually source
BASH_ENVsince the orb usesshentrypoint instead ofbash
Changed:
- Update dependencies
Fixed:
- Monorepo configuration should not require that a
dirbe specified for each project key, as described in the documentation
Added:
- Support doublestar glob patterns in
filepatternaliases
Changed:
- Update dependencies
- Log a warning when a
filepatternalias configuration does not match any files instead of failing - Bumped dependencies
- Error running code refs when using a newer API token with version
20220603and later.
- update documentation
- bumped dependencies
- error running CircleCI orb
- git repo permissions in GitHub Action
gitlabis a supportedrepoType- Optional
defaultBranchwill fallback tomainwhen 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
extinctionscommand that will only generate and send extinctions using thelookbackparameter
- Added additional examples for GitHub Action repo on how to configure the action
- Only a single flag per run was being searched for extinctions
extinctionscommand that will only generate and send extinctions using thelookbackparameter
- 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
projectsblock is used with CSV output, the first project key is used in the output file name. If still usingprojKeythere 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
v14tov2.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
--dryRunis set, extinctions will not be attempted.
--allowTagswhich 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-refswould 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.
repoNameis 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-refswill now scan for archived flags.
- Fixes a bug causing
ld-find-code-refsto 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.yamlsubdirectory 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-refswill search Git commit history to detect when the last reference to a feature flag was removed. Use the--lookbackcommand 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
--revisionflag to specify your repository version number. - Added the
prunesub-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_requestevent
- 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 --helpfor details. - The default delimiters (single quotes, double quotes and backticks) can now be disabled in the
coderefs.yamlconfiguration. 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
excludecommand-line option has been removed. Use the.ldignorefile instead. ld-find-code-refsno 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
--ignoreServiceErrorsoption 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
--outDiroption to the CLI. If provided, code references will be written to a csv file inoutDir. - Added a
--dryRunoption to the CLI. If provided,ld-find-code-refswill scan for code references without sending them to LaunchDarkly. May be used in conjunction with--outDirto output code references data to a csv file instead of sending data to LaunchDarkly.
ld-find-code-refsnow 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
--branchoption 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_REFand populates thebranchoption with it.
ld-find-code-refswill 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-refswill now remove branches that no longer exist in the git remote from LaunchDarkly.
- Fixed a potential bug causing
.ldignorepaths to not be detected in some environments. - When
.ldignoreis found, a debug message is logged.
Official release
- Added support for Windows.
ld-find-code-refsreleases will now contain a windows executable. - Added a new option
-delimiters(-Dfor short), which may be specified multiple times to specify delimiters used to match flag keys.
- The
dircommand line option was marked as optional, but is actually required.ld-find-code-refswill now recognize this option as required. ld-find-code-refswas 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.ldignoreare never scanned.
- The command-line docker image now specifies
ld-find-code-refsas the entrypoint. See our documentation for instructions on runningld-find-code-refsvia docker. ld-find-code-refswill now only match flag keys delimited by single-quotes, double-quotes, or backticks by default. To add more delimiters, use thedelimiterscommand line option.
- Added a new command line argument,
version. If provided, the currentld-find-code-refsversion number will be logged, and the scanner will exit with a return code of 0. - The
debugoption is now available to the CircleCI orb. - Added support for parsing
.ldignorefiles specified in the root directory of the scanned repository..ldignoremay be used to specify a pattern (compatible with the.gitignorespec: 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. ThedefaultBranchargument on earlier versions ofld-find-code-refswill no longer do anything.
ld-find-code-refswill 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
.ldignorefiles specified in the root directory of the scanned repository..ldignoremay be used to specify a pattern (compatible with the.gitignorespec: 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-featurewe will no longer matchverycool-features.
- This should reduce false positives. E.g. for flag key
- Added support for relative paths to CLI
-dirparameter. - Added a new command line argument,
debug, which enables verbose debug logging. ld-find-code-refswill now exit early if required dependencies are not installed on the system PATH.
- Renamed
parsepackage tocoderefs. TheParse()method in the aformentioned package is nowScan().
ld-find-code-refswill 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
contextLinesis now 2. To disable sending source code to LaunchDarkly, set thecontextLinesargument to-1. - Improved logging to provide more detailed summaries of actions performed by the scanner.
- Fixed a bug in the CircleCI orb config causing
contextLinesto be a string parameter, instead of an integer.
- Removed the
repoHeadparameter.ld-find-code-refsnow 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
cloneEndpointcommand line argument.ld-find-code-refsnow only supports scanning existing repository clones.
- Use case-sensitive
agsearch 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.
updateSequenceIdis now an optional parameter. If not provided, data will always be updated. If provided, data will only be updated if the existingupdateSequenceIdis 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
launchdarklydocker hub namespace instead ofldactions.
pushTimeCLI 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