Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 28 additions & 45 deletions pkgs/modules/databricks-cli/default.nix
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
{ pkgs, lib, ... }:

let
version = "0.286.0";
# Replit fork of databricks/cli, based on upstream v0.299.0 plus the
# `sync: add --concurrency and --retry-timeout flags` patch (#1) that
# pid2's deploy path needs.
#
# See https://github.com/replit/databricks-cli/releases for tags. To bump:
# rebase replit/databricks-cli `main` onto a newer upstream tag, retag
# vX.Y.Z-replit.<n>, push, then update version + hash + vendorHash here.
version = "0.299.0-replit.1";
databricks-cli = pkgs.buildGoModule {
pname = "databricks-cli";
inherit version;

src = pkgs.fetchFromGitHub {
owner = "databricks";
repo = "cli";
owner = "replit";
repo = "databricks-cli";
rev = "v${version}";
hash = "sha256-iCmxHjIYznqed6BMQKtuYHJNFPy+3XrNzSXfhtyzPJk=";
hash = "sha256-mrsxKw9pIgP14SBQH4+OAGpBPfKINtVACXMR7qEhfLY=";
};

vendorHash = "sha256-TNUI2VQVKnxTiKQg9Bj3qDK2w3oOjO0rdrtTlFIhTzA=";
vendorHash = "sha256-IcKEzXfmReVCUzMyPC3Y2BRXWwGoB8Gdd3y5p6FtxI0=";

excludedPackages = [
"bundle/internal"
Expand All @@ -36,49 +43,21 @@ let
mv "$GOPATH/bin/cli" "$GOPATH/bin/databricks"
'';

checkFlags =
"-skip="
+ (lib.concatStringsSep "|" [
# Need network
"TestConsistentDatabricksSdkVersion"
"TestTerraformArchiveChecksums"
"TestExpandPipelineGlobPaths"
"TestRelativePathTranslationDefault"
"TestRelativePathTranslationOverride"
"TestWorkspaceVerifyProfileForHost"
"TestWorkspaceVerifyProfileForHost/default_config_file_with_match"
"TestWorkspaceResolveProfileFromHost"
"TestWorkspaceResolveProfileFromHost/no_config_file"
"TestBundleConfigureDefault"
# Use uv venv which doesn't work with nix
# https://github.com/astral-sh/uv/issues/4450
"TestVenvSuccess"
"TestPatchWheel"
# Fails in nix sandbox due to missing home/cache directory
"TestCacheDirEnvVar"
]);

nativeCheckInputs = [
pkgs.gitMinimal
(pkgs.python3.withPackages (
ps: with ps; [
setuptools
wheel
]
))
];

preCheck = ''
# Some tests depend on git and remote url
git init
git remote add origin https://github.com/databricks/cli.git
'';
# Tests are skipped in the nix sandbox. The Databricks CLI test suite
# has a long tail of tests that try to resolve workspace clients, hit
# the network, or otherwise depend on a working environment that the
# nix sandbox does not provide. Each upstream bump tends to add new
# offenders; rather than maintain an ever-growing -skip= regex (and
# debug new entries on every rebase), we trust upstream's CI and skip
# the whole checkPhase. Same pattern as `pkgs/modules/python/uv` and
# the docker stack.
doCheck = false;

meta = {
description = "Databricks CLI";
description = "Databricks CLI (Replit fork)";
mainProgram = "databricks";
homepage = "https://github.com/databricks/cli";
changelog = "https://github.com/databricks/cli/releases/tag/v${version}";
homepage = "https://github.com/replit/databricks-cli";
changelog = "https://github.com/replit/databricks-cli/releases/tag/v${version}";
license = lib.licenses.databricks;
};
};
Expand All @@ -91,6 +70,10 @@ in
Databricks. It provides commands to manage Databricks resources
such as workspaces, jobs, clusters, libraries, and Databricks
apps from the command line.

This is the Replit fork (https://github.com/replit/databricks-cli),
based on upstream v0.299.0 with the --concurrency and --retry-timeout
flags added to `databricks sync` for faster, more reliable deploys.
'';
displayVersion = version;

Expand Down
Loading