Skip to content

[Build] Submit the sbt dependency graph so Dependabot covers the server's Java dependencies - #2269

Open
iam-hk wants to merge 1 commit into
unitycatalog:mainfrom
iam-hk:feat/2255-sbt-dependency-graph
Open

iam-hk wants to merge 1 commit into
unitycatalog:mainfrom
iam-hk:feat/2255-sbt-dependency-graph

Conversation

@iam-hk

@iam-hk iam-hk commented Nov 17, 2026

Copy link
Copy Markdown

PR Checklist

  • A description of the changes is added to the description of this PR.
  • If there is a related issue, make sure it is linked to this PR.
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added or modified a feature, documentation in docs is updated

Description of changes

GitHub's dependency graph can't read sbt builds, so the server's Java dependencies (HikariCP, Micrometer, and the rest of build.sbt) never reach Dependabot. Every Dependabot PR so far has been for the UI's npm packages; a published advisory for a server-side library raises no alert in this repository.

Adds .github/workflows/dependency-graph.yml, which submits the sbt dependency graph through GitHub's dependency submission API (scalacenter/sbt-dependency-submission) on every push to main and on manual workflow_dispatch. actions/checkout and actions/setup-java reuse the exact pins from the java-fmt job in lint-check.yml; sbt/setup-sbt and sbt-dependency-submission are pinned by commit hash with a version comment, same as the rest of the repo's workflows. Permissions are scoped to contents: write, the minimum the submission API needs.

Closes #2255

There is no sbt-level test for this, per the issue. I'm verifying it on my fork now that it exists (enabling Dependency graph in the fork's settings and dispatching the workflow), and will link the passing run here as soon as it finishes.

…er's Java dependencies

GitHub's dependency graph can't read sbt builds, so the server's Java
dependencies (HikariCP, Micrometer, and the rest of build.sbt) never
reach Dependabot. Every alert so far has been for the UI's npm
packages; a published advisory for a server-side library raises
nothing here.

Adds .github/workflows/dependency-graph.yml, which submits the sbt
dependency graph through GitHub's dependency submission API on every
push to main and on manual dispatch. Every third-party action is
pinned by commit hash, matching the existing workflows, and the job
keeps to the minimum contents: write permission the submission API
needs.

Closes unitycatalog#2255

Signed-off-by: Harsh <[email protected]>
@iam-hk

iam-hk commented Nov 17, 2026

Copy link
Copy Markdown
Author

Quick update on the "verifying on my fork" note above: I'm not going to be able to do that live fork dispatch after all, so skipping it. As the issue says, there's no sbt-level test for this — the real proof is that CI runs this workflow for real on push to main once it's merged, and the dependency graph then lists the Maven packages. Happy to dig into anything that doesn't look right in the file itself.

@yili-db

yili-db commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

/review

@yili-db yili-db left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[AI Assisted] Pins, permissions, triggers, and plugin coverage check out. The repo has no dependabot.yml, so nothing duplicates. Verdict: comment. Follow-ups: the resolver mirror (inline), on-resolve-failure, and test-scope intent. The checkout hardening is minor.

PR description (not anchorable): say alerts rather than automatic PRs, and mark the test and docs checklist items N/A, since neither applies to this change.

contents: write
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[AI Assisted] Consider persist-credentials: false on this checkout. The submission step does not use git authentication, so this setting only limits what the checkout leaves in the repository config. The action also sets GITHUB_TOKEN for the sbt process, so project and plugin code still runs with the job's access. Treat this as hardening rather than a full fix.

uses: sbt/setup-sbt@67d461eba2c4753196c230e02da850757ba4775e # v1.5.14

- name: Submit dependency graph
uses: scalacenter/sbt-dependency-submission@d84eef4c09e633bcf5f113bcad7fd5e9af1baee9 # v3.2.3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[AI Assisted] The action runs the sbt on PATH rather than build/sbt, so the repository's mirror configuration (build/sbt-config/repositories, the GCS Maven Central mirror used to avoid HTTP 429 on CI runners) is not applied to this job. Could you confirm that the first run on push to main resolves dependencies reliably?

uses: sbt/setup-sbt@67d461eba2c4753196c230e02da850757ba4775e # v1.5.14

- name: Submit dependency graph
uses: scalacenter/sbt-dependency-submission@d84eef4c09e633bcf5f113bcad7fd5e9af1baee9 # v3.2.3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[AI Assisted] With the default on-resolve-failure: error, one module that fails to resolve fails the whole job and no graph is submitted. Is that intended, or should it be warning?

uses: sbt/setup-sbt@67d461eba2c4753196c230e02da850757ba4775e # v1.5.14

- name: Submit dependency graph
uses: scalacenter/sbt-dependency-submission@d84eef4c09e633bcf5f113bcad7fd5e9af1baee9 # v3.2.3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[AI Assisted] Test-scope dependencies are submitted because configs-ignore is not set. Is that intended? If so, a line in the PR description would help reviewers.

workflow_dispatch:

jobs:
submit:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[AI Assisted] Consider a concurrency group with cancel-in-progress: true, cache: 'sbt' on setup-java, and a timeout-minutes on the job.

workflow_dispatch:

jobs:
submit:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[AI Assisted] Forks that sync main will run this job. A fork without Dependency Graph enabled gets a 404 from the submission API, per the action README. Consider if: github.repository == 'unitycatalog/unitycatalog'. I could not verify the fork Actions default for push triggers.

This branch has not been deployed

No deployments
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.

[CI] Submit the sbt dependency graph so Dependabot alerts cover the server's Java dependencies

2 participants