@databricks-solutions/lakebase-scm-utils 0.3.10 → 0.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{pr-e-E4aP4j.d.cts → pr-D-eayWyJ.d.cts} +59 -1
- package/dist/{pr-e-E4aP4j.d.ts → pr-D-eayWyJ.d.ts} +59 -1
- package/dist/scripts/git/index.cjs +30 -14
- package/dist/scripts/git/index.d.cts +32 -1
- package/dist/scripts/git/index.d.ts +32 -1
- package/dist/scripts/git/index.js +28 -14
- package/dist/scripts/github/index.d.cts +2 -60
- package/dist/scripts/github/index.d.ts +2 -60
- package/dist/scripts/index.cjs +268 -76
- package/dist/scripts/index.d.cts +4 -4
- package/dist/scripts/index.d.ts +4 -4
- package/dist/scripts/index.js +261 -76
- package/dist/scripts/lakebase/ci-resolve-branch.cli.cjs +2 -2
- package/dist/scripts/lakebase/ci-resolve-branch.cli.js +2 -2
- package/dist/scripts/lakebase/collapse-heads.cli.cjs +2 -2
- package/dist/scripts/lakebase/collapse-heads.cli.js +2 -2
- package/dist/scripts/lakebase/detect-language.cli.cjs +2 -2
- package/dist/scripts/lakebase/detect-language.cli.js +2 -2
- package/dist/scripts/lakebase/doctor.cli.cjs +2 -2
- package/dist/scripts/lakebase/doctor.cli.js +2 -2
- package/dist/scripts/lakebase/get-connection.cli.cjs +2 -2
- package/dist/scripts/lakebase/get-connection.cli.js +2 -2
- package/dist/scripts/lakebase/index.cjs +280 -77
- package/dist/scripts/lakebase/index.d.cts +97 -2
- package/dist/scripts/lakebase/index.d.ts +97 -2
- package/dist/scripts/lakebase/index.js +275 -77
- package/dist/scripts/lakebase/infra-runner.cli.cjs +2 -2
- package/dist/scripts/lakebase/infra-runner.cli.js +2 -2
- package/dist/scripts/lakebase/new-migration.cli.cjs +2 -2
- package/dist/scripts/lakebase/new-migration.cli.js +2 -2
- package/dist/scripts/lakebase/schema-diff.cli.cjs +2 -2
- package/dist/scripts/lakebase/schema-diff.cli.js +2 -2
- package/dist/scripts/lakebase/schema-migrate.cli.cjs +2 -2
- package/dist/scripts/lakebase/schema-migrate.cli.js +2 -2
- package/dist/scripts/lakebase/scm-claim-feature.cli.cjs +2 -2
- package/dist/scripts/lakebase/scm-claim-feature.cli.js +2 -2
- package/dist/scripts/lakebase/scm-doctor.cli.cjs +2 -2
- package/dist/scripts/lakebase/scm-doctor.cli.js +2 -2
- package/dist/scripts/lakebase/scm-merge.cli.cjs +2 -2
- package/dist/scripts/lakebase/scm-merge.cli.js +2 -2
- package/dist/scripts/lakebase/scm-reconcile-tier.cli.cjs +2 -2
- package/dist/scripts/lakebase/scm-reconcile-tier.cli.js +2 -2
- package/dist/scripts/util/index.cjs +2 -2
- package/dist/scripts/util/index.js +2 -2
- package/package.json +1 -1
- package/scripts/git/commit-push.ts +60 -14
- package/scripts/lakebase/create-preflight.ts +213 -1
- package/scripts/lakebase/create-project.ts +98 -30
- package/scripts/lakebase/scaffold.ts +50 -0
package/dist/scripts/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export { C as CreatePullRequestArgs, F as FastForwardBranchArgs, G as GitHubPullRequestError, M as MergePairedPullRequestArgs,
|
|
3
|
-
export { AbandonFeatureArgs, AbandonFeatureResult, AddE2eToRunTestsScriptArgs, AddE2eToRunTestsScriptResult, AddInfraToPackageJsonArgs, AddInfraToPackageJsonResult, AddInfraToRunTestsScriptArgs, AddInfraToRunTestsScriptResult, AddPlaywrightToPackageJsonArgs, AddPlaywrightToPackageJsonResult, AddPythonE2eDepsArgs, AddPythonE2eDepsResult, AdoptLakebaseProjectArgs, AdoptLakebaseProjectResult, AdoptStateArgs, AdoptStateResult, AppServicePrincipal, AppliedSchemaMigration, ApplySchemaMigrationsArgs, ApplySchemaMigrationsResult, BranchLookupOpts, BranchMetadata, CONVENTION_TIER_DEFAULTS, CatalogExistsArgs, CheckoutMode, CheckoutPairedArgs, CheckoutPairedResult, ClaimFeatureBranchArgs, ClaimFeatureBranchResult, ClaimedOrphan, ClientFramework, CommandDriftReport, CommandFileEntry, CommandFileStatus, ConnectionArgs, ConsortSetupHooks, CreateBranchArgs, CreateConventionBranchArgs, CreateConventionPairedBranchArgs, CreateLongRunningBranchArgs, CreateLongRunningBranchResult, CreatePairedBranchArgs, CreatePairedBranchResult, CreateProjectArgs, CreateProjectResult, CutBackupArgs, CutBackupResult, DEFAULT_PROTECTED_TIER_NAMES, DOTNET_EFCORE_DEFAULTS, DOTNET_FLYWAY_DIR, DatabricksProfile, DeleteAppEndpointArgs, DeleteAppEndpointResult, DeleteBranchArgs, DeletePairedBranchArgs, DeletePairedBranchResult, DeployClaudeCommandsOptions, DeployClaudeCommandsResult, DeployEnvExampleArgs, DeployLanguageProjectArgs, DeploySpringStarterArgs, DeployTarget, DeployTargetsConfig, DetectCommandDriftArgs, DetectScaffoldedDriftArgs, DetectWorkflowDriftArgs, DoctorArgs, DoctorFinding, DoctorReport, DoctorSeverity, DotnetMigrationTool, DsnArgs, DsnResult, EF_DESIGN_PACKAGE, EfCoreProject, EnableE2eForProjectArgs, EnableE2eForProjectResult, EnableInfraForProjectArgs, EnableInfraForProjectResult, EndpointInfo, EnsureAppEndpointArgs, EnsureAppEndpointResult, EnsureEndpointArgs, EnsureLakebaseSecretAuthArgs, EnsureLakebaseSecretAuthResult, EnsureProfilePinnedArgs, EnsureProfilePinnedResult, EnsureSchemaAndVolumeArgs, EnsureSchemaAndVolumeResult, FIXABLE_FINDING_IDS, FixFindingArgs, FixFindingResult, FixableFindingId, GateInvariant, GateStatus, GenerateAppYamlOptions, GenerateMavenProjectOptions, GetAppEndpointArgs, GetAppEndpointResult, GetAppServicePrincipalArgs, GetCiAppEndpointArgs, GetCiAppEndpointResult, GetConnectionArgs, GetCredentialArgs, GetEndpointArgs, GetSchemaDiffArgs, GrantLakebasePermissionArgs, GrantLakebasePermissionResult, GrantUcCatalogPermissionArgs, GrantUcCatalogPermissionResult, HealthDoctorReport, HookVerification, InfraCheckResult, InfraSuiteResult, InitWorkflowStateArgs, InitializrMetadata, InitializrNetworkError, InitializrParseError, InstallPlaywrightArgs, InstallPlaywrightOptions, InstallPlaywrightResult, LakebaseBranchError, LakebaseBranchInfo, LakebaseBranchTtlTooLongError, LakebasePermissionLevel, LakebaseProjectArgs, LakebaseProjectError, LakebaseProjectInfo, LakebaseProjectMetadata, ListSchemaMigrationsArgs, MAVEN_FLYWAY_DIR, MIGRATION_DEFAULTS, MergeArgs, MergePairedArgs, MergePairedResult, MergeResult, MigrationDefaults, MigrationLanguage, MigrationLayout, ModifiedSchemaObject, NODE_E2E_TEMPLATE_FILES, OrphanCandidate, PLAYWRIGHT_TEMPLATE_FILES, PLAYWRIGHT_TEST_VERSION_RANGE, PYTEST_BDD_VERSION_RANGE, PYTEST_PLAYWRIGHT_VERSION_RANGE, PYTHON_E2E_TEMPLATE_FILES, PendingSchemaMigration, PoolArgs, PreflightResult, PreparePrArgs, PreparePrResult, ProgressCallback, ProjectLanguage, PropagateCredentialsArgs, PropagateCredentialsResult, ProtectedBranchCommitError, QueryBranchSchemaArgs, RecoverOrphansArgs, RecoverOrphansResult, ReleaseArgs, ReleaseResult, RemoveRunnerArgs, ResolveDatabricksHostArgs, ResolveMigrationLayoutArgs, RollbackDeployArgs, RollbackDeployResult, RollbackOptions, RollbackSchemaMigrationArgs, RollbackSchemaMigrationResult, RunDoctorDeps, RunInfraSuiteArgs, RunPlaywrightInstallArgs, RunPlaywrightInstallResult, RunnerInfo, RunnerReportFn, RunnerType, SCM_STATES, STATE_FILE_REL, ScaffoldAllArgs, ScaffoldOptions, ScaffoldReportFn, ScaffoldStaticAllArgs, ScaffoldStaticAllResult, ScaffoldedDriftReport, SchemaColumn, SchemaDiffResult, SchemaMigrationError, SchemaMigrationFile, SchemaMigrationLanguage, SchemaMigrationStatusArgs, SchemaMigrationStatusResult, SchemaMigrationToolName, SchemaObject, SchemaQueryRow, ScmAbandonError, ScmAdoptError, ScmClaimError, ScmDoctorFixError, ScmMergeError, ScmPreparePrError, ScmRecoverError, ScmReleaseError, ScmState, ScmWaitCiError, ScmWorkflowState, SetupRunnerArgs, SftddSetupHooks, SpringInitializrClient, SpringJvmLanguage, StaleBranchFinding, SyncEnvArgs, SyncEnvResult, TableSchema, TierTopology, TryCreateCatalogArgs, TryCreateCatalogResult, UcCatalogPermission, UpdateEnvConnectionArgs, UpdateWorkflowsArgs, UpdateWorkflowsResult, UploadDirectoryArgs, UploadDirectoryResult, ValidateAppOptions, ValidateAppResult, ValidationError, ValidationResult, WaitCiArgs, WaitCiResult, WaitForBranchAuthReadyArgs, WaitForBranchReadyArgs, WorkflowDriftReport, WorkflowFileStatus, WorkflowFileUpdate, WorkflowStatus, WorkflowUpdateOutcome, WorkflowVerification, WriteEnvFileArgs, WritePlaywrightTemplatesArgs, WritePlaywrightTemplatesResult, _testMakeBrownfieldFixture, abandonFeatureBranch, addE2eToRunTestsScript, addInfraToPackageJson, addInfraToRunTestsScript, addPlaywrightToPackageJson, adoptLakebaseProject, adoptScmState, applySchemaMigrations, assertAdoptionPreflight, assertCleanForFork, assertCommitTargetNotProtected, assertCreatedProjectReady, buildPostgresUrl, buildSchemaQuery, cacheProjectRetention, catalogExists, catalogExplorerUrl, checkDatabricksAuth, checkGitHubWorkflowScope, checkoutPaired, claimFeatureBranch, clearRetentionCache, compileMigrationPattern, connectionApplicationName, createBranch, createFeaturePairedBranch, createLakebaseProject, createLongRunningBranch, createPairedBranch, createPerfPairedBranch, createProject, createTestPairedBranch, createUatPairedBranch, cutBackup, databricksAuthPrereqMessage, defaultRefreshPromoteWorkflows, deleteAppEndpoint, deleteBranch, deleteLakebaseProject, deletePairedBranch, deleteProjectArgs, deployClaudeAgents, deployClaudeCommands, deployClaudeSettings, deployClaudeSkills, deployClientProject, deployDeployTargets, deployEnv, deployEnvExample, deployGitignore, deployLanguageProject, deployScripts, deploySpringStarter, deployVscodeSettings, deployWorkflows, deriveCiAppName, describeGates, detectCommandDrift, detectLanguage, detectLanguageAt, detectScaffoldedDrift, detectWorkflowDrift, dirIsEmpty, enableE2eForProject, enableInfraForProject, endpointPath, ensureAppEndpoint, ensureCachedArchive, ensureEndpoint, ensureLakebaseSecretAuth, ensureProfilePinned, ensurePythonBddDeps, ensurePythonE2eDeps, ensureSchemaAndVolume, extractPullNumber, featureBranchName, findCsprojFiles, findDefaultBranchName, findEfCoreProject, findHistoryRetentionDuration, fixFinding, flywayMigrationsDir, formatJUnit, formatSchemaDiffAsMarkdown, generateAppYaml, getAppEndpoint, getAppServicePrincipal, getBranchByName, getCachedProjectRetention, getCiAppEndpoint, getConnection, getCredential, getDefaultBranch, getDefaultBranchId, getDefaultBranchName, getEndpoint, getProjectInfo, getProjectRetentionDuration, getRunnerInfo, getSchemaDiff, getTargetNames, githubWorkflowScopePrereqMessage, grantLakebasePermission, grantUcCatalogPermission, hasDotnetMarker, inferTierTopology, initWorkflowState, installHooks, installPlaywright, isAllSchemas, isDotnetFlywayProject, isDotnetProject, isForeignFeatureClaim, isGitTracked, isLongRunningTierBranch, isLtsJavaVersion, isPrereleaseBootVersion, isRunning, isTier, isTtlTooLongError, kitWarmWarning, listAppDeployments, listBranches, listSchemaMigrations, mergeFeature, mergePaired, minLakebaseTtl, mintCredential, normalizeHost, normalizeTierName, parseHostFromAuthDescribe, parseLakebaseTtl, parseTargetsYaml, patchWorkflowsForRunnerType, preparePr, projectPath, propagateCredentials, protectedTierNamesFromEnv, pushFailureHint, queryBranchSchema, queryBranchTables, readEnvVar, readTargets, readWorkflowState, reconcilePromoteRunState, reconcileTierToOrigin, recoverOrphans, release, removeRunner, resolveBranchId, resolveBranchPath, resolveCurrentUser, resolveDatabricksHost, resolveEndpointHost, resolveFeatureStartPoint, resolveJavaHome, resolveLatestBootVersion, resolveLatestLtsJavaVersion, resolveMigrationLanguage, resolveMigrationLayout, resolveParentBranch, resolveProfileForHost, resolveProfileForHostSync, resolveProtectedTierNames, rollbackDeploy, rollbackSchemaMigration, runDoctor, runHealthDoctor, runInfraSuite, runPlaywrightInstall, runnerDir, runnerName, sanitizeFeatureSlug, scaffoldAll, scaffoldStaticAll, schemaMigrationStatus, schemaObjectName, selectProfileForHost, setupRunner, stateFilePath, stopRunner, substituteScmUtilsVersion, substrateVersion, syncEnvToCurrentBranch, tierBranchNames, toolForLanguage, tryCreateCatalog, updateEnvConnection, updateWorkflows, uploadDirectory, validateApp, validateCreateInputs, validateWorkflowState, verifyHooks, verifyProject, verifyWorkflows, waitForBranchAuthReady, waitForBranchReady, waitForCi, warmAndVerifyKit, withLakebaseRollback, workflowStateFileExists, writeEnvFile, writePlaywrightTemplates, writeTargets, writeWorkflowState } from './lakebase/index.js';
|
|
4
|
-
export { AddRemoteArgs, AheadBehind, AmendArgs, BranchesAtCommitArgs, CheckoutBranchArgs, CloneRepoArgs, CommitAllArgs, CommitAndPushArgs, CommitArgs, CommitFilesArgs, CreateTagArgs, CreateWorktreeArgs, CwdOnlyArgs, DeleteLocalBranchArgs, DeleteRemoteBranchArgs, DeleteRemoteTagArgs, DeleteTagArgs, DiffFilesArgs, DiscardAllChangesArgs, FetchArgs, FileChangeShort, GetFileAtRefArgs, GetMergeBaseArgs, GitBranchInfo, HasRemoteBranchArgs, IsDirtyArgs, ListLocalBranchesArgs, ListMigrationsOnBranchArgs, ListRemoteBranchesArgs, LogRawArgs, MergeBranchArgs, MergeCommit, NearestParent, OutgoingIncomingArgs, ProtectedBranchError, PublishBranchArgs, PullFromArgs, PushCurrentBranchForPrArgs, PushToArgs, RebaseBranchArgs, RecentMergesArgs, RemoveRemoteArgs, RemoveWorktreeArgs, RenameBranchArgs, ResolveNearestParentArgs, ShaArgs, StashIndexArgs, StashWithMessageArgs, UndoLastCommitArgs, WorkflowScopeError, abortRebase, addRemote, checkoutBranch, checkoutDetached, cherryPick, cloneRepo, commit, commitAll, commitAllIfChanged, commitAllSignedOff, commitAmend, commitAndPush, commitSignedOff, createTag, createWorktree, deleteLocalBranch, deleteRemoteBranch, deleteRemoteTag, deleteTag, discardAllChanges, fetch, getAheadBehind, getBranchesAtCommit, getCommitFiles, getCurrentBranch, getDiffFiles, getFileAtRef, getGitHubUrl, getIncomingCommits, getLogRaw, getLogShortstat, getMergeBase, getNearestParentName, getOutgoingCommits, getOwnerRepo, getRecentMerges, getRepoRoot, gitBranchExists, gitInit, hasRemoteBranch, hasUpstream, isDirty, isRebasing, listLocalBranches, listMigrationsOnBranch, listRemoteBranches, listRemotes, listTags, listWorktrees, mergeBranch, publishBranch, pull, pullFrom, pullRebase, push, pushCurrentBranchForPr, pushTo, rebaseBranch, removeRemote, removeWorktree, renameBranch, resolveDefaultBranch, resolveNearestParent, revert, stash, stashApply, stashDrop, stashDropAll, stashIncludeUntracked, stashList, stashPop, stashStaged, sync, undoLastCommit } from './git/index.js';
|
|
1
|
+
export { GITHUB_SCOPES, GitHubAuthDiagnosis, GitHubAuthSource, GitHubRunnerError, GitHubSecretsError, RepoRunner, VsCodeSessionOptions, createRegistrationToken, deleteRunner, diagnoseGitHubAuth, getRunnerIdByName, getRunnerStatus, listRepoRunners, listSecretNames, resolveGitHubToken, setRepoSecret, setRepoSecrets, tryGhAuthToken, tryVsCodeSession } from './github/index.js';
|
|
2
|
+
export { C as CreatePullRequestArgs, a as CreateRepoOptions, F as FastForwardBranchArgs, G as GitHubPullRequestError, b as GitHubRepoError, c as GitHubScopeStatus, M as MergePairedPullRequestArgs, d as MergePairedPullRequestResult, e as MergePullRequestArgs, f as MergePullRequestResult, P as PullRequestCheck, g as PullRequestFile, h as PullRequestInfo, i as PullRequestReview, W as WorkflowRunSummary, j as checkGitHubScopes, k as createPullRequest, l as createRepo, m as deleteRepo, n as fastForwardBranch, o as getActionsEnabled, p as getCurrentUser, q as getPullRequest, r as getPullRequestComments, s as getPullRequestFiles, t as getPullRequestReviews, u as getRepoFullName, v as listIssueComments, w as listWorkflowRuns, x as mergePairedPullRequest, y as mergePullRequest, z as repoExists } from '../pr-D-eayWyJ.js';
|
|
3
|
+
export { AbandonFeatureArgs, AbandonFeatureResult, AddE2eToRunTestsScriptArgs, AddE2eToRunTestsScriptResult, AddInfraToPackageJsonArgs, AddInfraToPackageJsonResult, AddInfraToRunTestsScriptArgs, AddInfraToRunTestsScriptResult, AddPlaywrightToPackageJsonArgs, AddPlaywrightToPackageJsonResult, AddPythonE2eDepsArgs, AddPythonE2eDepsResult, AdoptLakebaseProjectArgs, AdoptLakebaseProjectResult, AdoptStateArgs, AdoptStateResult, AppServicePrincipal, AppliedSchemaMigration, ApplySchemaMigrationsArgs, ApplySchemaMigrationsResult, BranchLookupOpts, BranchMetadata, CONVENTION_TIER_DEFAULTS, CatalogExistsArgs, CheckoutMode, CheckoutPairedArgs, CheckoutPairedResult, ClaimFeatureBranchArgs, ClaimFeatureBranchResult, ClaimedOrphan, ClientFramework, CommandDriftReport, CommandFileEntry, CommandFileStatus, ConnectionArgs, ConsortSetupHooks, CreateBranchArgs, CreateConventionBranchArgs, CreateConventionPairedBranchArgs, CreateLongRunningBranchArgs, CreateLongRunningBranchResult, CreatePairedBranchArgs, CreatePairedBranchResult, CreateProjectArgs, CreateProjectResult, CreateRollbackOptions, CutBackupArgs, CutBackupResult, DEFAULT_PROTECTED_TIER_NAMES, DOTNET_EFCORE_DEFAULTS, DOTNET_FLYWAY_DIR, DatabricksProfile, DeleteAppEndpointArgs, DeleteAppEndpointResult, DeleteBranchArgs, DeletePairedBranchArgs, DeletePairedBranchResult, DeployClaudeCommandsOptions, DeployClaudeCommandsResult, DeployEnvExampleArgs, DeployLanguageProjectArgs, DeploySpringStarterArgs, DeployTarget, DeployTargetsConfig, DetectCommandDriftArgs, DetectScaffoldedDriftArgs, DetectWorkflowDriftArgs, DoctorArgs, DoctorFinding, DoctorReport, DoctorSeverity, DotnetMigrationTool, DsnArgs, DsnResult, EF_DESIGN_PACKAGE, EfCoreProject, EnableE2eForProjectArgs, EnableE2eForProjectResult, EnableInfraForProjectArgs, EnableInfraForProjectResult, EndpointInfo, EnsureAppEndpointArgs, EnsureAppEndpointResult, EnsureEndpointArgs, EnsureLakebaseSecretAuthArgs, EnsureLakebaseSecretAuthResult, EnsureProfilePinnedArgs, EnsureProfilePinnedResult, EnsureSchemaAndVolumeArgs, EnsureSchemaAndVolumeResult, FIXABLE_FINDING_IDS, FixFindingArgs, FixFindingResult, FixableFindingId, GateInvariant, GateStatus, GenerateAppYamlOptions, GenerateMavenProjectOptions, GetAppEndpointArgs, GetAppEndpointResult, GetAppServicePrincipalArgs, GetCiAppEndpointArgs, GetCiAppEndpointResult, GetConnectionArgs, GetCredentialArgs, GetEndpointArgs, GetSchemaDiffArgs, GitHubPreflightInput, GitHubPreflightResult, GrantLakebasePermissionArgs, GrantLakebasePermissionResult, GrantUcCatalogPermissionArgs, GrantUcCatalogPermissionResult, HealthDoctorReport, HookVerification, InfraCheckResult, InfraSuiteResult, InitWorkflowStateArgs, InitializrMetadata, InitializrNetworkError, InitializrParseError, InstallPlaywrightArgs, InstallPlaywrightOptions, InstallPlaywrightResult, LakebaseBranchError, LakebaseBranchInfo, LakebaseBranchTtlTooLongError, LakebasePermissionLevel, LakebaseProjectArgs, LakebaseProjectError, LakebaseProjectInfo, LakebaseProjectMetadata, ListSchemaMigrationsArgs, MAVEN_FLYWAY_DIR, MIGRATION_DEFAULTS, MergeArgs, MergePairedArgs, MergePairedResult, MergeResult, MigrationDefaults, MigrationLanguage, MigrationLayout, ModifiedSchemaObject, NODE_E2E_TEMPLATE_FILES, OrphanCandidate, PLAYWRIGHT_TEMPLATE_FILES, PLAYWRIGHT_TEST_VERSION_RANGE, PYTEST_BDD_VERSION_RANGE, PYTEST_PLAYWRIGHT_VERSION_RANGE, PYTHON_E2E_TEMPLATE_FILES, PendingSchemaMigration, PoolArgs, PreflightResult, PreparePrArgs, PreparePrResult, ProgressCallback, ProjectLanguage, PropagateCredentialsArgs, PropagateCredentialsResult, ProtectedBranchCommitError, QueryBranchSchemaArgs, RecoverOrphansArgs, RecoverOrphansResult, ReleaseArgs, ReleaseResult, RemoveRunnerArgs, ResolveDatabricksHostArgs, ResolveMigrationLayoutArgs, RollbackDeployArgs, RollbackDeployResult, RollbackLedger, RollbackOptions, RollbackSchemaMigrationArgs, RollbackSchemaMigrationResult, RollbackStep, RunDoctorDeps, RunInfraSuiteArgs, RunPlaywrightInstallArgs, RunPlaywrightInstallResult, RunnerInfo, RunnerReportFn, RunnerType, SCM_STATES, STATE_FILE_REL, ScaffoldAllArgs, ScaffoldOptions, ScaffoldReportFn, ScaffoldStaticAllArgs, ScaffoldStaticAllResult, ScaffoldedDriftReport, SchemaColumn, SchemaDiffResult, SchemaMigrationError, SchemaMigrationFile, SchemaMigrationLanguage, SchemaMigrationStatusArgs, SchemaMigrationStatusResult, SchemaMigrationToolName, SchemaObject, SchemaQueryRow, ScmAbandonError, ScmAdoptError, ScmClaimError, ScmDoctorFixError, ScmMergeError, ScmPreparePrError, ScmRecoverError, ScmReleaseError, ScmState, ScmWaitCiError, ScmWorkflowState, SetupRunnerArgs, SftddSetupHooks, SpringInitializrClient, SpringJvmLanguage, StaleBranchFinding, SyncEnvArgs, SyncEnvResult, TEST_CAPTURE_ROOT_FILES, TableSchema, TierTopology, TryCreateCatalogArgs, TryCreateCatalogResult, UcCatalogPermission, UpdateEnvConnectionArgs, UpdateWorkflowsArgs, UpdateWorkflowsResult, UploadDirectoryArgs, UploadDirectoryResult, ValidateAppOptions, ValidateAppResult, ValidationError, ValidationResult, WaitCiArgs, WaitCiResult, WaitForBranchAuthReadyArgs, WaitForBranchReadyArgs, WorkflowDriftReport, WorkflowFileStatus, WorkflowFileUpdate, WorkflowStatus, WorkflowUpdateOutcome, WorkflowVerification, WriteEnvFileArgs, WritePlaywrightTemplatesArgs, WritePlaywrightTemplatesResult, _testMakeBrownfieldFixture, abandonFeatureBranch, addE2eToRunTestsScript, addInfraToPackageJson, addInfraToRunTestsScript, addPlaywrightToPackageJson, adoptLakebaseProject, adoptScmState, applySchemaMigrations, assertAdoptionPreflight, assertCleanForFork, assertCommitTargetNotProtected, assertCreatedProjectReady, buildPostgresUrl, buildSchemaQuery, cacheProjectRetention, catalogExists, catalogExplorerUrl, checkDatabricksAuth, checkGitHubPreflight, checkGitHubWorkflowScope, checkoutPaired, claimFeatureBranch, clearRetentionCache, compileMigrationPattern, connectionApplicationName, createBranch, createFeaturePairedBranch, createLakebaseProject, createLongRunningBranch, createPairedBranch, createPerfPairedBranch, createProject, createRollbackLedger, createTestPairedBranch, createUatPairedBranch, cutBackup, databricksAuthPrereqMessage, defaultRefreshPromoteWorkflows, deleteAppEndpoint, deleteBranch, deleteLakebaseProject, deletePairedBranch, deleteProjectArgs, deployClaudeAgents, deployClaudeCommands, deployClaudeSettings, deployClaudeSkills, deployClientProject, deployDeployTargets, deployEnv, deployEnvExample, deployGitignore, deployLanguageProject, deployScripts, deploySpringStarter, deployTestCaptureRoot, deployVscodeSettings, deployWorkflows, deriveCiAppName, describeGates, detectCommandDrift, detectLanguage, detectLanguageAt, detectScaffoldedDrift, detectWorkflowDrift, dirIsEmpty, enableE2eForProject, enableInfraForProject, endpointPath, ensureAppEndpoint, ensureCachedArchive, ensureEndpoint, ensureLakebaseSecretAuth, ensureProfilePinned, ensurePythonBddDeps, ensurePythonE2eDeps, ensureSchemaAndVolume, extractPullNumber, featureBranchName, findCsprojFiles, findDefaultBranchName, findEfCoreProject, findHistoryRetentionDuration, fixFinding, flywayMigrationsDir, formatJUnit, formatSchemaDiffAsMarkdown, generateAppYaml, getAppEndpoint, getAppServicePrincipal, getBranchByName, getCachedProjectRetention, getCiAppEndpoint, getConnection, getCredential, getDefaultBranch, getDefaultBranchId, getDefaultBranchName, getEndpoint, getProjectInfo, getProjectRetentionDuration, getRunnerInfo, getSchemaDiff, getTargetNames, githubWorkflowScopePrereqMessage, grantLakebasePermission, grantUcCatalogPermission, hasDotnetMarker, inferTierTopology, initWorkflowState, installHooks, installPlaywright, isAllSchemas, isDotnetFlywayProject, isDotnetProject, isForeignFeatureClaim, isGitTracked, isLongRunningTierBranch, isLtsJavaVersion, isPrereleaseBootVersion, isRunning, isTier, isTtlTooLongError, kitWarmWarning, listAppDeployments, listBranches, listSchemaMigrations, mergeFeature, mergePaired, minLakebaseTtl, mintCredential, normalizeHost, normalizeTierName, parseHostFromAuthDescribe, parseLakebaseTtl, parseTargetsYaml, patchWorkflowsForRunnerType, preparePr, projectPath, propagateCredentials, protectedTierNamesFromEnv, pushFailureHint, queryBranchSchema, queryBranchTables, readEnvVar, readTargets, readWorkflowState, reconcilePromoteRunState, reconcileTierToOrigin, recoverOrphans, release, removeRunner, resolveBranchId, resolveBranchPath, resolveCurrentUser, resolveDatabricksHost, resolveEndpointHost, resolveFeatureStartPoint, resolveJavaHome, resolveLatestBootVersion, resolveLatestLtsJavaVersion, resolveMigrationLanguage, resolveMigrationLayout, resolveParentBranch, resolveProfileForHost, resolveProfileForHostSync, resolveProtectedTierNames, rollbackDeploy, rollbackSchemaMigration, runDoctor, runHealthDoctor, runInfraSuite, runPlaywrightInstall, runnerDir, runnerName, sanitizeFeatureSlug, scaffoldAll, scaffoldStaticAll, schemaMigrationStatus, schemaObjectName, selectProfileForHost, setupRunner, stateFilePath, stopRunner, substituteScmUtilsVersion, substrateVersion, syncEnvToCurrentBranch, tierBranchNames, toolForLanguage, tryCreateCatalog, updateEnvConnection, updateWorkflows, uploadDirectory, validateApp, validateCreateInputs, validateWorkflowState, verifyHooks, verifyProject, verifyWorkflows, waitForBranchAuthReady, waitForBranchReady, waitForCi, warmAndVerifyKit, withCreateRollback, withLakebaseRollback, workflowStateFileExists, writeEnvFile, writePlaywrightTemplates, writeTargets, writeWorkflowState } from './lakebase/index.js';
|
|
4
|
+
export { AddRemoteArgs, AheadBehind, AmendArgs, BranchesAtCommitArgs, CheckoutBranchArgs, CloneRepoArgs, CommitAllArgs, CommitAndPushArgs, CommitArgs, CommitFilesArgs, CreateTagArgs, CreateWorktreeArgs, CwdOnlyArgs, DeleteLocalBranchArgs, DeleteRemoteBranchArgs, DeleteRemoteTagArgs, DeleteTagArgs, DiffFilesArgs, DiscardAllChangesArgs, FetchArgs, FileChangeShort, GetFileAtRefArgs, GetMergeBaseArgs, GitBranchInfo, HasRemoteBranchArgs, IsDirtyArgs, ListLocalBranchesArgs, ListMigrationsOnBranchArgs, ListRemoteBranchesArgs, LogRawArgs, MergeBranchArgs, MergeCommit, NearestParent, OutgoingIncomingArgs, ProtectedBranchError, PublishBranchArgs, PullFromArgs, PushCurrentBranchForPrArgs, PushInitialArgs, PushToArgs, RebaseBranchArgs, RecentMergesArgs, RemoveRemoteArgs, RemoveWorktreeArgs, RenameBranchArgs, ResolveNearestParentArgs, ShaArgs, StashIndexArgs, StashWithMessageArgs, UndoLastCommitArgs, WorkflowScopeError, abortRebase, addRemote, checkoutBranch, checkoutDetached, cherryPick, cloneRepo, commit, commitAll, commitAllIfChanged, commitAllSignedOff, commitAmend, commitAndPush, commitInitial, commitSignedOff, createTag, createWorktree, deleteLocalBranch, deleteRemoteBranch, deleteRemoteTag, deleteTag, discardAllChanges, fetch, getAheadBehind, getBranchesAtCommit, getCommitFiles, getCurrentBranch, getDiffFiles, getFileAtRef, getGitHubUrl, getIncomingCommits, getLogRaw, getLogShortstat, getMergeBase, getNearestParentName, getOutgoingCommits, getOwnerRepo, getRecentMerges, getRepoRoot, gitBranchExists, gitInit, hasRemoteBranch, hasUpstream, isDirty, isRebasing, listLocalBranches, listMigrationsOnBranch, listRemoteBranches, listRemotes, listTags, listWorktrees, mergeBranch, publishBranch, pull, pullFrom, pullRebase, push, pushCurrentBranchForPr, pushInitial, pushTo, rebaseBranch, removeRemote, removeWorktree, renameBranch, resolveDefaultBranch, resolveNearestParent, revert, stash, stashApply, stashDrop, stashDropAll, stashIncludeUntracked, stashList, stashPop, stashStaged, sync, undoLastCommit } from './git/index.js';
|
|
5
5
|
export { CopyDirSubstitutedArgs, LAKEBASE_BRANCH_NAME_MAX, OwnerRepo, PROXY_ENV_KEYS, PollProbeDone, PollProbePending, PollProbeResult, PollUntilArgs, PollUntilDoneResult, PollUntilResult, PollUntilTimeoutResult, copyDirSubstituted, delay, extractZipToDir, formatOwnerRepo, isCliEntry, parseOwnerRepo, patchPomForLakebase, pollUntil, pollUntilDefined, proxyEnvSubset, sanitizeArtifactId, sanitizeBranchName, withProxyEnv } from './util/index.js';
|
|
6
6
|
export { C as CwdOnly, E as ExecOptions, e as exec, s as shq } from '../exec-CwxSWhlz.js';
|
|
7
7
|
export { C as CI_TOKEN_LIFETIME_SECONDS, a as CI_TOKEN_REMINT_MARGIN_SECONDS, b as CiFreshnessResult, c as CiTokenExpiryArgs, E as EnsureCiSecretsFreshArgs, R as REQUIRED_CI_SECRETS, S as SyncCiSecretsArgs, d as ciTokenComment, e as ciTokenExpiry, f as ensureCiSecretsFresh, g as ensureCiSecretsFreshFromEnv, m as missingCiSecrets, s as syncCiSecrets } from '../ci-secrets-CnGrdQV-.js';
|
package/dist/scripts/index.js
CHANGED
|
@@ -9770,8 +9770,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
9770
9770
|
var cached;
|
|
9771
9771
|
function substrateSelfVersion() {
|
|
9772
9772
|
if (cached !== void 0) return cached;
|
|
9773
|
-
if ("0.3.
|
|
9774
|
-
cached = "0.3.
|
|
9773
|
+
if ("0.3.12".length > 0) {
|
|
9774
|
+
cached = "0.3.12";
|
|
9775
9775
|
return cached;
|
|
9776
9776
|
}
|
|
9777
9777
|
cached = "unknown";
|
|
@@ -11478,6 +11478,70 @@ async function checkGitHubWorkflowScope(probe = () => checkGitHubScopes(["workfl
|
|
|
11478
11478
|
return { ok: true };
|
|
11479
11479
|
}
|
|
11480
11480
|
}
|
|
11481
|
+
async function checkGitHubPreflight(input) {
|
|
11482
|
+
const warnings = [];
|
|
11483
|
+
const hard = input.hardScopes ?? ["repo", "workflow"];
|
|
11484
|
+
const advisory = input.advisoryScopes ?? ["delete_repo"];
|
|
11485
|
+
const currentUserProbe = input.currentUser ?? getCurrentUser;
|
|
11486
|
+
const scopesProbe = input.scopes ?? ((req) => checkGitHubScopes(req));
|
|
11487
|
+
const repoExistsProbe = input.repoExists ?? repoExists;
|
|
11488
|
+
let activeUser;
|
|
11489
|
+
try {
|
|
11490
|
+
activeUser = await currentUserProbe();
|
|
11491
|
+
} catch (err) {
|
|
11492
|
+
return {
|
|
11493
|
+
ok: false,
|
|
11494
|
+
warnings,
|
|
11495
|
+
reason: `GitHub authentication failed: ${err instanceof Error ? err.message : String(err)}. Sign in with \`gh auth login\`, or set GITHUB_TOKEN to a valid token, then re-run.`
|
|
11496
|
+
};
|
|
11497
|
+
}
|
|
11498
|
+
if (activeUser.toLowerCase() !== input.owner.toLowerCase()) {
|
|
11499
|
+
warnings.push(
|
|
11500
|
+
`Signed in to GitHub as "${activeUser}" but creating under "${input.owner}" (an org or another account); ensure "${activeUser}" can create repositories there.`
|
|
11501
|
+
);
|
|
11502
|
+
}
|
|
11503
|
+
try {
|
|
11504
|
+
const { granted, missing } = await scopesProbe([...hard, ...advisory]);
|
|
11505
|
+
if (granted !== null) {
|
|
11506
|
+
const missingHard = missing.filter((s) => hard.includes(s));
|
|
11507
|
+
const missingAdvisory = missing.filter((s) => advisory.includes(s));
|
|
11508
|
+
if (missingHard.length > 0) {
|
|
11509
|
+
return {
|
|
11510
|
+
ok: false,
|
|
11511
|
+
warnings,
|
|
11512
|
+
activeUser,
|
|
11513
|
+
reason: `GitHub token missing required scope(s): ${missingHard.join(", ")} (grants [${granted.join(", ") || "none"}]). Fix: gh auth refresh -h github.com -s ${[...hard].join(",")}`
|
|
11514
|
+
};
|
|
11515
|
+
}
|
|
11516
|
+
if (missingAdvisory.length > 0) {
|
|
11517
|
+
warnings.push(
|
|
11518
|
+
`GitHub token missing the ${missingAdvisory.join(", ")} scope \u2014 automatic rollback of the repo on a failed create is unavailable (you would delete it by hand). Grant it with: gh auth refresh -h github.com -s delete_repo`
|
|
11519
|
+
);
|
|
11520
|
+
}
|
|
11521
|
+
} else {
|
|
11522
|
+
warnings.push(
|
|
11523
|
+
"GitHub token scopes are not visible (fine-grained PAT or App token); cannot pre-verify repo/workflow access , the create will surface any gap when it pushes."
|
|
11524
|
+
);
|
|
11525
|
+
}
|
|
11526
|
+
} catch {
|
|
11527
|
+
warnings.push("Could not read GitHub token scopes (probe error); skipping the scope pre-check.");
|
|
11528
|
+
}
|
|
11529
|
+
try {
|
|
11530
|
+
if (await repoExistsProbe(`${input.owner}/${input.repoName}`)) {
|
|
11531
|
+
return {
|
|
11532
|
+
ok: false,
|
|
11533
|
+
warnings,
|
|
11534
|
+
activeUser,
|
|
11535
|
+
reason: `GitHub repo "${input.owner}/${input.repoName}" already exists. Pick a different project name, or delete the existing repo first.`
|
|
11536
|
+
};
|
|
11537
|
+
}
|
|
11538
|
+
} catch {
|
|
11539
|
+
warnings.push(
|
|
11540
|
+
`Could not check whether "${input.owner}/${input.repoName}" already exists (probe error); the create will fail clearly if it does.`
|
|
11541
|
+
);
|
|
11542
|
+
}
|
|
11543
|
+
return { ok: true, warnings, activeUser };
|
|
11544
|
+
}
|
|
11481
11545
|
function githubWorkflowScopePrereqMessage(reason) {
|
|
11482
11546
|
return "The GitHub token lacks the `workflow` OAuth scope, required to push the project's `.github/workflows/*` CI files. (Without this check, scaffolding runs all the way to the final push, is rejected, and rolls back.) Grant the scope, then re-run:\n - gh CLI: gh auth refresh -h github.com -s workflow\n - VS Code: re-sign in to GitHub and approve the workflow scope\n - token: set GITHUB_TOKEN to a PAT that includes the `workflow` scope" + (reason ? `
|
|
11483
11547
|
(${reason})` : "");
|
|
@@ -11543,6 +11607,53 @@ async function withLakebaseRollback(opts, fn) {
|
|
|
11543
11607
|
throw wrapped;
|
|
11544
11608
|
}
|
|
11545
11609
|
}
|
|
11610
|
+
function createRollbackLedger() {
|
|
11611
|
+
const steps = [];
|
|
11612
|
+
return {
|
|
11613
|
+
register: (label, undo) => {
|
|
11614
|
+
steps.push({ label, undo });
|
|
11615
|
+
},
|
|
11616
|
+
steps: () => steps
|
|
11617
|
+
};
|
|
11618
|
+
}
|
|
11619
|
+
async function withCreateRollback(ledger, opts, fn) {
|
|
11620
|
+
try {
|
|
11621
|
+
return await fn();
|
|
11622
|
+
} catch (err) {
|
|
11623
|
+
const report = opts.report ?? (() => {
|
|
11624
|
+
});
|
|
11625
|
+
const steps = [...ledger.steps()].reverse();
|
|
11626
|
+
const rolledBack = [];
|
|
11627
|
+
const failed = [];
|
|
11628
|
+
if (steps.length > 0) report(`Create failed; rolling back ${steps.length} created resource(s)...`);
|
|
11629
|
+
for (const s of steps) {
|
|
11630
|
+
try {
|
|
11631
|
+
report(` rolling back: ${s.label}`);
|
|
11632
|
+
await s.undo();
|
|
11633
|
+
rolledBack.push(s.label);
|
|
11634
|
+
} catch (e) {
|
|
11635
|
+
const m = e instanceof Error ? e.message : String(e);
|
|
11636
|
+
if (/not.?found/i.test(m)) {
|
|
11637
|
+
rolledBack.push(s.label);
|
|
11638
|
+
continue;
|
|
11639
|
+
}
|
|
11640
|
+
failed.push(`${s.label} (${m})`);
|
|
11641
|
+
}
|
|
11642
|
+
}
|
|
11643
|
+
const base = err instanceof Error ? err.message : String(err);
|
|
11644
|
+
const parts = [];
|
|
11645
|
+
if (rolledBack.length) parts.push(`rolled back: ${rolledBack.join(", ")}`);
|
|
11646
|
+
if (failed.length) {
|
|
11647
|
+
parts.push(
|
|
11648
|
+
`COULD NOT roll back: ${failed.join("; ")} , clean these up by hand before retrying the same name`
|
|
11649
|
+
);
|
|
11650
|
+
}
|
|
11651
|
+
const suffix = parts.length ? ` (${parts.join("; ")})` : "";
|
|
11652
|
+
const wrapped = err instanceof Error ? err : new Error(base);
|
|
11653
|
+
wrapped.message = `${base}${suffix}`;
|
|
11654
|
+
throw wrapped;
|
|
11655
|
+
}
|
|
11656
|
+
}
|
|
11546
11657
|
|
|
11547
11658
|
// scripts/lakebase/create-project.ts
|
|
11548
11659
|
init_esm_shims();
|
|
@@ -11611,26 +11722,38 @@ To finish:
|
|
|
11611
11722
|
}
|
|
11612
11723
|
};
|
|
11613
11724
|
async function commitAndPush(args) {
|
|
11614
|
-
await
|
|
11615
|
-
|
|
11616
|
-
|
|
11725
|
+
await commitInitial(args.projectDir, args.message);
|
|
11726
|
+
if (args.push === false) return;
|
|
11727
|
+
await pushInitial({ projectDir: args.projectDir, remote: args.remote, branch: args.branch });
|
|
11728
|
+
}
|
|
11729
|
+
async function commitInitial(projectDir, message) {
|
|
11730
|
+
await exec2("git add -A", { cwd: projectDir });
|
|
11731
|
+
await exec2(`git commit -m ${JSON.stringify(message)}`, {
|
|
11732
|
+
cwd: projectDir,
|
|
11617
11733
|
timeout: 3e4
|
|
11618
11734
|
});
|
|
11619
|
-
|
|
11735
|
+
}
|
|
11736
|
+
async function pushInitial(args) {
|
|
11620
11737
|
const remote = args.remote ?? "origin";
|
|
11621
11738
|
const branch = args.branch ?? "main";
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
|
|
11627
|
-
|
|
11628
|
-
|
|
11629
|
-
|
|
11630
|
-
|
|
11739
|
+
const attempts = Math.max(1, args.attempts ?? 1);
|
|
11740
|
+
const sleep2 = args.sleep ?? ((ms) => new Promise((r) => setTimeout(r, ms)));
|
|
11741
|
+
const run = args.run ?? ((cmd, cwd) => exec2(cmd, { cwd, timeout: 3e4 }).then(() => void 0));
|
|
11742
|
+
let lastErr;
|
|
11743
|
+
for (let i = 1; i <= attempts; i++) {
|
|
11744
|
+
try {
|
|
11745
|
+
await run(`git push -u ${remote} ${branch}`, args.projectDir);
|
|
11746
|
+
return;
|
|
11747
|
+
} catch (err) {
|
|
11748
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
11749
|
+
if (/without `?workflow`? scope|workflow scope/i.test(msg)) {
|
|
11750
|
+
throw new WorkflowScopeError(args.projectDir);
|
|
11751
|
+
}
|
|
11752
|
+
lastErr = err;
|
|
11753
|
+
if (i < attempts) await sleep2(args.delayMs ?? 1500);
|
|
11631
11754
|
}
|
|
11632
|
-
throw err;
|
|
11633
11755
|
}
|
|
11756
|
+
throw lastErr instanceof Error ? lastErr : new Error(String(lastErr));
|
|
11634
11757
|
}
|
|
11635
11758
|
|
|
11636
11759
|
// scripts/lakebase/scaffold.ts
|
|
@@ -12363,6 +12486,20 @@ async function deployVscodeSettings(targetDir, opts) {
|
|
|
12363
12486
|
fs12.mkdirSync(destDir, { recursive: true });
|
|
12364
12487
|
fs12.copyFileSync(src, path11.join(destDir, "settings.json"));
|
|
12365
12488
|
}
|
|
12489
|
+
var TEST_CAPTURE_ROOT_FILES = ["consort-capture.ts", "consort-test-reporter.ts"];
|
|
12490
|
+
function deployTestCaptureRoot(targetDir, opts) {
|
|
12491
|
+
const src = commonDir(opts);
|
|
12492
|
+
const written = [];
|
|
12493
|
+
for (const rel of TEST_CAPTURE_ROOT_FILES) {
|
|
12494
|
+
const from = path11.join(src, rel);
|
|
12495
|
+
if (!fs12.existsSync(from)) {
|
|
12496
|
+
throw new Error(`Kit template missing: ${from}`);
|
|
12497
|
+
}
|
|
12498
|
+
fs12.copyFileSync(from, path11.join(targetDir, rel));
|
|
12499
|
+
written.push(rel);
|
|
12500
|
+
}
|
|
12501
|
+
return written;
|
|
12502
|
+
}
|
|
12366
12503
|
async function deployGitignore(targetDir, language = "java", opts) {
|
|
12367
12504
|
const base = fs12.readFileSync(path11.join(commonDir(opts), ".gitignore.base"), "utf-8");
|
|
12368
12505
|
const extraPath = path11.join(langDir(language, opts), ".gitignore.extra");
|
|
@@ -12497,6 +12634,12 @@ async function scaffoldAll(args) {
|
|
|
12497
12634
|
});
|
|
12498
12635
|
if (client.length > 0) staticResult.client = client;
|
|
12499
12636
|
}
|
|
12637
|
+
if (args.clientFramework === "react" || language === "nodejs") {
|
|
12638
|
+
report("Deploying root test-capture modules");
|
|
12639
|
+
staticResult.testCapture = deployTestCaptureRoot(args.targetDir, {
|
|
12640
|
+
templatesDir: args.templatesDir
|
|
12641
|
+
});
|
|
12642
|
+
}
|
|
12500
12643
|
return staticResult;
|
|
12501
12644
|
}
|
|
12502
12645
|
|
|
@@ -13813,64 +13956,72 @@ async function createProject(input, progress) {
|
|
|
13813
13956
|
throw new Error(databricksAuthPrereqMessage(host, auth7.reason));
|
|
13814
13957
|
}
|
|
13815
13958
|
if (useGithub) {
|
|
13816
|
-
report("Checking GitHub token
|
|
13817
|
-
const
|
|
13818
|
-
|
|
13819
|
-
|
|
13820
|
-
|
|
13821
|
-
|
|
13822
|
-
|
|
13823
|
-
|
|
13824
|
-
|
|
13825
|
-
|
|
13826
|
-
|
|
13827
|
-
}
|
|
13828
|
-
|
|
13829
|
-
|
|
13830
|
-
|
|
13831
|
-
|
|
13832
|
-
|
|
13833
|
-
|
|
13834
|
-
|
|
13835
|
-
|
|
13836
|
-
|
|
13837
|
-
|
|
13838
|
-
probeErr =
|
|
13839
|
-
|
|
13840
|
-
|
|
13841
|
-
|
|
13842
|
-
|
|
13843
|
-
|
|
13844
|
-
|
|
13845
|
-
|
|
13846
|
-
|
|
13847
|
-
|
|
13848
|
-
|
|
13849
|
-
|
|
13959
|
+
report("Checking GitHub account + token requisites...");
|
|
13960
|
+
const gh = await checkGitHubPreflight({ owner: input.githubOwner, repoName: input.projectName });
|
|
13961
|
+
for (const w of gh.warnings) {
|
|
13962
|
+
warnings.push(w);
|
|
13963
|
+
report(`Note: ${w}`);
|
|
13964
|
+
}
|
|
13965
|
+
if (!gh.ok) throw new Error(gh.reason);
|
|
13966
|
+
}
|
|
13967
|
+
const rollback = createRollbackLedger();
|
|
13968
|
+
return await withCreateRollback(
|
|
13969
|
+
rollback,
|
|
13970
|
+
{ report },
|
|
13971
|
+
async () => {
|
|
13972
|
+
if (useGithub) {
|
|
13973
|
+
report("Creating GitHub repository...", fullRepoName);
|
|
13974
|
+
await createRepo(fullRepoName, {
|
|
13975
|
+
private: input.privateRepo !== false,
|
|
13976
|
+
description: `Lakebase project: ${input.projectName}`
|
|
13977
|
+
});
|
|
13978
|
+
rollback.register(`GitHub repo ${fullRepoName}`, () => deleteRepo(fullRepoName));
|
|
13979
|
+
report("Waiting for GitHub repo to be visible...", fullRepoName);
|
|
13980
|
+
const probeDelays = [1e3, 2e3, 3e3, 5e3, 8e3];
|
|
13981
|
+
let probeErr = "";
|
|
13982
|
+
let visible = false;
|
|
13983
|
+
for (const waitMs of probeDelays) {
|
|
13984
|
+
try {
|
|
13985
|
+
await getRepoFullName(fullRepoName);
|
|
13986
|
+
visible = true;
|
|
13987
|
+
break;
|
|
13988
|
+
} catch (err) {
|
|
13989
|
+
probeErr = err instanceof Error ? err.message : String(err);
|
|
13990
|
+
await delay(waitMs);
|
|
13991
|
+
}
|
|
13992
|
+
}
|
|
13993
|
+
if (!visible) {
|
|
13994
|
+
let activeUser = "";
|
|
13995
|
+
try {
|
|
13996
|
+
activeUser = await getCurrentUser();
|
|
13997
|
+
} catch {
|
|
13998
|
+
}
|
|
13999
|
+
const samlHint = /SAML|scope does not match|sso/i.test(probeErr) ? "\n\nThe error mentions SAML \u2013 re-sign in to GitHub and authorize SSO for this org." : "";
|
|
14000
|
+
const userHint = activeUser && activeUser !== input.githubOwner ? `
|
|
13850
14001
|
|
|
13851
14002
|
Note: signed in as "${activeUser}", but the repo was created under "${input.githubOwner}".` : "";
|
|
13852
|
-
|
|
13853
|
-
|
|
14003
|
+
throw new Error(
|
|
14004
|
+
`GitHub repo "${fullRepoName}" was created but isn't visible after ~19s of polling.${samlHint}${userHint}
|
|
13854
14005
|
|
|
13855
14006
|
Last probe error:
|
|
13856
14007
|
${probeErr.split("\n")[0].slice(0, 200)}`
|
|
13857
|
-
|
|
13858
|
-
|
|
13859
|
-
|
|
13860
|
-
|
|
13861
|
-
|
|
13862
|
-
|
|
13863
|
-
|
|
13864
|
-
|
|
13865
|
-
|
|
13866
|
-
|
|
13867
|
-
|
|
13868
|
-
|
|
13869
|
-
|
|
13870
|
-
|
|
13871
|
-
|
|
13872
|
-
|
|
13873
|
-
|
|
14008
|
+
);
|
|
14009
|
+
}
|
|
14010
|
+
report("Cloning repository...", projectDir);
|
|
14011
|
+
await cloneRepo({
|
|
14012
|
+
repoUrl: `https://github.com/${fullRepoName}.git`,
|
|
14013
|
+
parentDir: input.parentDir
|
|
14014
|
+
});
|
|
14015
|
+
rollback.register(`local project dir ${projectDir}`, () => fs19.rmSync(projectDir, { recursive: true, force: true }));
|
|
14016
|
+
} else {
|
|
14017
|
+
report("Creating local project directory...", projectDir);
|
|
14018
|
+
fs19.mkdirSync(projectDir, { recursive: true });
|
|
14019
|
+
await gitInit(projectDir);
|
|
14020
|
+
rollback.register(`local project dir ${projectDir}`, () => fs19.rmSync(projectDir, { recursive: true, force: true }));
|
|
14021
|
+
}
|
|
14022
|
+
report("Creating Lakebase database (provisioning Postgres)...", lakebaseProjectId);
|
|
14023
|
+
await createLakebaseProject({ projectId: lakebaseProjectId, host });
|
|
14024
|
+
rollback.register(`Lakebase project ${lakebaseProjectId}`, () => deleteLakebaseProject({ projectId: lakebaseProjectId, host }));
|
|
13874
14025
|
report("Resolving database endpoint...");
|
|
13875
14026
|
const defaultBranchId = await getDefaultBranchId({
|
|
13876
14027
|
projectId: lakebaseProjectId,
|
|
@@ -13954,6 +14105,10 @@ Last probe error:
|
|
|
13954
14105
|
projectName: input.projectName,
|
|
13955
14106
|
report: (m) => report(m)
|
|
13956
14107
|
});
|
|
14108
|
+
rollback.register(
|
|
14109
|
+
`self-hosted runner ${input.projectName}`,
|
|
14110
|
+
() => removeRunner({ fullRepoName, projectName: input.projectName })
|
|
14111
|
+
);
|
|
13957
14112
|
} catch (err) {
|
|
13958
14113
|
const msg = err instanceof Error ? err.message : String(err);
|
|
13959
14114
|
warnings.push(`Runner setup failed: ${msg}`);
|
|
@@ -14022,6 +14177,16 @@ Last probe error:
|
|
|
14022
14177
|
"The Consort toolkit downloads on first use , run `./scripts/lk --refresh`, or just your first `./scripts/lk` command, and it installs then."
|
|
14023
14178
|
);
|
|
14024
14179
|
}
|
|
14180
|
+
if (enableSftdd && useGithub) {
|
|
14181
|
+
report("Warming the Consort toolkit (so the first push doesn't cold-download mid-hook)...");
|
|
14182
|
+
let warm = warmAndVerifyKit(projectDir);
|
|
14183
|
+
if (!warm.ok) warm = warmAndVerifyKit(projectDir);
|
|
14184
|
+
if (!warm.ok) {
|
|
14185
|
+
const m = kitWarmWarning(projectDir, warm.reason);
|
|
14186
|
+
warnings.push(m);
|
|
14187
|
+
report(`Note: ${m}`);
|
|
14188
|
+
}
|
|
14189
|
+
}
|
|
14025
14190
|
const langLabels = {
|
|
14026
14191
|
java: "Java/Spring Boot",
|
|
14027
14192
|
kotlin: "Kotlin/Spring Boot",
|
|
@@ -14042,12 +14207,25 @@ Last probe error:
|
|
|
14042
14207
|
}
|
|
14043
14208
|
}
|
|
14044
14209
|
report("Creating initial commit...");
|
|
14045
|
-
await
|
|
14046
|
-
|
|
14047
|
-
|
|
14048
|
-
|
|
14049
|
-
|
|
14050
|
-
|
|
14210
|
+
await commitInitial(projectDir, `Initial project scaffold (${langLabel} + Lakebase)`);
|
|
14211
|
+
let pushLanded = !useGithub;
|
|
14212
|
+
if (useGithub) {
|
|
14213
|
+
try {
|
|
14214
|
+
await pushInitial({ projectDir, attempts: 2 });
|
|
14215
|
+
pushLanded = true;
|
|
14216
|
+
} catch (err) {
|
|
14217
|
+
if (err instanceof WorkflowScopeError) throw err;
|
|
14218
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
14219
|
+
const m = `Provisioning is complete, but the initial push did not land after a retry: ${msg}. The project on disk is fine , finish it with: cd ${projectDir} && git push -u origin main`;
|
|
14220
|
+
warnings.push(m);
|
|
14221
|
+
report(`WARNING: ${m}`);
|
|
14222
|
+
}
|
|
14223
|
+
}
|
|
14224
|
+
if ((tiers === 2 || tiers === 3) && !pushLanded) {
|
|
14225
|
+
const m = `INCOMPLETE TIERS: you requested ${tiers} tiers, but the initial push hasn't landed, so the tier branches can't fork off origin yet. After you finish the push (above), cut them with \`./scripts/lk lakebase-cut-tier --name staging --fork-from main\`${tiers === 3 ? " and `--name dev --fork-from staging`" : ""}.`;
|
|
14226
|
+
warnings.push(m);
|
|
14227
|
+
report(`WARNING: ${m}`);
|
|
14228
|
+
} else if (tiers === 2 || tiers === 3) {
|
|
14051
14229
|
report(`Cutting staging tier (tiers=${tiers}) via createLongRunningBranch...`);
|
|
14052
14230
|
try {
|
|
14053
14231
|
await createLongRunningBranch({
|
|
@@ -14098,7 +14276,7 @@ Last probe error:
|
|
|
14098
14276
|
warnings
|
|
14099
14277
|
};
|
|
14100
14278
|
}
|
|
14101
|
-
// end
|
|
14279
|
+
// end withCreateRollback closure
|
|
14102
14280
|
);
|
|
14103
14281
|
}
|
|
14104
14282
|
|
|
@@ -19465,6 +19643,7 @@ export {
|
|
|
19465
19643
|
ScmReleaseError,
|
|
19466
19644
|
ScmWaitCiError,
|
|
19467
19645
|
SpringInitializrClient,
|
|
19646
|
+
TEST_CAPTURE_ROOT_FILES,
|
|
19468
19647
|
WorkflowScopeError,
|
|
19469
19648
|
_testMakeBrownfieldFixture,
|
|
19470
19649
|
abandonFeatureBranch,
|
|
@@ -19487,6 +19666,7 @@ export {
|
|
|
19487
19666
|
catalogExists,
|
|
19488
19667
|
catalogExplorerUrl,
|
|
19489
19668
|
checkDatabricksAuth,
|
|
19669
|
+
checkGitHubPreflight,
|
|
19490
19670
|
checkGitHubScopes,
|
|
19491
19671
|
checkGitHubWorkflowScope,
|
|
19492
19672
|
checkoutBranch,
|
|
@@ -19504,6 +19684,7 @@ export {
|
|
|
19504
19684
|
commitAllSignedOff,
|
|
19505
19685
|
commitAmend,
|
|
19506
19686
|
commitAndPush,
|
|
19687
|
+
commitInitial,
|
|
19507
19688
|
commitSignedOff,
|
|
19508
19689
|
compileMigrationPattern,
|
|
19509
19690
|
connectionApplicationName,
|
|
@@ -19518,6 +19699,7 @@ export {
|
|
|
19518
19699
|
createPullRequest,
|
|
19519
19700
|
createRegistrationToken,
|
|
19520
19701
|
createRepo,
|
|
19702
|
+
createRollbackLedger,
|
|
19521
19703
|
createTag,
|
|
19522
19704
|
createTestPairedBranch,
|
|
19523
19705
|
createUatPairedBranch,
|
|
@@ -19549,6 +19731,7 @@ export {
|
|
|
19549
19731
|
deployLanguageProject,
|
|
19550
19732
|
deployScripts,
|
|
19551
19733
|
deploySpringStarter,
|
|
19734
|
+
deployTestCaptureRoot,
|
|
19552
19735
|
deployVscodeSettings,
|
|
19553
19736
|
deployWorkflows,
|
|
19554
19737
|
deriveCiAppName,
|
|
@@ -19701,6 +19884,7 @@ export {
|
|
|
19701
19884
|
push,
|
|
19702
19885
|
pushCurrentBranchForPr,
|
|
19703
19886
|
pushFailureHint,
|
|
19887
|
+
pushInitial,
|
|
19704
19888
|
pushTo,
|
|
19705
19889
|
queryBranchSchema,
|
|
19706
19890
|
queryBranchTables,
|
|
@@ -19790,6 +19974,7 @@ export {
|
|
|
19790
19974
|
waitForBranchReady,
|
|
19791
19975
|
waitForCi,
|
|
19792
19976
|
warmAndVerifyKit,
|
|
19977
|
+
withCreateRollback,
|
|
19793
19978
|
withLakebaseRollback,
|
|
19794
19979
|
withProxyEnv,
|
|
19795
19980
|
workflowStateFileExists,
|
|
@@ -79662,8 +79662,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
79662
79662
|
var cached;
|
|
79663
79663
|
function substrateSelfVersion() {
|
|
79664
79664
|
if (cached !== void 0) return cached;
|
|
79665
|
-
if ("0.3.
|
|
79666
|
-
cached = "0.3.
|
|
79665
|
+
if ("0.3.12".length > 0) {
|
|
79666
|
+
cached = "0.3.12";
|
|
79667
79667
|
return cached;
|
|
79668
79668
|
}
|
|
79669
79669
|
cached = "unknown";
|
|
@@ -754,8 +754,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
754
754
|
var cached;
|
|
755
755
|
function substrateSelfVersion() {
|
|
756
756
|
if (cached !== void 0) return cached;
|
|
757
|
-
if ("0.3.
|
|
758
|
-
cached = "0.3.
|
|
757
|
+
if ("0.3.12".length > 0) {
|
|
758
|
+
cached = "0.3.12";
|
|
759
759
|
return cached;
|
|
760
760
|
}
|
|
761
761
|
cached = "unknown";
|
|
@@ -79290,8 +79290,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
79290
79290
|
var cached;
|
|
79291
79291
|
function substrateSelfVersion() {
|
|
79292
79292
|
if (cached !== void 0) return cached;
|
|
79293
|
-
if ("0.3.
|
|
79294
|
-
cached = "0.3.
|
|
79293
|
+
if ("0.3.12".length > 0) {
|
|
79294
|
+
cached = "0.3.12";
|
|
79295
79295
|
return cached;
|
|
79296
79296
|
}
|
|
79297
79297
|
cached = "unknown";
|
|
@@ -393,8 +393,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
393
393
|
var cached;
|
|
394
394
|
function substrateSelfVersion() {
|
|
395
395
|
if (cached !== void 0) return cached;
|
|
396
|
-
if ("0.3.
|
|
397
|
-
cached = "0.3.
|
|
396
|
+
if ("0.3.12".length > 0) {
|
|
397
|
+
cached = "0.3.12";
|
|
398
398
|
return cached;
|
|
399
399
|
}
|
|
400
400
|
cached = "unknown";
|
|
@@ -79290,8 +79290,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
79290
79290
|
var cached;
|
|
79291
79291
|
function substrateSelfVersion() {
|
|
79292
79292
|
if (cached !== void 0) return cached;
|
|
79293
|
-
if ("0.3.
|
|
79294
|
-
cached = "0.3.
|
|
79293
|
+
if ("0.3.12".length > 0) {
|
|
79294
|
+
cached = "0.3.12";
|
|
79295
79295
|
return cached;
|
|
79296
79296
|
}
|
|
79297
79297
|
cached = "unknown";
|
|
@@ -393,8 +393,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
393
393
|
var cached;
|
|
394
394
|
function substrateSelfVersion() {
|
|
395
395
|
if (cached !== void 0) return cached;
|
|
396
|
-
if ("0.3.
|
|
397
|
-
cached = "0.3.
|
|
396
|
+
if ("0.3.12".length > 0) {
|
|
397
|
+
cached = "0.3.12";
|
|
398
398
|
return cached;
|
|
399
399
|
}
|
|
400
400
|
cached = "unknown";
|
|
@@ -80800,8 +80800,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
80800
80800
|
var cached;
|
|
80801
80801
|
function substrateSelfVersion() {
|
|
80802
80802
|
if (cached !== void 0) return cached;
|
|
80803
|
-
if ("0.3.
|
|
80804
|
-
cached = "0.3.
|
|
80803
|
+
if ("0.3.12".length > 0) {
|
|
80804
|
+
cached = "0.3.12";
|
|
80805
80805
|
return cached;
|
|
80806
80806
|
}
|
|
80807
80807
|
cached = "unknown";
|
|
@@ -1959,8 +1959,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
1959
1959
|
var cached;
|
|
1960
1960
|
function substrateSelfVersion() {
|
|
1961
1961
|
if (cached !== void 0) return cached;
|
|
1962
|
-
if ("0.3.
|
|
1963
|
-
cached = "0.3.
|
|
1962
|
+
if ("0.3.12".length > 0) {
|
|
1963
|
+
cached = "0.3.12";
|
|
1964
1964
|
return cached;
|
|
1965
1965
|
}
|
|
1966
1966
|
cached = "unknown";
|
|
@@ -79285,8 +79285,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
79285
79285
|
var cached;
|
|
79286
79286
|
function substrateSelfVersion() {
|
|
79287
79287
|
if (cached !== void 0) return cached;
|
|
79288
|
-
if ("0.3.
|
|
79289
|
-
cached = "0.3.
|
|
79288
|
+
if ("0.3.12".length > 0) {
|
|
79289
|
+
cached = "0.3.12";
|
|
79290
79290
|
return cached;
|
|
79291
79291
|
}
|
|
79292
79292
|
cached = "unknown";
|