@databricks-solutions/lakebase-scm-utils 0.2.41 → 0.2.43
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/scripts/github/index.cjs +3 -1
- package/dist/scripts/github/index.js +3 -1
- package/dist/scripts/github/pr.cli.cjs +3 -1
- package/dist/scripts/github/pr.cli.js +3 -1
- package/dist/scripts/index.cjs +84 -21
- package/dist/scripts/index.d.cts +1 -1
- package/dist/scripts/index.d.ts +1 -1
- package/dist/scripts/index.js +76 -15
- package/dist/scripts/lakebase/branch.cli.cjs +3 -1
- package/dist/scripts/lakebase/branch.cli.js +3 -1
- package/dist/scripts/lakebase/ci-app-endpoint.cli.cjs +3 -1
- package/dist/scripts/lakebase/ci-app-endpoint.cli.js +3 -1
- package/dist/scripts/lakebase/ci-resolve-branch.cli.cjs +5 -3
- package/dist/scripts/lakebase/ci-resolve-branch.cli.js +5 -3
- package/dist/scripts/lakebase/collapse-heads.cli.cjs +5 -3
- package/dist/scripts/lakebase/collapse-heads.cli.js +5 -3
- package/dist/scripts/lakebase/cut-backup.cli.cjs +3 -1
- package/dist/scripts/lakebase/cut-backup.cli.js +3 -1
- package/dist/scripts/lakebase/cut-tier.cli.cjs +3 -1
- package/dist/scripts/lakebase/cut-tier.cli.js +3 -1
- package/dist/scripts/lakebase/detect-language.cli.cjs +5 -3
- package/dist/scripts/lakebase/detect-language.cli.js +5 -3
- package/dist/scripts/lakebase/doctor.cli.cjs +5 -3
- package/dist/scripts/lakebase/doctor.cli.js +5 -3
- package/dist/scripts/lakebase/get-connection.cli.cjs +5 -3
- package/dist/scripts/lakebase/get-connection.cli.js +5 -3
- package/dist/scripts/lakebase/index.cjs +84 -21
- package/dist/scripts/lakebase/index.d.cts +21 -1
- package/dist/scripts/lakebase/index.d.ts +21 -1
- package/dist/scripts/lakebase/index.js +76 -15
- package/dist/scripts/lakebase/infra-runner.cli.cjs +5 -3
- package/dist/scripts/lakebase/infra-runner.cli.js +5 -3
- package/dist/scripts/lakebase/new-migration.cli.cjs +5 -3
- package/dist/scripts/lakebase/new-migration.cli.js +5 -3
- package/dist/scripts/lakebase/schema-diff.cli.cjs +5 -3
- package/dist/scripts/lakebase/schema-diff.cli.js +5 -3
- package/dist/scripts/lakebase/schema-migrate.cli.cjs +5 -3
- package/dist/scripts/lakebase/schema-migrate.cli.js +5 -3
- package/dist/scripts/lakebase/scm-abandon-feature.cli.cjs +37 -1
- package/dist/scripts/lakebase/scm-abandon-feature.cli.js +37 -1
- package/dist/scripts/lakebase/scm-adopt-state.cli.cjs +37 -1
- package/dist/scripts/lakebase/scm-adopt-state.cli.js +37 -1
- package/dist/scripts/lakebase/scm-claim-feature.cli.cjs +45 -9
- package/dist/scripts/lakebase/scm-claim-feature.cli.js +39 -3
- package/dist/scripts/lakebase/scm-cleanup.cli.cjs +3 -1
- package/dist/scripts/lakebase/scm-cleanup.cli.js +3 -1
- package/dist/scripts/lakebase/scm-doctor.cli.cjs +56 -29
- package/dist/scripts/lakebase/scm-doctor.cli.js +50 -23
- package/dist/scripts/lakebase/scm-feature-branch.cli.cjs +1 -0
- package/dist/scripts/lakebase/scm-feature-branch.cli.js +1 -0
- package/dist/scripts/lakebase/scm-merge.cli.cjs +61 -9
- package/dist/scripts/lakebase/scm-merge.cli.js +55 -3
- package/dist/scripts/lakebase/scm-prepare-pr.cli.cjs +34 -0
- package/dist/scripts/lakebase/scm-prepare-pr.cli.js +34 -0
- package/dist/scripts/lakebase/scm-reconcile-tier.cli.cjs +6 -3
- package/dist/scripts/lakebase/scm-reconcile-tier.cli.js +6 -3
- package/dist/scripts/lakebase/scm-recover-orphans.cli.cjs +37 -1
- package/dist/scripts/lakebase/scm-recover-orphans.cli.js +37 -1
- package/dist/scripts/lakebase/scm-state.cli.cjs +5 -4
- package/dist/scripts/lakebase/scm-state.cli.js +4 -3
- package/dist/scripts/lakebase/scm-wait-ci.cli.cjs +34 -0
- package/dist/scripts/lakebase/scm-wait-ci.cli.js +34 -0
- package/dist/scripts/util/index.cjs +5 -3
- package/dist/scripts/util/index.js +5 -3
- package/package.json +1 -1
- package/scripts/lakebase/databricks-cli.ts +7 -1
- package/scripts/lakebase/enable-e2e.ts +19 -3
- package/scripts/lakebase/scm-doctor.ts +1 -12
- package/scripts/lakebase/scm-merge.ts +36 -0
- package/scripts/lakebase/scm-workflow-state.ts +49 -0
- package/templates/project/common/.github/workflows/merge.yml +17 -6
- package/templates/project/common/.github/workflows/pr.yml +17 -6
- package/templates/project/common/.gitignore.base +8 -0
- package/templates/project/common/scripts/run-tests.sh +18 -1
- package/templates/project/python/tests/__pycache__/conftest.cpython-314.pyc +0 -0
- package/templates/project/python/tests/conftest.py +10 -3
|
@@ -2806,6 +2806,10 @@ declare function findHistoryRetentionDuration(parsed: Record<string, unknown>):
|
|
|
2806
2806
|
*/
|
|
2807
2807
|
declare function getProjectRetentionDuration(args: LakebaseProjectArgs): Promise<string | undefined>;
|
|
2808
2808
|
|
|
2809
|
+
/** True iff `rel` (repo-relative) is git-tracked in projectDir. Best-effort: no
|
|
2810
|
+
* git / not a repo -> false. Shared home (scm-doctor's Finding-28 check reads
|
|
2811
|
+
* the same predicate). */
|
|
2812
|
+
declare function isGitTracked(projectDir: string, rel: string): boolean;
|
|
2809
2813
|
/** All SCM states, in canonical progression order. */
|
|
2810
2814
|
declare const SCM_STATES: readonly ["scaffold-complete", "feature-claimed", "pr-ready", "ci-green", "merged"];
|
|
2811
2815
|
type ScmState = (typeof SCM_STATES)[number];
|
|
@@ -3161,6 +3165,22 @@ interface WaitCiResult {
|
|
|
3161
3165
|
}
|
|
3162
3166
|
declare function waitForCi(args: WaitCiArgs): Promise<WaitCiResult>;
|
|
3163
3167
|
|
|
3168
|
+
/**
|
|
3169
|
+
* Fast-forward the local tier ref to origin/<tier> after a remote merge, WITHOUT
|
|
3170
|
+
* needing a checkout. A promote interrupted after the remote merge (e.g. a
|
|
3171
|
+
* downstream migrate failure) otherwise leaves the local tier BEHIND, so the
|
|
3172
|
+
* next sprint plans on stale code and the next push rejects non-fast-forward.
|
|
3173
|
+
* Mechanism by head position: when HEAD IS the tier, `git pull --ff-only` syncs
|
|
3174
|
+
* ref + working tree; otherwise `git fetch origin <tier>:<tier>` fast-forwards
|
|
3175
|
+
* the local ref in place (git refuses fetch-into-current-branch, hence the
|
|
3176
|
+
* split). Returns null on success; a warning string when the sync fails (e.g.
|
|
3177
|
+
* not a fast-forward because the local tier has its own commits), never throws.
|
|
3178
|
+
*/
|
|
3179
|
+
declare function reconcileTierToOrigin(args: {
|
|
3180
|
+
cwd: string;
|
|
3181
|
+
tier: string;
|
|
3182
|
+
}): Promise<string | null>;
|
|
3183
|
+
|
|
3164
3184
|
declare class ScmMergeError extends Error {
|
|
3165
3185
|
readonly code: "no-state-file" | "bad-precondition" | "no-github-remote" | "no-pr-url" | "bad-pr-url" | "merge-failed" | "migrate-failed" | "migrate-timeout" | "migrate-auth";
|
|
3166
3186
|
constructor(message: string, code: "no-state-file" | "bad-precondition" | "no-github-remote" | "no-pr-url" | "bad-pr-url" | "merge-failed" | "migrate-failed" | "migrate-timeout" | "migrate-auth");
|
|
@@ -4058,4 +4078,4 @@ declare function applySchemaMigrations(args: ApplySchemaMigrationsArgs): Promise
|
|
|
4058
4078
|
declare function rollbackSchemaMigration(args: RollbackSchemaMigrationArgs): Promise<RollbackSchemaMigrationResult>;
|
|
4059
4079
|
declare function schemaMigrationStatus(args: SchemaMigrationStatusArgs): Promise<SchemaMigrationStatusResult>;
|
|
4060
4080
|
|
|
4061
|
-
export { type AbandonFeatureArgs, type AbandonFeatureResult, type AddE2eToRunTestsScriptArgs, type AddE2eToRunTestsScriptResult, type AddInfraToPackageJsonArgs, type AddInfraToPackageJsonResult, type AddInfraToRunTestsScriptArgs, type AddInfraToRunTestsScriptResult, type AddPlaywrightToPackageJsonArgs, type AddPlaywrightToPackageJsonResult, type AddPythonE2eDepsArgs, type AddPythonE2eDepsResult, type AdoptLakebaseProjectArgs, type AdoptLakebaseProjectResult, type AdoptStateArgs, type AdoptStateResult, type AppServicePrincipal, type AppliedSchemaMigration, type ApplySchemaMigrationsArgs, type ApplySchemaMigrationsResult, type BranchLookupOpts, type BranchMetadata, CONVENTION_TIER_DEFAULTS, type CatalogExistsArgs, type CheckoutMode, type CheckoutPairedArgs, type CheckoutPairedResult, type ClaimFeatureBranchArgs, type ClaimFeatureBranchResult, type ClaimedOrphan, type ClientFramework, type CommandDriftReport, type CommandFileEntry, type CommandFileStatus, type ConnectionArgs, type ConsortSetupHooks, type CreateBranchArgs, type CreateConventionBranchArgs, type CreateConventionPairedBranchArgs, type CreateLongRunningBranchArgs, type CreateLongRunningBranchResult, type CreatePairedBranchArgs, type CreatePairedBranchResult, type CreateProjectArgs, type CreateProjectResult, type CutBackupArgs, type CutBackupResult, DEFAULT_PROTECTED_TIER_NAMES, type DatabricksProfile, type DeleteAppEndpointArgs, type DeleteAppEndpointResult, type DeleteBranchArgs, type DeletePairedBranchArgs, type DeletePairedBranchResult, type DeployClaudeCommandsOptions, type DeployClaudeCommandsResult, type DeployEnvExampleArgs, type DeployLanguageProjectArgs, type DeploySpringStarterArgs, type DeployTarget, type DeployTargetsConfig, type DetectCommandDriftArgs, type DetectScaffoldedDriftArgs, type DetectWorkflowDriftArgs, type DoctorArgs$1 as DoctorArgs, type DoctorFinding, type DoctorReport$1 as DoctorReport, type DoctorSeverity, type DsnArgs, type DsnResult, type EnableE2eForProjectArgs, type EnableE2eForProjectResult, type EnableInfraForProjectArgs, type EnableInfraForProjectResult, type EndpointInfo, type EnsureAppEndpointArgs, type EnsureAppEndpointResult, type EnsureEndpointArgs, type EnsureLakebaseSecretAuthArgs, type EnsureLakebaseSecretAuthResult, type EnsureProfilePinnedArgs, type EnsureProfilePinnedResult, type EnsureSchemaAndVolumeArgs, type EnsureSchemaAndVolumeResult, FIXABLE_FINDING_IDS, type FixFindingArgs, type FixFindingResult, type FixableFindingId, type GateInvariant, type GateStatus, type GenerateAppYamlOptions, type GenerateMavenProjectOptions, type GetAppEndpointArgs, type GetAppEndpointResult, type GetAppServicePrincipalArgs, type GetCiAppEndpointArgs, type GetCiAppEndpointResult, type GetConnectionArgs, type GetCredentialArgs, type GetEndpointArgs, type GetSchemaDiffArgs, type GrantLakebasePermissionArgs, type GrantLakebasePermissionResult, type GrantUcCatalogPermissionArgs, type GrantUcCatalogPermissionResult, type DoctorReport as HealthDoctorReport, type HookVerification, type InfraCheckResult, type InfraSuiteResult, type InitWorkflowStateArgs, type InitializrMetadata, InitializrNetworkError, InitializrParseError, type InstallPlaywrightArgs, type InstallPlaywrightOptions, type InstallPlaywrightResult, LakebaseBranchError, type LakebaseBranchInfo, LakebaseBranchTtlTooLongError, type LakebasePermissionLevel, type LakebaseProjectArgs, LakebaseProjectError, type LakebaseProjectInfo, type LakebaseProjectMetadata, type ListSchemaMigrationsArgs, MIGRATION_DEFAULTS, type MergeArgs, type MergePairedArgs, type MergePairedResult, type MergeResult, type MigrationDefaults, type MigrationLanguage, type MigrationLayout, type ModifiedSchemaObject, NODE_E2E_TEMPLATE_FILES, type OrphanCandidate, PLAYWRIGHT_TEMPLATE_FILES, PLAYWRIGHT_TEST_VERSION_RANGE, PYTEST_BDD_VERSION_RANGE, PYTEST_PLAYWRIGHT_VERSION_RANGE, PYTHON_E2E_TEMPLATE_FILES, type PendingSchemaMigration, type PoolArgs, type PreflightResult, type PreparePrArgs, type PreparePrResult, type ProgressCallback, type ProjectLanguage, type PropagateCredentialsArgs, type PropagateCredentialsResult, ProtectedBranchCommitError, type QueryBranchSchemaArgs, type RecoverOrphansArgs, type RecoverOrphansResult, type ReleaseArgs, type ReleaseResult, type RemoveRunnerArgs, type ResolveDatabricksHostArgs, type ResolveMigrationLayoutArgs, type RollbackDeployArgs, type RollbackDeployResult, type RollbackOptions, type RollbackSchemaMigrationArgs, type RollbackSchemaMigrationResult, type RunDoctorDeps, type RunInfraSuiteArgs, type RunPlaywrightInstallArgs, type RunPlaywrightInstallResult, type RunnerInfo, type RunnerReportFn, type RunnerType, SCM_STATES, STATE_FILE_REL, type ScaffoldAllArgs, type ScaffoldOptions, type ScaffoldReportFn, type ScaffoldStaticAllArgs, type ScaffoldStaticAllResult, type ScaffoldedDriftReport, type SchemaColumn, type SchemaDiffResult, SchemaMigrationError, type SchemaMigrationFile, type SchemaMigrationLanguage, type SchemaMigrationStatusArgs, type SchemaMigrationStatusResult, type SchemaMigrationToolName, type SchemaObject, type SchemaQueryRow, ScmAbandonError, ScmAdoptError, ScmClaimError, ScmDoctorFixError, ScmMergeError, ScmPreparePrError, ScmRecoverError, type ScmState, ScmWaitCiError, type ScmWorkflowState, type SetupRunnerArgs, type SftddSetupHooks, SpringInitializrClient, type SpringJvmLanguage, type StaleBranchFinding, type SyncEnvArgs, type SyncEnvResult, type TableSchema, type TierTopology, type TryCreateCatalogArgs, type TryCreateCatalogResult, type UcCatalogPermission, type UpdateEnvConnectionArgs, type UpdateWorkflowsArgs, type UpdateWorkflowsResult, type UploadDirectoryArgs, type UploadDirectoryResult, type ValidateAppOptions, type ValidateAppResult, type ValidationError, type ValidationResult, type WaitCiArgs, type WaitCiResult, type WaitForBranchAuthReadyArgs, type WaitForBranchReadyArgs, type WorkflowDriftReport, type WorkflowFileStatus, type WorkflowFileUpdate, type WorkflowStatus, type WorkflowUpdateOutcome, type WorkflowVerification, type WriteEnvFileArgs, type WritePlaywrightTemplatesArgs, type WritePlaywrightTemplatesResult, _testMakeBrownfieldFixture, abandonFeatureBranch, addE2eToRunTestsScript, addInfraToPackageJson, addInfraToRunTestsScript, addPlaywrightToPackageJson, adoptLakebaseProject, adoptScmState, applySchemaMigrations, assertAdoptionPreflight, assertCleanForFork, assertCommitTargetNotProtected, assertCreatedProjectReady, buildPostgresUrl, buildSchemaQuery, cacheProjectRetention, catalogExists, catalogExplorerUrl, checkDatabricksAuth, checkoutPaired, claimFeatureBranch, clearRetentionCache, compileMigrationPattern, connectionApplicationName, createBranch, createFeaturePairedBranch, createLakebaseProject, createLongRunningBranch, createPairedBranch, createPerfPairedBranch, createProject, createTestPairedBranch, createUatPairedBranch, cutBackup, databricksAuthPrereqMessage, deleteAppEndpoint, deleteBranch, deleteLakebaseProject, deletePairedBranch, 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, findDefaultBranchName, findHistoryRetentionDuration, fixFinding, formatJUnit, formatSchemaDiffAsMarkdown, generateAppYaml, getAppEndpoint, getAppServicePrincipal, getBranchByName, getCachedProjectRetention, getCiAppEndpoint, getConnection, getCredential, getDefaultBranch, getDefaultBranchId, getDefaultBranchName, getEndpoint, getProjectInfo, getProjectRetentionDuration, getRunnerInfo, getSchemaDiff, getTargetNames, grantLakebasePermission, grantUcCatalogPermission, inferTierTopology, initWorkflowState, installHooks, installPlaywright, isAllSchemas, isForeignFeatureClaim, 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, recoverOrphans, release, removeRunner, resolveBranchId, resolveBranchPath, resolveCurrentUser, resolveDatabricksHost, resolveEndpointHost, resolveFeatureStartPoint, resolveJavaHome, resolveLatestBootVersion, resolveLatestLtsJavaVersion, resolveMigrationLanguage, resolveMigrationLayout, resolveParentBranch, resolveProfileForHost, resolveProfileForHostSync, resolveProtectedTierNames, rollbackDeploy, rollbackSchemaMigration, runDoctor$1 as runDoctor, runDoctor as 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 };
|
|
4081
|
+
export { type AbandonFeatureArgs, type AbandonFeatureResult, type AddE2eToRunTestsScriptArgs, type AddE2eToRunTestsScriptResult, type AddInfraToPackageJsonArgs, type AddInfraToPackageJsonResult, type AddInfraToRunTestsScriptArgs, type AddInfraToRunTestsScriptResult, type AddPlaywrightToPackageJsonArgs, type AddPlaywrightToPackageJsonResult, type AddPythonE2eDepsArgs, type AddPythonE2eDepsResult, type AdoptLakebaseProjectArgs, type AdoptLakebaseProjectResult, type AdoptStateArgs, type AdoptStateResult, type AppServicePrincipal, type AppliedSchemaMigration, type ApplySchemaMigrationsArgs, type ApplySchemaMigrationsResult, type BranchLookupOpts, type BranchMetadata, CONVENTION_TIER_DEFAULTS, type CatalogExistsArgs, type CheckoutMode, type CheckoutPairedArgs, type CheckoutPairedResult, type ClaimFeatureBranchArgs, type ClaimFeatureBranchResult, type ClaimedOrphan, type ClientFramework, type CommandDriftReport, type CommandFileEntry, type CommandFileStatus, type ConnectionArgs, type ConsortSetupHooks, type CreateBranchArgs, type CreateConventionBranchArgs, type CreateConventionPairedBranchArgs, type CreateLongRunningBranchArgs, type CreateLongRunningBranchResult, type CreatePairedBranchArgs, type CreatePairedBranchResult, type CreateProjectArgs, type CreateProjectResult, type CutBackupArgs, type CutBackupResult, DEFAULT_PROTECTED_TIER_NAMES, type DatabricksProfile, type DeleteAppEndpointArgs, type DeleteAppEndpointResult, type DeleteBranchArgs, type DeletePairedBranchArgs, type DeletePairedBranchResult, type DeployClaudeCommandsOptions, type DeployClaudeCommandsResult, type DeployEnvExampleArgs, type DeployLanguageProjectArgs, type DeploySpringStarterArgs, type DeployTarget, type DeployTargetsConfig, type DetectCommandDriftArgs, type DetectScaffoldedDriftArgs, type DetectWorkflowDriftArgs, type DoctorArgs$1 as DoctorArgs, type DoctorFinding, type DoctorReport$1 as DoctorReport, type DoctorSeverity, type DsnArgs, type DsnResult, type EnableE2eForProjectArgs, type EnableE2eForProjectResult, type EnableInfraForProjectArgs, type EnableInfraForProjectResult, type EndpointInfo, type EnsureAppEndpointArgs, type EnsureAppEndpointResult, type EnsureEndpointArgs, type EnsureLakebaseSecretAuthArgs, type EnsureLakebaseSecretAuthResult, type EnsureProfilePinnedArgs, type EnsureProfilePinnedResult, type EnsureSchemaAndVolumeArgs, type EnsureSchemaAndVolumeResult, FIXABLE_FINDING_IDS, type FixFindingArgs, type FixFindingResult, type FixableFindingId, type GateInvariant, type GateStatus, type GenerateAppYamlOptions, type GenerateMavenProjectOptions, type GetAppEndpointArgs, type GetAppEndpointResult, type GetAppServicePrincipalArgs, type GetCiAppEndpointArgs, type GetCiAppEndpointResult, type GetConnectionArgs, type GetCredentialArgs, type GetEndpointArgs, type GetSchemaDiffArgs, type GrantLakebasePermissionArgs, type GrantLakebasePermissionResult, type GrantUcCatalogPermissionArgs, type GrantUcCatalogPermissionResult, type DoctorReport as HealthDoctorReport, type HookVerification, type InfraCheckResult, type InfraSuiteResult, type InitWorkflowStateArgs, type InitializrMetadata, InitializrNetworkError, InitializrParseError, type InstallPlaywrightArgs, type InstallPlaywrightOptions, type InstallPlaywrightResult, LakebaseBranchError, type LakebaseBranchInfo, LakebaseBranchTtlTooLongError, type LakebasePermissionLevel, type LakebaseProjectArgs, LakebaseProjectError, type LakebaseProjectInfo, type LakebaseProjectMetadata, type ListSchemaMigrationsArgs, MIGRATION_DEFAULTS, type MergeArgs, type MergePairedArgs, type MergePairedResult, type MergeResult, type MigrationDefaults, type MigrationLanguage, type MigrationLayout, type ModifiedSchemaObject, NODE_E2E_TEMPLATE_FILES, type OrphanCandidate, PLAYWRIGHT_TEMPLATE_FILES, PLAYWRIGHT_TEST_VERSION_RANGE, PYTEST_BDD_VERSION_RANGE, PYTEST_PLAYWRIGHT_VERSION_RANGE, PYTHON_E2E_TEMPLATE_FILES, type PendingSchemaMigration, type PoolArgs, type PreflightResult, type PreparePrArgs, type PreparePrResult, type ProgressCallback, type ProjectLanguage, type PropagateCredentialsArgs, type PropagateCredentialsResult, ProtectedBranchCommitError, type QueryBranchSchemaArgs, type RecoverOrphansArgs, type RecoverOrphansResult, type ReleaseArgs, type ReleaseResult, type RemoveRunnerArgs, type ResolveDatabricksHostArgs, type ResolveMigrationLayoutArgs, type RollbackDeployArgs, type RollbackDeployResult, type RollbackOptions, type RollbackSchemaMigrationArgs, type RollbackSchemaMigrationResult, type RunDoctorDeps, type RunInfraSuiteArgs, type RunPlaywrightInstallArgs, type RunPlaywrightInstallResult, type RunnerInfo, type RunnerReportFn, type RunnerType, SCM_STATES, STATE_FILE_REL, type ScaffoldAllArgs, type ScaffoldOptions, type ScaffoldReportFn, type ScaffoldStaticAllArgs, type ScaffoldStaticAllResult, type ScaffoldedDriftReport, type SchemaColumn, type SchemaDiffResult, SchemaMigrationError, type SchemaMigrationFile, type SchemaMigrationLanguage, type SchemaMigrationStatusArgs, type SchemaMigrationStatusResult, type SchemaMigrationToolName, type SchemaObject, type SchemaQueryRow, ScmAbandonError, ScmAdoptError, ScmClaimError, ScmDoctorFixError, ScmMergeError, ScmPreparePrError, ScmRecoverError, type ScmState, ScmWaitCiError, type ScmWorkflowState, type SetupRunnerArgs, type SftddSetupHooks, SpringInitializrClient, type SpringJvmLanguage, type StaleBranchFinding, type SyncEnvArgs, type SyncEnvResult, type TableSchema, type TierTopology, type TryCreateCatalogArgs, type TryCreateCatalogResult, type UcCatalogPermission, type UpdateEnvConnectionArgs, type UpdateWorkflowsArgs, type UpdateWorkflowsResult, type UploadDirectoryArgs, type UploadDirectoryResult, type ValidateAppOptions, type ValidateAppResult, type ValidationError, type ValidationResult, type WaitCiArgs, type WaitCiResult, type WaitForBranchAuthReadyArgs, type WaitForBranchReadyArgs, type WorkflowDriftReport, type WorkflowFileStatus, type WorkflowFileUpdate, type WorkflowStatus, type WorkflowUpdateOutcome, type WorkflowVerification, type WriteEnvFileArgs, type WritePlaywrightTemplatesArgs, type WritePlaywrightTemplatesResult, _testMakeBrownfieldFixture, abandonFeatureBranch, addE2eToRunTestsScript, addInfraToPackageJson, addInfraToRunTestsScript, addPlaywrightToPackageJson, adoptLakebaseProject, adoptScmState, applySchemaMigrations, assertAdoptionPreflight, assertCleanForFork, assertCommitTargetNotProtected, assertCreatedProjectReady, buildPostgresUrl, buildSchemaQuery, cacheProjectRetention, catalogExists, catalogExplorerUrl, checkDatabricksAuth, checkoutPaired, claimFeatureBranch, clearRetentionCache, compileMigrationPattern, connectionApplicationName, createBranch, createFeaturePairedBranch, createLakebaseProject, createLongRunningBranch, createPairedBranch, createPerfPairedBranch, createProject, createTestPairedBranch, createUatPairedBranch, cutBackup, databricksAuthPrereqMessage, deleteAppEndpoint, deleteBranch, deleteLakebaseProject, deletePairedBranch, 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, findDefaultBranchName, findHistoryRetentionDuration, fixFinding, formatJUnit, formatSchemaDiffAsMarkdown, generateAppYaml, getAppEndpoint, getAppServicePrincipal, getBranchByName, getCachedProjectRetention, getCiAppEndpoint, getConnection, getCredential, getDefaultBranch, getDefaultBranchId, getDefaultBranchName, getEndpoint, getProjectInfo, getProjectRetentionDuration, getRunnerInfo, getSchemaDiff, getTargetNames, grantLakebasePermission, grantUcCatalogPermission, inferTierTopology, initWorkflowState, installHooks, installPlaywright, isAllSchemas, 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, reconcileTierToOrigin, recoverOrphans, release, removeRunner, resolveBranchId, resolveBranchPath, resolveCurrentUser, resolveDatabricksHost, resolveEndpointHost, resolveFeatureStartPoint, resolveJavaHome, resolveLatestBootVersion, resolveLatestLtsJavaVersion, resolveMigrationLanguage, resolveMigrationLayout, resolveParentBranch, resolveProfileForHost, resolveProfileForHostSync, resolveProtectedTierNames, rollbackDeploy, rollbackSchemaMigration, runDoctor$1 as runDoctor, runDoctor as 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 };
|
|
@@ -1751,7 +1751,9 @@ function resolveProfile(opts) {
|
|
|
1751
1751
|
function buildInvocation(args, opts) {
|
|
1752
1752
|
const base = opts.env ?? process.env;
|
|
1753
1753
|
const trimmedHost = effectiveHost(opts)?.replace(/\/+$/, "");
|
|
1754
|
-
const env =
|
|
1754
|
+
const env = { ...base };
|
|
1755
|
+
if (trimmedHost) env.DATABRICKS_HOST = trimmedHost;
|
|
1756
|
+
delete env.DATABRICKS_WORKSPACE_ID;
|
|
1755
1757
|
const profile = resolveProfile(opts);
|
|
1756
1758
|
const argv = profile && !opts.noProfile && !args.includes("--profile") ? [...args, "--profile", profile] : args;
|
|
1757
1759
|
return { argv, env, profile };
|
|
@@ -2498,8 +2500,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
2498
2500
|
var cached;
|
|
2499
2501
|
function substrateSelfVersion() {
|
|
2500
2502
|
if (cached !== void 0) return cached;
|
|
2501
|
-
if ("0.2.
|
|
2502
|
-
cached = "0.2.
|
|
2503
|
+
if ("0.2.43".length > 0) {
|
|
2504
|
+
cached = "0.2.43";
|
|
2503
2505
|
return cached;
|
|
2504
2506
|
}
|
|
2505
2507
|
cached = "unknown";
|
|
@@ -12282,12 +12284,27 @@ function runTestsE2eBlock() {
|
|
|
12282
12284
|
' export VITE_PROXY_TARGET="http://127.0.0.1:${E2E_BACKEND_PORT}"',
|
|
12283
12285
|
' echo "Local E2E free-port: backend :$E2E_BACKEND_PORT / client :$E2E_CLIENT_PORT"',
|
|
12284
12286
|
"fi",
|
|
12287
|
+
// Stale-server hygiene (issue #197): CI=1 on the Playwright invocations below
|
|
12288
|
+
// forces EVERY config vintage's reuseExistingServer guard OFF (old `!CI` and
|
|
12289
|
+
// new `!!BASE_URL` alike), so the verify never reuses a stale server bound to
|
|
12290
|
+
// an unmigrated branch (the false-500 misdiagnosis). A lingering uvicorn/vite
|
|
12291
|
+
// on the conventional default ports still serves STALE schema to anything
|
|
12292
|
+
// that reaches it, so clear it (TERM, not KILL) before the boot - never when
|
|
12293
|
+
// the caller pre-set the ports (the deploy gate owns that server; BASE_URL).
|
|
12294
|
+
'if [ -z "${BASE_URL:-}" ] && command -v lsof >/dev/null 2>&1; then',
|
|
12295
|
+
' for p in "${E2E_BACKEND_PORT:-8000}" "${E2E_CLIENT_PORT:-5173}"; do',
|
|
12296
|
+
' if lsof -iTCP:"$p" -sTCP:LISTEN -n -P >/dev/null 2>&1; then',
|
|
12297
|
+
' echo "Local E2E: clearing a stale listener on :$p before the webServer boot"',
|
|
12298
|
+
' lsof -ti tcp:"$p" 2>/dev/null | xargs kill 2>/dev/null || true',
|
|
12299
|
+
" fi",
|
|
12300
|
+
" done",
|
|
12301
|
+
"fi",
|
|
12285
12302
|
'if [ -f "$REPO_ROOT/playwright.config.ts" ] || [ -f "$REPO_ROOT/playwright.config.js" ]; then',
|
|
12286
12303
|
' echo "Running Playwright E2E tests..."',
|
|
12287
12304
|
' if [ -f "$REPO_ROOT/package.json" ] && command -v npm >/dev/null 2>&1; then',
|
|
12288
|
-
' (cd "$REPO_ROOT" && npm run test:e2e)',
|
|
12305
|
+
' (cd "$REPO_ROOT" && CI=1 npm run test:e2e)',
|
|
12289
12306
|
" else",
|
|
12290
|
-
' (cd "$REPO_ROOT" && npx --yes playwright test)',
|
|
12307
|
+
' (cd "$REPO_ROOT" && CI=1 npx --yes playwright test)',
|
|
12291
12308
|
" fi",
|
|
12292
12309
|
// Python E2E: pytest-playwright + the shipped tests/e2e/conftest.py
|
|
12293
12310
|
// (live_server). Gated on the conftest + pyproject so it only fires for a
|
|
@@ -12326,7 +12343,8 @@ function runTestsE2eBlock() {
|
|
|
12326
12343
|
'if [ -f "$REPO_ROOT/client/playwright.config.ts" ] || [ -f "$REPO_ROOT/client/playwright.config.js" ] || [ -f "$REPO_ROOT/client/playwright.config.mjs" ]; then',
|
|
12327
12344
|
' echo "Running client Playwright E2E tests..."',
|
|
12328
12345
|
' (cd "$REPO_ROOT/client" && npx --yes playwright install chromium)',
|
|
12329
|
-
|
|
12346
|
+
// CI=1: no server reuse on any config vintage (see the stale-server note above).
|
|
12347
|
+
' (cd "$REPO_ROOT/client" && CI=1 npx --yes playwright test --pass-with-no-tests)',
|
|
12330
12348
|
"fi",
|
|
12331
12349
|
""
|
|
12332
12350
|
].join("\n");
|
|
@@ -12931,6 +12949,39 @@ async function syncCiSecrets(args) {
|
|
|
12931
12949
|
init_esm_shims();
|
|
12932
12950
|
import * as fs17 from "fs";
|
|
12933
12951
|
import * as path16 from "path";
|
|
12952
|
+
import { execFileSync as execFileSync6 } from "child_process";
|
|
12953
|
+
function isGitTracked(projectDir, rel) {
|
|
12954
|
+
try {
|
|
12955
|
+
execFileSync6("git", ["ls-files", "--error-unmatch", "--", rel], { cwd: projectDir, stdio: "ignore" });
|
|
12956
|
+
return true;
|
|
12957
|
+
} catch {
|
|
12958
|
+
return false;
|
|
12959
|
+
}
|
|
12960
|
+
}
|
|
12961
|
+
function ensureWorkflowStateUntracked(projectDir) {
|
|
12962
|
+
const rel = ".lakebase/workflow-state.json";
|
|
12963
|
+
try {
|
|
12964
|
+
if (isGitTracked(projectDir, rel)) {
|
|
12965
|
+
execFileSync6("git", ["rm", "--cached", "--quiet", "--ignore-unmatch", "--", rel], { cwd: projectDir, stdio: "ignore" });
|
|
12966
|
+
}
|
|
12967
|
+
} catch {
|
|
12968
|
+
}
|
|
12969
|
+
try {
|
|
12970
|
+
const gitignore = path16.join(projectDir, ".gitignore");
|
|
12971
|
+
const existing = fs17.existsSync(gitignore) ? fs17.readFileSync(gitignore, "utf8") : "";
|
|
12972
|
+
if (!existing.split("\n").some((l) => l.trim() === rel)) {
|
|
12973
|
+
const sep4 = existing === "" || existing.endsWith("\n") ? "" : "\n";
|
|
12974
|
+
fs17.appendFileSync(
|
|
12975
|
+
gitignore,
|
|
12976
|
+
`${sep4}# Runtime SCM claim state (per working tree): a branch checkout must never restore
|
|
12977
|
+
# a stale committed claim over the live one (issue #203 / Finding 28).
|
|
12978
|
+
${rel}
|
|
12979
|
+
`
|
|
12980
|
+
);
|
|
12981
|
+
}
|
|
12982
|
+
} catch {
|
|
12983
|
+
}
|
|
12984
|
+
}
|
|
12934
12985
|
var SCM_STATES = [
|
|
12935
12986
|
"scaffold-complete",
|
|
12936
12987
|
"feature-claimed",
|
|
@@ -12983,6 +13034,7 @@ function writeWorkflowState(projectDir, state) {
|
|
|
12983
13034
|
throw new Error(`Refusing to write invalid SCM state:
|
|
12984
13035
|
${summary}`);
|
|
12985
13036
|
}
|
|
13037
|
+
ensureWorkflowStateUntracked(projectDir);
|
|
12986
13038
|
const dir = path16.join(projectDir, ".lakebase");
|
|
12987
13039
|
fs17.mkdirSync(dir, { recursive: true });
|
|
12988
13040
|
const target = stateFilePath(projectDir);
|
|
@@ -15768,6 +15820,20 @@ function pickRunUrl(pr) {
|
|
|
15768
15820
|
|
|
15769
15821
|
// scripts/lakebase/scm-merge.ts
|
|
15770
15822
|
init_esm_shims();
|
|
15823
|
+
async function reconcileTierToOrigin(args) {
|
|
15824
|
+
const { cwd, tier } = args;
|
|
15825
|
+
try {
|
|
15826
|
+
const head = await getCurrentBranch({ cwd });
|
|
15827
|
+
if (head === tier) {
|
|
15828
|
+
await exec2(`git pull --ff-only`, { cwd, timeout: 3e4 });
|
|
15829
|
+
} else {
|
|
15830
|
+
await exec2(`git fetch origin ${shellEscape2(`${tier}:${tier}`)}`, { cwd, timeout: 3e4 });
|
|
15831
|
+
}
|
|
15832
|
+
return null;
|
|
15833
|
+
} catch (err) {
|
|
15834
|
+
return `local reconcile of ${tier} to origin/${tier} failed: ${err instanceof Error ? err.message : String(err)}. Reconcile it by hand (git checkout ${tier} && git pull --ff-only).`;
|
|
15835
|
+
}
|
|
15836
|
+
}
|
|
15771
15837
|
var ScmMergeError = class extends Error {
|
|
15772
15838
|
constructor(message, code) {
|
|
15773
15839
|
super(message);
|
|
@@ -15893,6 +15959,8 @@ async function mergeFeature(args) {
|
|
|
15893
15959
|
}
|
|
15894
15960
|
} else {
|
|
15895
15961
|
headAfter = head || current.branch;
|
|
15962
|
+
const reconcileWarning = await reconcileTierToOrigin({ cwd: args.projectDir, tier: switchTo });
|
|
15963
|
+
if (reconcileWarning) warnings.push(reconcileWarning);
|
|
15896
15964
|
}
|
|
15897
15965
|
if (headAfter !== current.branch) {
|
|
15898
15966
|
try {
|
|
@@ -16239,7 +16307,6 @@ function parentForTopology(t, defaultLeaf) {
|
|
|
16239
16307
|
// scripts/lakebase/scm-doctor.ts
|
|
16240
16308
|
init_esm_shims();
|
|
16241
16309
|
import * as fs29 from "fs";
|
|
16242
|
-
import { execFileSync as execFileSync6 } from "child_process";
|
|
16243
16310
|
import * as path29 from "path";
|
|
16244
16311
|
var FEATURE_PREFIX = "feature/";
|
|
16245
16312
|
var TIER_LEAFS2 = DEFAULT_PROTECTED_TIER_NAMES;
|
|
@@ -16257,14 +16324,6 @@ function readEnv(projectDir) {
|
|
|
16257
16324
|
function leafOf2(b) {
|
|
16258
16325
|
return b.name.split("/").pop() ?? b.name;
|
|
16259
16326
|
}
|
|
16260
|
-
function isGitTracked(projectDir, rel) {
|
|
16261
|
-
try {
|
|
16262
|
-
execFileSync6("git", ["ls-files", "--error-unmatch", "--", rel], { cwd: projectDir, stdio: "ignore" });
|
|
16263
|
-
return true;
|
|
16264
|
-
} catch {
|
|
16265
|
-
return false;
|
|
16266
|
-
}
|
|
16267
|
-
}
|
|
16268
16327
|
function worstOf(a, b) {
|
|
16269
16328
|
const order = ["ok", "warn", "fail"];
|
|
16270
16329
|
return order[Math.max(order.indexOf(a), order.indexOf(b))];
|
|
@@ -17725,6 +17784,7 @@ export {
|
|
|
17725
17784
|
installPlaywright,
|
|
17726
17785
|
isAllSchemas,
|
|
17727
17786
|
isForeignFeatureClaim,
|
|
17787
|
+
isGitTracked,
|
|
17728
17788
|
isLongRunningTierBranch,
|
|
17729
17789
|
isLtsJavaVersion,
|
|
17730
17790
|
isPrereleaseBootVersion,
|
|
@@ -17755,6 +17815,7 @@ export {
|
|
|
17755
17815
|
readEnvVar,
|
|
17756
17816
|
readTargets,
|
|
17757
17817
|
readWorkflowState,
|
|
17818
|
+
reconcileTierToOrigin,
|
|
17758
17819
|
recoverOrphans,
|
|
17759
17820
|
release,
|
|
17760
17821
|
removeRunner,
|
|
@@ -77700,7 +77700,9 @@ function resolveProfile(opts) {
|
|
|
77700
77700
|
function buildInvocation(args, opts) {
|
|
77701
77701
|
const base = opts.env ?? process.env;
|
|
77702
77702
|
const trimmedHost = effectiveHost(opts)?.replace(/\/+$/, "");
|
|
77703
|
-
const env =
|
|
77703
|
+
const env = { ...base };
|
|
77704
|
+
if (trimmedHost) env.DATABRICKS_HOST = trimmedHost;
|
|
77705
|
+
delete env.DATABRICKS_WORKSPACE_ID;
|
|
77704
77706
|
const profile = resolveProfile(opts);
|
|
77705
77707
|
const argv = profile && !opts.noProfile && !args.includes("--profile") ? [...args, "--profile", profile] : args;
|
|
77706
77708
|
return { argv, env, profile };
|
|
@@ -79270,8 +79272,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
79270
79272
|
var cached;
|
|
79271
79273
|
function substrateSelfVersion() {
|
|
79272
79274
|
if (cached !== void 0) return cached;
|
|
79273
|
-
if ("0.2.
|
|
79274
|
-
cached = "0.2.
|
|
79275
|
+
if ("0.2.43".length > 0) {
|
|
79276
|
+
cached = "0.2.43";
|
|
79275
79277
|
return cached;
|
|
79276
79278
|
}
|
|
79277
79279
|
cached = "unknown";
|
|
@@ -179,7 +179,9 @@ function resolveProfile(opts) {
|
|
|
179
179
|
function buildInvocation(args, opts) {
|
|
180
180
|
const base = opts.env ?? process.env;
|
|
181
181
|
const trimmedHost = effectiveHost(opts)?.replace(/\/+$/, "");
|
|
182
|
-
const env =
|
|
182
|
+
const env = { ...base };
|
|
183
|
+
if (trimmedHost) env.DATABRICKS_HOST = trimmedHost;
|
|
184
|
+
delete env.DATABRICKS_WORKSPACE_ID;
|
|
183
185
|
const profile = resolveProfile(opts);
|
|
184
186
|
const argv = profile && !opts.noProfile && !args.includes("--profile") ? [...args, "--profile", profile] : args;
|
|
185
187
|
return { argv, env, profile };
|
|
@@ -373,8 +375,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
373
375
|
var cached;
|
|
374
376
|
function substrateSelfVersion() {
|
|
375
377
|
if (cached !== void 0) return cached;
|
|
376
|
-
if ("0.2.
|
|
377
|
-
cached = "0.2.
|
|
378
|
+
if ("0.2.43".length > 0) {
|
|
379
|
+
cached = "0.2.43";
|
|
378
380
|
return cached;
|
|
379
381
|
}
|
|
380
382
|
cached = "unknown";
|
|
@@ -77700,7 +77700,9 @@ function resolveProfile(opts) {
|
|
|
77700
77700
|
function buildInvocation(args, opts) {
|
|
77701
77701
|
const base = opts.env ?? process.env;
|
|
77702
77702
|
const trimmedHost = effectiveHost(opts)?.replace(/\/+$/, "");
|
|
77703
|
-
const env =
|
|
77703
|
+
const env = { ...base };
|
|
77704
|
+
if (trimmedHost) env.DATABRICKS_HOST = trimmedHost;
|
|
77705
|
+
delete env.DATABRICKS_WORKSPACE_ID;
|
|
77704
77706
|
const profile = resolveProfile(opts);
|
|
77705
77707
|
const argv = profile && !opts.noProfile && !args.includes("--profile") ? [...args, "--profile", profile] : args;
|
|
77706
77708
|
return { argv, env, profile };
|
|
@@ -79270,8 +79272,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
79270
79272
|
var cached;
|
|
79271
79273
|
function substrateSelfVersion() {
|
|
79272
79274
|
if (cached !== void 0) return cached;
|
|
79273
|
-
if ("0.2.
|
|
79274
|
-
cached = "0.2.
|
|
79275
|
+
if ("0.2.43".length > 0) {
|
|
79276
|
+
cached = "0.2.43";
|
|
79275
79277
|
return cached;
|
|
79276
79278
|
}
|
|
79277
79279
|
cached = "unknown";
|
|
@@ -179,7 +179,9 @@ function resolveProfile(opts) {
|
|
|
179
179
|
function buildInvocation(args, opts) {
|
|
180
180
|
const base = opts.env ?? process.env;
|
|
181
181
|
const trimmedHost = effectiveHost(opts)?.replace(/\/+$/, "");
|
|
182
|
-
const env =
|
|
182
|
+
const env = { ...base };
|
|
183
|
+
if (trimmedHost) env.DATABRICKS_HOST = trimmedHost;
|
|
184
|
+
delete env.DATABRICKS_WORKSPACE_ID;
|
|
183
185
|
const profile = resolveProfile(opts);
|
|
184
186
|
const argv = profile && !opts.noProfile && !args.includes("--profile") ? [...args, "--profile", profile] : args;
|
|
185
187
|
return { argv, env, profile };
|
|
@@ -373,8 +375,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
373
375
|
var cached;
|
|
374
376
|
function substrateSelfVersion() {
|
|
375
377
|
if (cached !== void 0) return cached;
|
|
376
|
-
if ("0.2.
|
|
377
|
-
cached = "0.2.
|
|
378
|
+
if ("0.2.43".length > 0) {
|
|
379
|
+
cached = "0.2.43";
|
|
378
380
|
return cached;
|
|
379
381
|
}
|
|
380
382
|
cached = "unknown";
|
|
@@ -77695,7 +77695,9 @@ function resolveProfile(opts) {
|
|
|
77695
77695
|
function buildInvocation(args, opts) {
|
|
77696
77696
|
const base = opts.env ?? process.env;
|
|
77697
77697
|
const trimmedHost = effectiveHost(opts)?.replace(/\/+$/, "");
|
|
77698
|
-
const env =
|
|
77698
|
+
const env = { ...base };
|
|
77699
|
+
if (trimmedHost) env.DATABRICKS_HOST = trimmedHost;
|
|
77700
|
+
delete env.DATABRICKS_WORKSPACE_ID;
|
|
77699
77701
|
const profile = resolveProfile(opts);
|
|
77700
77702
|
const argv = profile && !opts.noProfile && !args.includes("--profile") ? [...args, "--profile", profile] : args;
|
|
77701
77703
|
return { argv, env, profile };
|
|
@@ -79268,8 +79270,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
79268
79270
|
var cached;
|
|
79269
79271
|
function substrateSelfVersion() {
|
|
79270
79272
|
if (cached !== void 0) return cached;
|
|
79271
|
-
if ("0.2.
|
|
79272
|
-
cached = "0.2.
|
|
79273
|
+
if ("0.2.43".length > 0) {
|
|
79274
|
+
cached = "0.2.43";
|
|
79273
79275
|
return cached;
|
|
79274
79276
|
}
|
|
79275
79277
|
cached = "unknown";
|
|
@@ -175,7 +175,9 @@ function resolveProfile(opts) {
|
|
|
175
175
|
function buildInvocation(args, opts) {
|
|
176
176
|
const base = opts.env ?? process.env;
|
|
177
177
|
const trimmedHost = effectiveHost(opts)?.replace(/\/+$/, "");
|
|
178
|
-
const env =
|
|
178
|
+
const env = { ...base };
|
|
179
|
+
if (trimmedHost) env.DATABRICKS_HOST = trimmedHost;
|
|
180
|
+
delete env.DATABRICKS_WORKSPACE_ID;
|
|
179
181
|
const profile = resolveProfile(opts);
|
|
180
182
|
const argv = profile && !opts.noProfile && !args.includes("--profile") ? [...args, "--profile", profile] : args;
|
|
181
183
|
return { argv, env, profile };
|
|
@@ -369,8 +371,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
369
371
|
var cached;
|
|
370
372
|
function substrateSelfVersion() {
|
|
371
373
|
if (cached !== void 0) return cached;
|
|
372
|
-
if ("0.2.
|
|
373
|
-
cached = "0.2.
|
|
374
|
+
if ("0.2.43".length > 0) {
|
|
375
|
+
cached = "0.2.43";
|
|
374
376
|
return cached;
|
|
375
377
|
}
|
|
376
378
|
cached = "unknown";
|
|
@@ -77700,7 +77700,9 @@ function resolveProfile(opts) {
|
|
|
77700
77700
|
function buildInvocation(args, opts) {
|
|
77701
77701
|
const base = opts.env ?? process.env;
|
|
77702
77702
|
const trimmedHost = effectiveHost(opts)?.replace(/\/+$/, "");
|
|
77703
|
-
const env =
|
|
77703
|
+
const env = { ...base };
|
|
77704
|
+
if (trimmedHost) env.DATABRICKS_HOST = trimmedHost;
|
|
77705
|
+
delete env.DATABRICKS_WORKSPACE_ID;
|
|
77704
77706
|
const profile = resolveProfile(opts);
|
|
77705
77707
|
const argv = profile && !opts.noProfile && !args.includes("--profile") ? [...args, "--profile", profile] : args;
|
|
77706
77708
|
return { argv, env, profile };
|
|
@@ -79304,8 +79306,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
79304
79306
|
var cached;
|
|
79305
79307
|
function substrateSelfVersion() {
|
|
79306
79308
|
if (cached !== void 0) return cached;
|
|
79307
|
-
if ("0.2.
|
|
79308
|
-
cached = "0.2.
|
|
79309
|
+
if ("0.2.43".length > 0) {
|
|
79310
|
+
cached = "0.2.43";
|
|
79309
79311
|
return cached;
|
|
79310
79312
|
}
|
|
79311
79313
|
cached = "unknown";
|
|
@@ -179,7 +179,9 @@ function resolveProfile(opts) {
|
|
|
179
179
|
function buildInvocation(args, opts) {
|
|
180
180
|
const base = opts.env ?? process.env;
|
|
181
181
|
const trimmedHost = effectiveHost(opts)?.replace(/\/+$/, "");
|
|
182
|
-
const env =
|
|
182
|
+
const env = { ...base };
|
|
183
|
+
if (trimmedHost) env.DATABRICKS_HOST = trimmedHost;
|
|
184
|
+
delete env.DATABRICKS_WORKSPACE_ID;
|
|
183
185
|
const profile = resolveProfile(opts);
|
|
184
186
|
const argv = profile && !opts.noProfile && !args.includes("--profile") ? [...args, "--profile", profile] : args;
|
|
185
187
|
return { argv, env, profile };
|
|
@@ -407,8 +409,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
|
|
|
407
409
|
var cached;
|
|
408
410
|
function substrateSelfVersion() {
|
|
409
411
|
if (cached !== void 0) return cached;
|
|
410
|
-
if ("0.2.
|
|
411
|
-
cached = "0.2.
|
|
412
|
+
if ("0.2.43".length > 0) {
|
|
413
|
+
cached = "0.2.43";
|
|
412
414
|
return cached;
|
|
413
415
|
}
|
|
414
416
|
cached = "unknown";
|
|
@@ -77755,7 +77755,9 @@ function resolveProfile(opts) {
|
|
|
77755
77755
|
function buildInvocation(args, opts) {
|
|
77756
77756
|
const base = opts.env ?? process.env;
|
|
77757
77757
|
const trimmedHost = effectiveHost(opts)?.replace(/\/+$/, "");
|
|
77758
|
-
const env =
|
|
77758
|
+
const env = { ...base };
|
|
77759
|
+
if (trimmedHost) env.DATABRICKS_HOST = trimmedHost;
|
|
77760
|
+
delete env.DATABRICKS_WORKSPACE_ID;
|
|
77759
77761
|
const profile = resolveProfile(opts);
|
|
77760
77762
|
const argv = profile && !opts.noProfile && !args.includes("--profile") ? [...args, "--profile", profile] : args;
|
|
77761
77763
|
return { argv, env, profile };
|
|
@@ -78140,6 +78142,39 @@ async function deletePairedBranch(args) {
|
|
|
78140
78142
|
init_cjs_shims();
|
|
78141
78143
|
var fs6 = __toESM(require("fs"), 1);
|
|
78142
78144
|
var path4 = __toESM(require("path"), 1);
|
|
78145
|
+
var import_node_child_process4 = require("child_process");
|
|
78146
|
+
function isGitTracked(projectDir, rel) {
|
|
78147
|
+
try {
|
|
78148
|
+
(0, import_node_child_process4.execFileSync)("git", ["ls-files", "--error-unmatch", "--", rel], { cwd: projectDir, stdio: "ignore" });
|
|
78149
|
+
return true;
|
|
78150
|
+
} catch {
|
|
78151
|
+
return false;
|
|
78152
|
+
}
|
|
78153
|
+
}
|
|
78154
|
+
function ensureWorkflowStateUntracked(projectDir) {
|
|
78155
|
+
const rel = ".lakebase/workflow-state.json";
|
|
78156
|
+
try {
|
|
78157
|
+
if (isGitTracked(projectDir, rel)) {
|
|
78158
|
+
(0, import_node_child_process4.execFileSync)("git", ["rm", "--cached", "--quiet", "--ignore-unmatch", "--", rel], { cwd: projectDir, stdio: "ignore" });
|
|
78159
|
+
}
|
|
78160
|
+
} catch {
|
|
78161
|
+
}
|
|
78162
|
+
try {
|
|
78163
|
+
const gitignore = path4.join(projectDir, ".gitignore");
|
|
78164
|
+
const existing = fs6.existsSync(gitignore) ? fs6.readFileSync(gitignore, "utf8") : "";
|
|
78165
|
+
if (!existing.split("\n").some((l) => l.trim() === rel)) {
|
|
78166
|
+
const sep = existing === "" || existing.endsWith("\n") ? "" : "\n";
|
|
78167
|
+
fs6.appendFileSync(
|
|
78168
|
+
gitignore,
|
|
78169
|
+
`${sep}# Runtime SCM claim state (per working tree): a branch checkout must never restore
|
|
78170
|
+
# a stale committed claim over the live one (issue #203 / Finding 28).
|
|
78171
|
+
${rel}
|
|
78172
|
+
`
|
|
78173
|
+
);
|
|
78174
|
+
}
|
|
78175
|
+
} catch {
|
|
78176
|
+
}
|
|
78177
|
+
}
|
|
78143
78178
|
var SCM_STATES = [
|
|
78144
78179
|
"scaffold-complete",
|
|
78145
78180
|
"feature-claimed",
|
|
@@ -78186,6 +78221,7 @@ function writeWorkflowState(projectDir, state) {
|
|
|
78186
78221
|
throw new Error(`Refusing to write invalid SCM state:
|
|
78187
78222
|
${summary}`);
|
|
78188
78223
|
}
|
|
78224
|
+
ensureWorkflowStateUntracked(projectDir);
|
|
78189
78225
|
const dir = path4.join(projectDir, ".lakebase");
|
|
78190
78226
|
fs6.mkdirSync(dir, { recursive: true });
|
|
78191
78227
|
const target = stateFilePath(projectDir);
|
|
@@ -226,7 +226,9 @@ function resolveProfile(opts) {
|
|
|
226
226
|
function buildInvocation(args, opts) {
|
|
227
227
|
const base = opts.env ?? process.env;
|
|
228
228
|
const trimmedHost = effectiveHost(opts)?.replace(/\/+$/, "");
|
|
229
|
-
const env =
|
|
229
|
+
const env = { ...base };
|
|
230
|
+
if (trimmedHost) env.DATABRICKS_HOST = trimmedHost;
|
|
231
|
+
delete env.DATABRICKS_WORKSPACE_ID;
|
|
230
232
|
const profile = resolveProfile(opts);
|
|
231
233
|
const argv = profile && !opts.noProfile && !args.includes("--profile") ? [...args, "--profile", profile] : args;
|
|
232
234
|
return { argv, env, profile };
|
|
@@ -545,6 +547,39 @@ async function deletePairedBranch(args) {
|
|
|
545
547
|
// scripts/lakebase/scm-workflow-state.ts
|
|
546
548
|
import * as fs5 from "fs";
|
|
547
549
|
import * as path4 from "path";
|
|
550
|
+
import { execFileSync as execFileSync4 } from "child_process";
|
|
551
|
+
function isGitTracked(projectDir, rel) {
|
|
552
|
+
try {
|
|
553
|
+
execFileSync4("git", ["ls-files", "--error-unmatch", "--", rel], { cwd: projectDir, stdio: "ignore" });
|
|
554
|
+
return true;
|
|
555
|
+
} catch {
|
|
556
|
+
return false;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
function ensureWorkflowStateUntracked(projectDir) {
|
|
560
|
+
const rel = ".lakebase/workflow-state.json";
|
|
561
|
+
try {
|
|
562
|
+
if (isGitTracked(projectDir, rel)) {
|
|
563
|
+
execFileSync4("git", ["rm", "--cached", "--quiet", "--ignore-unmatch", "--", rel], { cwd: projectDir, stdio: "ignore" });
|
|
564
|
+
}
|
|
565
|
+
} catch {
|
|
566
|
+
}
|
|
567
|
+
try {
|
|
568
|
+
const gitignore = path4.join(projectDir, ".gitignore");
|
|
569
|
+
const existing = fs5.existsSync(gitignore) ? fs5.readFileSync(gitignore, "utf8") : "";
|
|
570
|
+
if (!existing.split("\n").some((l) => l.trim() === rel)) {
|
|
571
|
+
const sep = existing === "" || existing.endsWith("\n") ? "" : "\n";
|
|
572
|
+
fs5.appendFileSync(
|
|
573
|
+
gitignore,
|
|
574
|
+
`${sep}# Runtime SCM claim state (per working tree): a branch checkout must never restore
|
|
575
|
+
# a stale committed claim over the live one (issue #203 / Finding 28).
|
|
576
|
+
${rel}
|
|
577
|
+
`
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
} catch {
|
|
581
|
+
}
|
|
582
|
+
}
|
|
548
583
|
var SCM_STATES = [
|
|
549
584
|
"scaffold-complete",
|
|
550
585
|
"feature-claimed",
|
|
@@ -591,6 +626,7 @@ function writeWorkflowState(projectDir, state) {
|
|
|
591
626
|
throw new Error(`Refusing to write invalid SCM state:
|
|
592
627
|
${summary}`);
|
|
593
628
|
}
|
|
629
|
+
ensureWorkflowStateUntracked(projectDir);
|
|
594
630
|
const dir = path4.join(projectDir, ".lakebase");
|
|
595
631
|
fs5.mkdirSync(dir, { recursive: true });
|
|
596
632
|
const target = stateFilePath(projectDir);
|
|
@@ -258,7 +258,9 @@ function resolveProfile(opts) {
|
|
|
258
258
|
function buildInvocation(args, opts) {
|
|
259
259
|
const base = opts.env ?? process.env;
|
|
260
260
|
const trimmedHost = effectiveHost(opts)?.replace(/\/+$/, "");
|
|
261
|
-
const env =
|
|
261
|
+
const env = { ...base };
|
|
262
|
+
if (trimmedHost) env.DATABRICKS_HOST = trimmedHost;
|
|
263
|
+
delete env.DATABRICKS_WORKSPACE_ID;
|
|
262
264
|
const profile = resolveProfile(opts);
|
|
263
265
|
const argv = profile && !opts.noProfile && !args.includes("--profile") ? [...args, "--profile", profile] : args;
|
|
264
266
|
return { argv, env, profile };
|
|
@@ -445,6 +447,39 @@ function dbcli(args, host) {
|
|
|
445
447
|
// scripts/lakebase/scm-workflow-state.ts
|
|
446
448
|
var fs3 = __toESM(require("fs"), 1);
|
|
447
449
|
var path2 = __toESM(require("path"), 1);
|
|
450
|
+
var import_node_child_process3 = require("child_process");
|
|
451
|
+
function isGitTracked(projectDir, rel) {
|
|
452
|
+
try {
|
|
453
|
+
(0, import_node_child_process3.execFileSync)("git", ["ls-files", "--error-unmatch", "--", rel], { cwd: projectDir, stdio: "ignore" });
|
|
454
|
+
return true;
|
|
455
|
+
} catch {
|
|
456
|
+
return false;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
function ensureWorkflowStateUntracked(projectDir) {
|
|
460
|
+
const rel = ".lakebase/workflow-state.json";
|
|
461
|
+
try {
|
|
462
|
+
if (isGitTracked(projectDir, rel)) {
|
|
463
|
+
(0, import_node_child_process3.execFileSync)("git", ["rm", "--cached", "--quiet", "--ignore-unmatch", "--", rel], { cwd: projectDir, stdio: "ignore" });
|
|
464
|
+
}
|
|
465
|
+
} catch {
|
|
466
|
+
}
|
|
467
|
+
try {
|
|
468
|
+
const gitignore = path2.join(projectDir, ".gitignore");
|
|
469
|
+
const existing = fs3.existsSync(gitignore) ? fs3.readFileSync(gitignore, "utf8") : "";
|
|
470
|
+
if (!existing.split("\n").some((l) => l.trim() === rel)) {
|
|
471
|
+
const sep = existing === "" || existing.endsWith("\n") ? "" : "\n";
|
|
472
|
+
fs3.appendFileSync(
|
|
473
|
+
gitignore,
|
|
474
|
+
`${sep}# Runtime SCM claim state (per working tree): a branch checkout must never restore
|
|
475
|
+
# a stale committed claim over the live one (issue #203 / Finding 28).
|
|
476
|
+
${rel}
|
|
477
|
+
`
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
} catch {
|
|
481
|
+
}
|
|
482
|
+
}
|
|
448
483
|
var SCM_STATES = [
|
|
449
484
|
"scaffold-complete",
|
|
450
485
|
"feature-claimed",
|
|
@@ -491,6 +526,7 @@ function writeWorkflowState(projectDir, state) {
|
|
|
491
526
|
throw new Error(`Refusing to write invalid SCM state:
|
|
492
527
|
${summary}`);
|
|
493
528
|
}
|
|
529
|
+
ensureWorkflowStateUntracked(projectDir);
|
|
494
530
|
const dir = path2.join(projectDir, ".lakebase");
|
|
495
531
|
fs3.mkdirSync(dir, { recursive: true });
|
|
496
532
|
const target = stateFilePath(projectDir);
|