@databricks-solutions/lakebase-scm-utils 0.2.48 → 0.2.49

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.
Files changed (51) hide show
  1. package/dist/ci-secrets-CnGrdQV-.d.cts +84 -0
  2. package/dist/ci-secrets-CnGrdQV-.d.ts +84 -0
  3. package/dist/scripts/index.cjs +2177 -2052
  4. package/dist/scripts/index.d.cts +2 -1
  5. package/dist/scripts/index.d.ts +2 -1
  6. package/dist/scripts/index.js +253 -134
  7. package/dist/scripts/lakebase/ci-resolve-branch.cli.cjs +2 -2
  8. package/dist/scripts/lakebase/ci-resolve-branch.cli.js +2 -2
  9. package/dist/scripts/lakebase/collapse-heads.cli.cjs +2 -2
  10. package/dist/scripts/lakebase/collapse-heads.cli.js +2 -2
  11. package/dist/scripts/lakebase/detect-language.cli.cjs +2 -2
  12. package/dist/scripts/lakebase/detect-language.cli.js +2 -2
  13. package/dist/scripts/lakebase/doctor.cli.cjs +2 -2
  14. package/dist/scripts/lakebase/doctor.cli.js +2 -2
  15. package/dist/scripts/lakebase/get-connection.cli.cjs +2 -2
  16. package/dist/scripts/lakebase/get-connection.cli.js +2 -2
  17. package/dist/scripts/lakebase/index.cjs +2163 -2050
  18. package/dist/scripts/lakebase/index.d.cts +8 -0
  19. package/dist/scripts/lakebase/index.d.ts +8 -0
  20. package/dist/scripts/lakebase/index.js +243 -130
  21. package/dist/scripts/lakebase/infra-runner.cli.cjs +2 -2
  22. package/dist/scripts/lakebase/infra-runner.cli.js +2 -2
  23. package/dist/scripts/lakebase/new-migration.cli.cjs +2 -2
  24. package/dist/scripts/lakebase/new-migration.cli.js +2 -2
  25. package/dist/scripts/lakebase/schema-diff.cli.cjs +2 -2
  26. package/dist/scripts/lakebase/schema-diff.cli.js +2 -2
  27. package/dist/scripts/lakebase/schema-migrate.cli.cjs +2 -2
  28. package/dist/scripts/lakebase/schema-migrate.cli.js +2 -2
  29. package/dist/scripts/lakebase/scm-claim-feature.cli.cjs +2 -2
  30. package/dist/scripts/lakebase/scm-claim-feature.cli.js +2 -2
  31. package/dist/scripts/lakebase/scm-doctor.cli.cjs +2 -2
  32. package/dist/scripts/lakebase/scm-doctor.cli.js +2 -2
  33. package/dist/scripts/lakebase/scm-merge.cli.cjs +2216 -1994
  34. package/dist/scripts/lakebase/scm-merge.cli.js +296 -74
  35. package/dist/scripts/lakebase/scm-prepare-pr.cli.cjs +479 -86
  36. package/dist/scripts/lakebase/scm-prepare-pr.cli.js +479 -86
  37. package/dist/scripts/lakebase/scm-reconcile-tier.cli.cjs +2 -2
  38. package/dist/scripts/lakebase/scm-reconcile-tier.cli.js +2 -2
  39. package/dist/scripts/lakebase/sync-ci-secrets.cli.cjs +56 -30
  40. package/dist/scripts/lakebase/sync-ci-secrets.cli.js +56 -30
  41. package/dist/scripts/util/index.cjs +142 -25
  42. package/dist/scripts/util/index.d.cts +2 -27
  43. package/dist/scripts/util/index.d.ts +2 -27
  44. package/dist/scripts/util/index.js +136 -25
  45. package/package.json +1 -1
  46. package/scripts/lakebase/create-project.ts +2 -2
  47. package/scripts/lakebase/scm-merge.ts +21 -0
  48. package/scripts/lakebase/scm-prepare-pr.ts +10 -1
  49. package/scripts/lakebase/sync-ci-secrets.cli.ts +2 -2
  50. package/scripts/util/ci-secrets.ts +212 -26
  51. package/templates/project/common/scripts/create-token-and-sync-secrets.sh +9 -86
