Commit 69918b1
Switch CI to hardened runners with JFrog OIDC authentication (#753)
## Summary
Route Maven dependency resolution through JFrog Artifactory on hardened
runners that block direct access to Maven Central. Authenticate via
GitHub Actions OIDC (zero stored secrets).
Modeled after the CLI
([#4875](databricks/cli#4875)), Go SDK
([#1609](databricks/databricks-sdk-go#1609)),
and Python SDK
([#1379](databricks/databricks-sdk-py#1379)).
## What changed
- **New composite action**
(`.github/actions/setup-build-environment/action.yml`): Sets up JFrog
CLI via OIDC, installs the JDK, and generates a `~/.m2/settings.xml`
that mirrors all Maven repositories through JFrog (`db-maven`). Skipped
on macOS (not hardened).
- **`push.yml`**: Added workflow-level `id-token: write` permission for
OIDC. Switched `fmt`, `unit-tests` (Linux), and `check-lock` jobs to
`databricks-protected-runner-group`. macOS tests remain on public
runners. Used matrix `include` to map OS strings to runner configs,
preserving the original check names for branch protection compatibility.
- **`Makefile`**: Added `fix-lockfile` target.
- **`lockfile.json`**: Regenerated to pick up `commons-configuration2`
2.13.0 (was out of date since PR #743 bumped the POM without
regenerating the lockfile).
## Why settings.xml is needed
Hardened runners terminate SSL handshakes to `repo.maven.apache.org`.
Unlike Go (`GOPROXY` env var) or Python (`UV_INDEX_URL`), Maven has no
environment variable to redirect repository access. The standard
mechanism is a `~/.m2/settings.xml` with a `<mirror>` entry that routes
all repository requests through JFrog.
## The lockfile problem
Maven's `lockfile.json` stores the full download URL in each
dependency's `resolved` field. When Maven resolves through JFrog, these
become `https://databricks.jfrog.io/artifactory/db-maven/...` instead of
`https://repo.maven.apache.org/maven2/...`. If someone runs `make lock`
while Maven is routed through JFrog (CI, VPN), the lockfile would
contain proxy URLs that shouldn't be committed.
### make fix-lockfile
Replaces JFrog proxy URLs with their public Maven Central equivalents in
all `lockfile.json` files. Prevents proxy URLs from being accidentally
committed.
**When to use it**: Run `make fix-lockfile` before committing if you
regenerated the lockfile while Maven was routing through JFrog.
**CI enforcement**: The `fmt` job runs `make fix-lockfile` followed by
`git diff --exit-code`, so any committed proxy URLs will fail CI.
## Cache ordering
The Maven cache (`~/.m2/repository`) must be restored **before** the
composite action runs. The composite action generates
`~/.m2/settings.xml` with a fresh OIDC token. If the cache step runs
after and restores `~/.m2` (including a stale `settings.xml` from a
previous run), the expired token causes 401 errors. Caching only
`~/.m2/repository` (not all of `~/.m2`) prevents this.
## Out of scope
- **release.yml**: Publishes to Maven Central via Sonatype. Needs
special publish runners per the migration guide. Separate follow-up with
the security team.
- **tagging.yml**: Generated from Universe
(openapi/genkit/sync/workflows/tagging.yml). JFrog setup needs to be
upstreamed to the genkit template.
- **conftest.yml**: Only downloads conftest binary from GitHub Releases
(not Maven). Can stay on ubuntu-latest.
## Test plan
- [x] Verify mvn --errors spotless:check passes (fmt job)
- [x] Verify mvn --errors test passes on Linux (Java 8, 11, 17, 20)
- [x] Verify mvn --errors test passes on macOS (Java 8, 11, 17, 20)
- [x] Verify make check-lock passes (lockfile validation)
- [x] Verify conftest passes on the new workflow files
- [x] Verify check names match branch protection rules
NO_CHANGELOG=true
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>1 parent 4d195ac commit 69918b1
File tree
5 files changed
+192
-58
lines changed- .github
- actions/setup-build-environment
- workflows
- databricks-sdk-java
5 files changed
+192
-58
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
9 | 13 | | |
10 | 14 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
17 | 18 | | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | | - | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
28 | 35 | | |
29 | 36 | | |
30 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
31 | 43 | | |
32 | 44 | | |
33 | 45 | | |
34 | 46 | | |
35 | 47 | | |
36 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
37 | 56 | | |
38 | | - | |
| 57 | + | |
39 | 58 | | |
40 | 59 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | 60 | | |
47 | 61 | | |
48 | 62 | | |
49 | 63 | | |
50 | 64 | | |
51 | 65 | | |
52 | | - | |
| 66 | + | |
53 | 67 | | |
54 | 68 | | |
55 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
56 | 75 | | |
57 | 76 | | |
58 | 77 | | |
59 | 78 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
66 | 82 | | |
| 83 | + | |
67 | 84 | | |
68 | 85 | | |
69 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
70 | 99 | | |
71 | 100 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
12 | 16 | | |
13 | 17 | | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
18 | | - | |
19 | | - | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
25 | 44 | | |
26 | 45 | | |
27 | 46 | | |
28 | 47 | | |
29 | | - | |
30 | 48 | | |
31 | | - | |
32 | | - | |
33 | 49 | | |
34 | 50 | | |
35 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
36 | 85 | | |
37 | 86 | | |
38 | 87 | | |
| |||
71 | 120 | | |
72 | 121 | | |
73 | 122 | | |
74 | | - | |
| 123 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
739 | 739 | | |
740 | | - | |
| 740 | + | |
741 | 741 | | |
742 | | - | |
743 | | - | |
| 742 | + | |
| 743 | + | |
744 | 744 | | |
745 | | - | |
| 745 | + | |
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
749 | 749 | | |
750 | | - | |
| 750 | + | |
751 | 751 | | |
752 | | - | |
| 752 | + | |
753 | 753 | | |
754 | | - | |
755 | | - | |
| 754 | + | |
| 755 | + | |
756 | 756 | | |
757 | | - | |
758 | | - | |
| 757 | + | |
| 758 | + | |
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
762 | 762 | | |
763 | 763 | | |
764 | | - | |
| 764 | + | |
765 | 765 | | |
766 | | - | |
| 766 | + | |
767 | 767 | | |
768 | | - | |
769 | | - | |
| 768 | + | |
| 769 | + | |
770 | 770 | | |
771 | | - | |
772 | | - | |
| 771 | + | |
| 772 | + | |
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
776 | 776 | | |
777 | 777 | | |
778 | | - | |
| 778 | + | |
779 | 779 | | |
780 | | - | |
| 780 | + | |
781 | 781 | | |
782 | | - | |
783 | | - | |
| 782 | + | |
| 783 | + | |
784 | 784 | | |
785 | | - | |
786 | | - | |
| 785 | + | |
| 786 | + | |
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
790 | 790 | | |
791 | | - | |
| 791 | + | |
792 | 792 | | |
793 | | - | |
| 793 | + | |
794 | 794 | | |
795 | | - | |
796 | | - | |
| 795 | + | |
| 796 | + | |
797 | 797 | | |
798 | | - | |
799 | | - | |
| 798 | + | |
| 799 | + | |
800 | 800 | | |
801 | 801 | | |
802 | 802 | | |
| |||
837 | 837 | | |
838 | 838 | | |
839 | 839 | | |
840 | | - | |
| 840 | + | |
841 | 841 | | |
842 | 842 | | |
843 | 843 | | |
| |||
1274 | 1274 | | |
1275 | 1275 | | |
1276 | 1276 | | |
1277 | | - | |
| 1277 | + | |
1278 | 1278 | | |
1279 | 1279 | | |
1280 | 1280 | | |
| |||
0 commit comments