Skip to content

feat: optional GitHub Action dockerImage entry point - #611

Merged
tknopp-ld merged 4 commits into
mainfrom
feat/docker-image-override
Aug 13, 2026
Merged

feat: optional GitHub Action dockerImage entry point#611
tknopp-ld merged 4 commits into
mainfrom
feat/docker-image-override

Conversation

@tknopp-ld

@tknopp-ld tknopp-ld commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds an opt-in Action entry point at launchdarkly/find-code-references/docker with a dockerImage input so workflows can pull the scanner from a private registry or Docker Hub proxy.
  • Leaves the root Docker container Action (action.yml + Dockerfile) unchanged so existing uses: launchdarkly/find-code-references@v2 workflows keep the current GitHub-managed runtime.
  • Fail-fast checks for GITHUB_WORKSPACE, GITHUB_EVENT_PATH, and docker CLI; release copy script now preserves nested metadata (docker/).

Why not change the root Action

GitHub does not allow dynamic runs.image / ${{ inputs.* }} on using: docker Actions (docs, SO).

Usage (after publish to find-code-references)

- uses: docker/login-action@v3
  with:
    registry: your.registry.example
    username: ${{ secrets.REGISTRY_USER }}
    password: ${{ secrets.REGISTRY_TOKEN }}
- uses: launchdarkly/find-code-references/docker@v2.17.0
  with:
    accessToken: ${{ secrets.LD_ACCESS_TOKEN }}
    projKey: LD_PROJECT_KEY
    dockerImage: your.registry.example/launchdarkly/ld-find-code-refs-github-action:2.16.0

Test plan

Composite + docker run can fail quietly (green CI, wrong/empty data in LD) if mounts or env are wrong. Test on a real GitHub-hosted runner (not only act), against a repo that already has known flag refs in LD.

0. Hygiene

  • git diff main -- build/metadata/github-actions/action.yml Dockerfile is empty (root Action unchanged)
  • Manual dry-run of release copy: cp -a build/metadata/github-actions/. /tmp/fcr-test/ includes docker/action.yml

1. Baseline parity (default Hub image)

Workflow A — /docker with no dockerImage (uses default Hub tag):

- uses: actions/checkout@v4
  with:
    fetch-depth: 11
- uses: ./build/metadata/github-actions/docker   # or published .../docker@branch
  with:
    accessToken: ${{ secrets.LD_ACCESS_TOKEN }}
    projKey: <known project>
    debug: true

Workflow B — same job, root Action (control):

- uses: ./build/metadata/github-actions   # or launchdarkly/find-code-references@v2.16.0
  with:
    accessToken: ${{ secrets.LD_ACCESS_TOKEN }}
    projKey: <known project>
    debug: true

Assert:

  • Both jobs exit 0
  • Logs show the same branch name (not empty / not wrong PR head)
  • Hunk / flag counts are in the same ballpark (debug table or LD UI for that branch)
  • GITHUB_EVENT_PATH / workspace fail-fasts do not fire

Failure modes this catches: missing workspace mount (empty scan), missing event/ref (wrong branch).

2. Explicit Hub URI

  • Set dockerImage: launchdarkly/ld-find-code-refs-github-action:2.16.0 explicitly — same results as §1

3. Mirrored registry

  • Mirror/retag that image into a registry we control (GHCR or internal)
  • docker/login-action then /docker with dockerImage: <mirror URI>
  • Job pulls from the mirror (check logs for registry host) and produces same branch + similar ref counts as §1

Failure modes this catches: login ordering, wrong image tag, private pull auth.

4. Lookback / extinctions (git history in the container)

  • fetch-depth: 11, lookback: 10 (defaults)
  • Logs show extinction lookback running without “unable to generate flag extinctions” / git errors caused by missing .git
  • Prefer a branch where a flag was recently removed so an extinction can appear (or at least the lookback path executes cleanly)

Failure modes this catches: workspace mount without .git, shallow-clone mismatch.

5. Defaults parity vs CLI footguns

  • Omit prune input — confirm behavior matches root Action (prune false), not CLI default true (check logs: should not attempt remote prune on a private repo unless enabled)
  • Omit optional inputs — lookback/contextLines behave like root defaults

6. Negative / fail-loud checks (should be red, not silent)

  • Temporarily break workspace (e.g. skip checkout) — step fails with GITHUB_WORKSPACE error
  • Empty dockerImage: "" — step fails with empty-image error
  • (Optional) Self-hosted without Docker — fails with docker CLI missing

