Skip to content

feat: merge upstream improvements#17

Merged
cre8ivejp merged 8 commits into
mainfrom
feat-upstream-improvements
Jul 21, 2026
Merged

feat: merge upstream improvements#17
cre8ivejp merged 8 commits into
mainfrom
feat-upstream-improvements

Conversation

@Ubisoft-potato

@Ubisoft-potato Ubisoft-potato commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

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

  • perf: alias scanning (upstream #491, #604) — Cache glob and regex results, use go-re2 for pattern matching, and concatenate filepattern file contents once per alias instead of once per flag. Previously, large repos with many flags could allocate tens of GB and get OOM-killed.
  • fix: subdirectory file paths (upstream #516) — Resolve reference file paths relative to the repo root instead of the search workspace, so project-level dir filters match and source links are correct when the subdirectory option is set.
  • feat: GitHub Actions git auth (upstream #571) — Authenticate remote branch listing with the workflow's GITHUB_TOKEN, fixing branch pruning on private repos in GitHub Actions. Documented in docs/CONFIGURATION.md.
  • feat: HTTP status debug logging (upstream #587) — Log every API response's status, method, and URL at debug level in the central do() method, so non-5xx failures (e.g. 413) are no longer silent.
  • chore: dependency bumps — doublestar v4.9.1, go-git v5.16.3 (includes security fixes), viper v1.21.0; go-re2 v1.10.0 promoted to a direct dependency.

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.
  • End-to-end dry run of the built binary against a stub API verified secret redaction, the subdirectory option, and filepattern aliases working together in a single scan.

…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 Ubisoft-potato changed the title Feat upstream improvements feat: merge upstream improvements Jul 17, 2026
@Ubisoft-potato
Ubisoft-potato marked this pull request as ready for review July 17, 2026 11:35
@Ubisoft-potato
Ubisoft-potato requested a review from cre8ivejp July 17, 2026 11:36
@cre8ivejp
cre8ivejp requested a review from Copilot July 21, 2026 02:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 filepattern processing by caching glob/regex work and concatenating matched file contents once per alias (plus updated tests/testdata).
  • Fix scanning/path reporting for subdirectory runs 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 API do() 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.

Comment thread aliases/alias.go Outdated
Comment thread search/files.go
Comment thread internal/git/git.go

@cre8ivejp cre8ivejp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cre8ivejp
cre8ivejp merged commit 23f6871 into main Jul 21, 2026
3 checks passed
@cre8ivejp
cre8ivejp deleted the feat-upstream-improvements branch July 21, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants