feat: merge upstream improvements#17
Merged
Merged
Conversation
…er alias Ports upstream ld-find-code-refs improvements adapted to this fork: - glob and regex result caching plus go-re2 for alias scanning (upstream launchdarkly#491) - concatenate filepattern contents once per alias instead of once per flag, avoiding OOM on large repos with many flags (upstream launchdarkly#604)
When the subdirectory option is set, the search workspace becomes <root>/<subdirectory> but file paths were trimmed relative to the workspace, so project-level dir filters looked for <subdirectory>/<subdirectory>/... and matched nothing, and reported paths produced broken source links. Resolve paths relative to the repo root instead (ports upstream ld-find-code-refs launchdarkly#516).
…Actions Branch listing (used for pruning stale branches) failed on private repos when running in GitHub Actions because remote operations were unauthenticated. Use the workflow's GITHUB_TOKEN when available (ports upstream ld-find-code-refs launchdarkly#571).
Non-5xx failures (e.g. 413 Request Entity Too Large) were silent: the client only errors on 5xx, so rejected payloads looked like successful sends. Log every response's status, method, and URL at debug level in the central do method (ports upstream ld-find-code-refs launchdarkly#587).
Matches current upstream ld-find-code-refs dependency versions; the go-git bump includes upstream security fixes.
Ubisoft-potato
marked this pull request as ready for review
July 17, 2026 11:35
There was a problem hiding this comment.
Pull request overview
Ports a set of upstream ld-find-code-refs improvements into this Bucketeer-focused fork, primarily targeting large-repo performance (alias scanning), correct path handling when scanning a configured subdirectory, and better operational behavior in GitHub Actions and API debugging.
Changes:
- Optimize alias
filepatternprocessing by caching glob/regex work and concatenating matched file contents once per alias (plus updated tests/testdata). - Fix scanning/path reporting for
subdirectoryruns by resolving reference paths relative to repo root, and extend tests to cover both modes. - Improve operational ergonomics: authenticate remote branch listing in GitHub Actions using
GITHUB_TOKEN, and add debug logging of HTTP response status in the central APIdo()path.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
aliases/alias.go |
Implements alias scanning perf changes (glob/regex caching, filepattern content concatenation). |
aliases/alias_test.go |
Updates/extends alias tests for wildcard/nested matches and direct filepattern alias generation. |
aliases/testdata/wild/nested-wild/another/another/alias_test.txt |
Adds nested wildcard test fixture. |
search/search.go |
Updates SearchForRefs signature to include subdirectory for correct path resolution. |
search/scan.go |
Passes opts.Subdirectory through to SearchForRefs. |
search/files.go |
Resolves file paths relative to repo root (vs workspace) when subdirectory scanning is enabled. |
search/files_test.go |
Extends readFiles tests for subdirectory/non-subdirectory scenarios and adds resolvePath tests. |
search/search_test.go |
Extends SearchForRefs tests to validate subdirectory behavior and path outputs. |
search/testdata/exclude-github-files/subdir/fileWithRefs |
Adds subdir fixture containing references. |
search/testdata/exclude-github-files/subdir/fileWithNoRefs |
Adds subdir fixture with no references. |
internal/git/git.go |
Adds GitHub Actions GITHUB_TOKEN auth for remote branch listing. |
internal/bucketeer/bucketeer.go |
Adds debug logging of API response status/method/URL in do(). |
docs/CONFIGURATION.md |
Documents GitHub Actions token behavior for prune/remote operations. |
go.mod |
Bumps dependencies and promotes go-re2 to a direct dependency. |
go.sum |
Updates module checksums for bumped dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports selected improvements from upstream launchdarkly/ld-find-code-refs, adapted to this fork's Bucketeer client and code structure rather than cherry-picked.
Changes
dirfilters match and source links are correct when thesubdirectoryoption is set.GITHUB_TOKEN, fixing branch pruning on private repos in GitHub Actions. Documented indocs/CONFIGURATION.md.do()method, so non-5xx failures (e.g. 413) are no longer silent.No new command-line options; existing behavior of the redaction feature is unchanged.
Testing
go build ./...,go vet ./..., and the full test suite pass, including ported upstream tests for the alias and subdirectory changes.subdirectoryoption, and filepattern aliases working together in a single scan.