7. Exit codes

  • Invalid accessToken / unreachable API with ignoreServiceErrors: false — non-zero exit (not swallowed by the composite wrapper)
  • ignoreServiceErrors: true — still respects scanner behavior (exit 0 on service errors)

8. Release follow-up

  • Publish docker/ into launchdarkly/find-code-references, tag (e.g. v2.17.0)
  • Re-run §1–§3 against the published uses: launchdarkly/find-code-references/docker@... (not local path)

Made with Cursor

Add launchdarkly/find-code-references/docker composite Action so workflows
can pull the scanner image from a private registry or Docker Hub proxy
without changing the root Docker Action used by existing workflows.

Co-authored-by: Cursor <cursoragent@cursor.com>
@tknopp-ld
tknopp-ld requested review from a team as code owners August 5, 2026 15:02
@tknopp-ld tknopp-ld changed the title [Cursor] feat: optional GitHub Action dockerImage entry point feat: optional GitHub Action dockerImage entry point Aug 5, 2026
Comment thread build/metadata/github-actions/docker/action.yml Outdated
Comment thread build/metadata/github-actions/docker/action.yml Outdated
tknopp-ld and others added 2 commits August 6, 2026 12:44
Co-authored-by: Ember Stevens <79482775+ember-stevens@users.noreply.github.com>
Co-authored-by: Ember Stevens <79482775+ember-stevens@users.noreply.github.com>

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0c5622b. Configure here.

Comment thread scripts/release/targets/gha.sh
Comment thread build/metadata/github-actions/docker/action.yml
git add -A so first-time publish commits docker/; pass HTTP(S)_PROXY/NO_PROXY into docker run when set.

Co-authored-by: Cursor <cursoragent@cursor.com>

@sheldonmartin sheldonmartin 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.

Not really familiar with configuring GitHub actions but this seems reasonable to me. I also have one question about testing.

Comment thread build/metadata/github-actions/docker/action.yml
@tknopp-ld
tknopp-ld merged commit 2693d25 into main Aug 13, 2026
6 checks passed
@tknopp-ld
tknopp-ld deleted the feat/docker-image-override branch August 13, 2026 12:22
@tknopp-ld tknopp-ld mentioned this pull request Aug 13, 2026
4 tasks
tknopp-ld added a commit that referenced this pull request Aug 13, 2026
## Summary

Prepares the 2.17.0 release by hand, same approach as 2.16.0 in #608 and
2.14.0 in #563: rulesets block the release workflow from pushing version
bumps straight to `main`, so the bump lands as a normal PR. Tag, GitHub
release, Docker Hub publish (if not already done by a release workflow
run), and the downstream `find-code-references` Action update are done
manually afterward.

Ships the `/docker` Action entry point from #611 so customers can
override the scanner image registry (e.g. Artifactory / Docker Hub
proxy).

## What changed

| File | Change |
| --- | --- |
| `internal/version/version.go` | `2.16.0` → `2.17.0` |
| `CHANGELOG.md` | `[Unreleased]` → `2.17.0` (2026-08-13) |
| `build/metadata/github-actions/Dockerfile` | image tag → `2.17.0` |
| `build/metadata/github-actions/README.md` |
`find-code-references@v2.17.0` (+ `/docker` example image tag) |
| `build/metadata/github-actions/docker/action.yml` | default
`dockerImage` → `…:2.17.0` |

## Behavior notes

- **Bitbucket and CircleCI metadata deliberately untouched.** Those
publish targets remain disabled (#593); bumping them would name versions
that were never cut.
- **GHA publish is still manual.** After merge: publish Docker images /
GitHub release for `v2.17.0` as usual, then `cp -a
build/metadata/github-actions/.` into
`launchdarkly/find-code-references` (includes new `docker/`), commit,
tag `v2.17.0` (and update `v2` if that is still your practice). Use `git
add -A` so `docker/action.yml` is included on first publish.

## Test plan

- [x] `go build ./...` (version constant only)
- [x] Diff vs main is only the five files above
- [ ] After merge + Hub image exists: sync `find-code-references` and
confirm `docker/action.yml` is present at `v2.17.0`
- [ ] Optional: couscous smoke with published `uses:
launchdarkly/find-code-references/docker@v2.17.0`


Made with [Cursor](https://cursor.com)

Co-authored-by: Cursor <cursoragent@cursor.com>
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.

4 participants