Rteco alpine tests#3590
Merged
Merged
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Replace explicit docker run step with GitHub Actions container: key. The entire job now runs inside golang:alpine so `apk` is natively on PATH. Artifactory is started as a service container alongside the job and is reachable at http://artifactory:8081 — no docker commands needed in any step. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
These changes must land before the e2e test cases so the workflow
can compile and run cleanly (even with 0 tests) as soon as this PR
merges:
- utils/tests/consts.go: Alpine repo config filenames, repo key
vars (AlpineLocalRepo/RemoteRepo/VirtualRepo), ApkBuildName.
- utils/tests/utils.go: TestApk flag declaration, repo maps for
GetNonVirtualRepositories/GetVirtualRepositories, template var
substitutions, and AddTimestampToGlobalVars entries.
- main_test.go: wire TestApk into InitBuildToolsTests() and
CleanBuildToolsTests() so Alpine repos are created/deleted
alongside other suites.
- testdata/alpine_{local,remote,virtual}_repository_config.json:
JSON templates used by createRequiredRepos() to provision the
Alpine repos in Artifactory.
Co-authored-by: Cursor <cursoragent@cursor.com>
kanishkguptagit
suggested changes
Jul 7, 2026
| UvBuildName = "cli-uv-build" | ||
| AgentPluginsBuildName = "cli-agent-plugins-build" | ||
| NixBuildName = "cli-nix-build" | ||
| ApkBuildName = "cli-apk-build" |
There was a problem hiding this comment.
nit: can we rename it to alpineBuildName, so as to be consistent and be more readable
| TestPoetry *bool | ||
| TestUv *bool | ||
| TestNix *bool | ||
| TestApk *bool |
| TestPoetry = flag.Bool("test.poetry", false, "Test Poetry") | ||
| TestUv = flag.Bool("test.uv", false, "Test UV") | ||
| TestNix = flag.Bool("test.nix", false, "Test Nix") | ||
| TestApk = flag.Bool("test.apk", false, "Test Alpine APK") |
There was a problem hiding this comment.
| TestPoetry: {&PoetryLocalRepo, &PoetryRemoteRepo}, | ||
| TestUv: {&UvLocalRepo, &UvRemoteRepo}, | ||
| TestNix: {&NixLocalRepo, &NixRemoteRepo}, | ||
| TestApk: {&AlpineLocalRepo, &AlpineRemoteRepo}, |
There was a problem hiding this comment.
Comment on lines
+60
to
+78
| - name: Run Alpine APK tests | ||
| # golang:alpine provides the native `apk` binary. | ||
| # --network host lets the container reach the Artifactory instance on localhost:8081. | ||
| # The Go module and build caches are mounted so the image reuses what | ||
| # install-go-with-cache already downloaded — no duplicate downloads. | ||
| run: | | ||
| docker run --rm \ | ||
| --network host \ | ||
| --user root \ | ||
| -v "${{ github.workspace }}:/workspace" \ | ||
| -v "${{ env.GOPATH }}/pkg/mod:/root/go/pkg/mod" \ | ||
| -v "${{ env.GOCACHE }}:/root/.cache/go-build" \ | ||
| -w /workspace \ | ||
| -e CGO_ENABLED=0 \ | ||
| -e GOPATH=/root/go \ | ||
| -e GOCACHE=/root/.cache/go-build \ | ||
| golang:alpine \ | ||
| go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.apk \ | ||
| ${{ env.JFROG_TESTS_IS_EXTERNAL == 'true' && format('--jfrog.url={0} --jfrog.adminToken={1}', env.JFROG_TESTS_URL, env.JFROG_TESTS_LOCAL_ACCESS_TOKEN) || '' }} |
There was a problem hiding this comment.
instead of manually setting this container, please try to use
alpine-job:
runs-on: ubuntu-latest # The host VM
container:
image: alpine:latest # The environment where your steps execute
steps:
- name: Verify OS
run: cat /etc/alpine-release
- name: Install Packages
run: apk add --no-cache curl
or
alpine-job:
runs-on: ubuntu-latest
steps:
- name: Setup Alpine
uses: jirutka/setup-alpine@v1
- name: Run Alpine command
shell: alpine.sh {0}
run: |
apk add git
cat /etc/alpine-release```
Collaborator
Author
There was a problem hiding this comment.
Addressed it.
Comment on lines
+77
to
+78
| go test -v github.com/jfrog/jfrog-cli --timeout 0 --test.apk \ | ||
| ${{ env.JFROG_TESTS_IS_EXTERNAL == 'true' && format('--jfrog.url={0} --jfrog.adminToken={1}', env.JFROG_TESTS_URL, env.JFROG_TESTS_LOCAL_ACCESS_TOKEN) || '' }} |
There was a problem hiding this comment.
also how the url and token input used here?
Collaborator
Author
There was a problem hiding this comment.
addressed it.
naveenku-jfrog
added a commit
that referenced
this pull request
Jul 7, 2026
- Rename TestApk → TestAlpine and ApkBuildName → AlpineBuildName for consistency with AlpineLocalRepo/RemoteRepo/VirtualRepo naming. CLI flag changes from -test.apk to -test.alpine accordingly. - Add jfrog_user / jfrog_password inputs to apkTests.yml so callers can supply credentials alongside jfrog_url / jfrog_admin_token. - Replace explicit docker run step with jirutka/setup-alpine@v1 so the apk binary is available via a native Alpine chroot on the Ubuntu runner without needing to manage Docker flags manually. Co-authored-by: Cursor <cursoragent@cursor.com>
naveenku-jfrog
added a commit
that referenced
this pull request
Jul 7, 2026
Address PR #3590 review: rename test flag and build-name constant to use 'Alpine' prefix for consistency with AlpineLocalRepo/RemoteRepo/VirtualRepo. Also update skip message to reference '-test.alpine=true'. Co-authored-by: Cursor <cursoragent@cursor.com>
- Rename TestApk → TestAlpine and ApkBuildName → AlpineBuildName for consistency with AlpineLocalRepo/RemoteRepo/VirtualRepo naming. CLI flag changes from -test.apk to -test.alpine accordingly. - Add jfrog_user / jfrog_password inputs to apkTests.yml so callers can supply credentials alongside jfrog_url / jfrog_admin_token. - Replace explicit docker run step with jirutka/setup-alpine@v1 so the apk binary is available via a native Alpine chroot on the Ubuntu runner without needing to manage Docker flags manually. Co-authored-by: Cursor <cursoragent@cursor.com>
40b9c8f to
8c2f486
Compare
fluxxBot
requested changes
Jul 7, 2026
fluxxBot
requested changes
Jul 7, 2026
- Rename apk → alpine job in build-gate.yml (job key and needs list) to be consistent with AlpineLocalRepo/RemoteRepo naming. - Skip install-local-artifactory when external jfrog_url is supplied; there is no need to start a local Docker container in that case. The go test line now uses inputs.jfrog_url/jfrog_admin_token directly instead of relying on env vars set by the action. - Add a matrix of Alpine versions (v3.18, v3.19, v3.20, v3.21) so the test suite runs against multiple supported Alpine releases, not just the latest. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
fluxxBot
approved these changes
Jul 8, 2026
| ${{ inputs.jfrog_user != '' && format('--jfrog.user={0}', inputs.jfrog_user) || '' }} \ | ||
| ${{ inputs.jfrog_password != '' && format('--jfrog.password={0}', inputs.jfrog_password) || '' }} | ||
| env: | ||
| CGO_ENABLED: "0" |
Contributor
There was a problem hiding this comment.
question: why do we need this? CGO specifically here? can we remove if not required
Collaborator
Author
There was a problem hiding this comment.
we do it in follow PR.
naveenku-jfrog
added a commit
that referenced
this pull request
Jul 8, 2026
* RTECO-945 - Add CI workflow to run Alpine APK tests
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.

masterbranch.go vet ./....go fmt ./....Add CI workflow for Alpine APK tests
Context
The Alpine APK integration (RTECO-945) is being implemented across three repositories. The jfrog-cli PR for that work includes 29 new e2e test cases covering all jf apk subcommands. This PR wires those tests into the CI gate so they run automatically on every PR before merge.
What this PR adds
.github/workflows/apkTests.yml — a new reusable workflow for the Alpine APK test suite.
The suite follows the same structure as every other test workflow in this repo (nixTests.yml, agentPluginsTests.yml, etc.):
Uses install-local-artifactory for Artifactory setup (supports both local and external platforms via jfrog_url / jfrog_admin_token inputs)
Supports workflow_call so the build gate can fan it out, and workflow_dispatch for manual runs
The one difference from other suites: the go test step runs inside a golang:alpine container. This is necessary because apk is Alpine Linux's package manager and is not natively available on standard GitHub runners (Ubuntu/macOS/Windows). The Go module and build caches from install-go-with-cache are mounted into the container so there are no duplicate downloads.
.github/workflows/build-gate.yml — wires the new apk suite into the single approval gate:
Added apk job that calls apkTests.yml behind the gate job
Added apk to the build-gate-success needs: list so the suite is a required status check before merge