@@ -1,5 +1,6 @@
1
1
  import { W as WorkflowRunSummary, e as PullRequestInfo, o as mergePairedPullRequest } from '../../pr-e-E4aP4j.cjs';
2
2
  import { Pool } from 'pg';
3
+ import { b as CiFreshnessResult } from '../../ci-secrets-CnGrdQV-.cjs';
3
4
 
4
5
  declare const BRAND: unique symbol;
5
6
  /**
@@ -3109,6 +3110,8 @@ interface PreparePrResult {
3109
3110
  prUrl: string;
3110
3111
  /** True iff createPullRequest was invoked (vs. reusing an existing open PR). */
3111
3112
  prCreated: boolean;
3113
+ /** Outcome of the expiry-aware CI-auth preflight run before the push (fail-soft). */
3114
+ ciFreshness: CiFreshnessResult;
3112
3115
  }
3113
3116
  declare function preparePr(args: PreparePrArgs): Promise<PreparePrResult>;
3114
3117
  /**
@@ -3284,6 +3287,11 @@ interface MergeArgs {
3284
3287
  fetchPrState?: (ownerRepo: string, headBranch: string) => Promise<{
3285
3288
  mergeableState?: string;
3286
3289
  } | undefined>;
3290
+ /** Expiry-aware CI-auth preflight run before the merge: the promote triggers merge.yml, which
3291
+ * needs a live DATABRICKS_TOKEN secret, and a merge is not a push so the pre-push hook does not
3292
+ * fire. Re-mints the canonical token when missing / near expiry. BEST-EFFORT: never blocks the
3293
+ * merge. Defaults to {@link ensureCiSecretsFreshFromEnv}; injected in tests. */
3294
+ ensureCiFresh?: (ownerRepo: string) => Promise<CiFreshnessResult>;
3287
3295
  }
3288
3296
  interface MergeResult {
3289
3297
  state: ScmWorkflowState;
@@ -1,5 +1,6 @@
1
1
  import { W as WorkflowRunSummary, e as PullRequestInfo, o as mergePairedPullRequest } from '../../pr-e-E4aP4j.js';
2
2
  import { Pool } from 'pg';
3
+ import { b as CiFreshnessResult } from '../../ci-secrets-CnGrdQV-.js';
3
4
 
4
5
  declare const BRAND: unique symbol;
5
6
  /**
@@ -3109,6 +3110,8 @@ interface PreparePrResult {
3109
3110
  prUrl: string;
3110
3111
  /** True iff createPullRequest was invoked (vs. reusing an existing open PR). */
3111
3112
  prCreated: boolean;
3113
+ /** Outcome of the expiry-aware CI-auth preflight run before the push (fail-soft). */
3114
+ ciFreshness: CiFreshnessResult;
3112
3115
  }
3113
3116
  declare function preparePr(args: PreparePrArgs): Promise<PreparePrResult>;
3114
3117
  /**
@@ -3284,6 +3287,11 @@ interface MergeArgs {
3284
3287
  fetchPrState?: (ownerRepo: string, headBranch: string) => Promise<{
3285
3288
  mergeableState?: string;
3286
3289
  } | undefined>;
3290
+ /** Expiry-aware CI-auth preflight run before the merge: the promote triggers merge.yml, which
3291
+ * needs a live DATABRICKS_TOKEN secret, and a merge is not a push so the pre-push hook does not
3292
+ * fire. Re-mints the canonical token when missing / near expiry. BEST-EFFORT: never blocks the
3293
+ * merge. Defaults to {@link ensureCiSecretsFreshFromEnv}; injected in tests. */
3294
+ ensureCiFresh?: (ownerRepo: string) => Promise<CiFreshnessResult>;
3287
3295
  }
3288
3296
  interface MergeResult {
3289
3297
  state: ScmWorkflowState;