@databricks-solutions/lakebase-scm-utils 0.2.42 → 0.2.44

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 (66) hide show
  1. package/dist/scripts/github/index.cjs +21 -4
  2. package/dist/scripts/github/index.js +21 -4
  3. package/dist/scripts/github/pr.cli.cjs +21 -4
  4. package/dist/scripts/github/pr.cli.js +21 -4
  5. package/dist/scripts/index.cjs +58 -10
  6. package/dist/scripts/index.d.cts +1 -1
  7. package/dist/scripts/index.d.ts +1 -1
  8. package/dist/scripts/index.js +57 -10
  9. package/dist/scripts/lakebase/branch.cli.cjs +21 -4
  10. package/dist/scripts/lakebase/branch.cli.js +21 -4
  11. package/dist/scripts/lakebase/ci-app-endpoint.cli.cjs +21 -4
  12. package/dist/scripts/lakebase/ci-app-endpoint.cli.js +21 -4
  13. package/dist/scripts/lakebase/ci-resolve-branch.cli.cjs +23 -6
  14. package/dist/scripts/lakebase/ci-resolve-branch.cli.js +23 -6
  15. package/dist/scripts/lakebase/collapse-heads.cli.cjs +23 -6
  16. package/dist/scripts/lakebase/collapse-heads.cli.js +23 -6
  17. package/dist/scripts/lakebase/cut-backup.cli.cjs +21 -4
  18. package/dist/scripts/lakebase/cut-backup.cli.js +21 -4
  19. package/dist/scripts/lakebase/cut-tier.cli.cjs +21 -4
  20. package/dist/scripts/lakebase/cut-tier.cli.js +21 -4
  21. package/dist/scripts/lakebase/detect-language.cli.cjs +23 -6
  22. package/dist/scripts/lakebase/detect-language.cli.js +23 -6
  23. package/dist/scripts/lakebase/doctor.cli.cjs +23 -6
  24. package/dist/scripts/lakebase/doctor.cli.js +23 -6
  25. package/dist/scripts/lakebase/get-connection.cli.cjs +23 -6
  26. package/dist/scripts/lakebase/get-connection.cli.js +23 -6
  27. package/dist/scripts/lakebase/index.cjs +58 -10
  28. package/dist/scripts/lakebase/index.d.cts +17 -1
  29. package/dist/scripts/lakebase/index.d.ts +17 -1
  30. package/dist/scripts/lakebase/index.js +57 -10
  31. package/dist/scripts/lakebase/infra-runner.cli.cjs +23 -6
  32. package/dist/scripts/lakebase/infra-runner.cli.js +23 -6
  33. package/dist/scripts/lakebase/new-migration.cli.cjs +23 -6
  34. package/dist/scripts/lakebase/new-migration.cli.js +23 -6
  35. package/dist/scripts/lakebase/schema-diff.cli.cjs +23 -6
  36. package/dist/scripts/lakebase/schema-diff.cli.js +23 -6
  37. package/dist/scripts/lakebase/schema-migrate.cli.cjs +23 -6
  38. package/dist/scripts/lakebase/schema-migrate.cli.js +23 -6
  39. package/dist/scripts/lakebase/scm-abandon-feature.cli.cjs +21 -4
  40. package/dist/scripts/lakebase/scm-abandon-feature.cli.js +21 -4
  41. package/dist/scripts/lakebase/scm-adopt-state.cli.cjs +21 -4
  42. package/dist/scripts/lakebase/scm-adopt-state.cli.js +21 -4
  43. package/dist/scripts/lakebase/scm-claim-feature.cli.cjs +23 -6
  44. package/dist/scripts/lakebase/scm-claim-feature.cli.js +23 -6
  45. package/dist/scripts/lakebase/scm-cleanup.cli.cjs +21 -4
  46. package/dist/scripts/lakebase/scm-cleanup.cli.js +21 -4
  47. package/dist/scripts/lakebase/scm-doctor.cli.cjs +23 -6
  48. package/dist/scripts/lakebase/scm-doctor.cli.js +23 -6
  49. package/dist/scripts/lakebase/scm-merge.cli.cjs +39 -6
  50. package/dist/scripts/lakebase/scm-merge.cli.js +39 -6
  51. package/dist/scripts/lakebase/scm-reconcile-tier.cli.cjs +23 -6
  52. package/dist/scripts/lakebase/scm-reconcile-tier.cli.js +23 -6
  53. package/dist/scripts/lakebase/scm-recover-orphans.cli.cjs +21 -4
  54. package/dist/scripts/lakebase/scm-recover-orphans.cli.js +21 -4
  55. package/dist/scripts/util/index.cjs +23 -6
  56. package/dist/scripts/util/index.js +23 -6
  57. package/package.json +1 -1
  58. package/scripts/lakebase/databricks-cli.ts +44 -4
  59. package/scripts/lakebase/runner-setup.ts +18 -2
  60. package/scripts/lakebase/scm-merge.ts +36 -0
  61. package/scripts/lakebase/secret-auth.ts +9 -2
  62. package/templates/project/common/.github/workflows/merge.yml +17 -6
  63. package/templates/project/common/.github/workflows/pr.yml +17 -6
  64. package/templates/project/common/scripts/run-tests.sh +10 -0
  65. package/templates/project/python/tests/__pycache__/conftest.cpython-314.pyc +0 -0
  66. package/templates/project/python/tests/conftest.py +10 -3
@@ -33,14 +33,25 @@ jobs:
33
33
  SCM_UTILS_REF="$(tr -d '[:space:]' < .lakebase/scm-utils-ref 2>/dev/null || true)"
34
34
  SCM_UTILS_REF="${SCM_UTILS_REF:-v{{LAKEBASE_SCM_UTILS_VERSION}}}"
35
35
  echo "SCM_UTILS_REF=${SCM_UTILS_REF}" >> "$GITHUB_ENV"
36
- # Registry-first: version-tag refs install the published tarball from the
37
- # npm registry (seconds); branch/SHA refs keep the GitHub source form
38
- # (their only source).
36
+ # Registry-first for version tags, with a GitHub fallback when the registry
37
+ # cannot serve the tarball yet: a freshly-published version is blocked by
38
+ # the proxy's same-day security screen for ~24h (a staging merge then fails
39
+ # on npx ETARGET), and a branch/SHA ref only ever has GitHub. Probe the
40
+ # tarball URL once and pick the source that actually serves it, so a
41
+ # same-day publish never stalls CI.
42
+ SPEC=""
39
43
  case "$SCM_UTILS_REF" in
40
- v[0-9]*) echo "SCM_UTILS_NPX_PKG=@databricks-solutions/lakebase-scm-utils@${SCM_UTILS_REF#v}" >> "$GITHUB_ENV" ;;
41
- [0-9]*) echo "SCM_UTILS_NPX_PKG=@databricks-solutions/lakebase-scm-utils@${SCM_UTILS_REF}" >> "$GITHUB_ENV" ;;
42
- *) echo "SCM_UTILS_NPX_PKG=github:databricks-solutions/lakebase-scm-utils#${SCM_UTILS_REF}" >> "$GITHUB_ENV" ;;
44
+ v[0-9]*|[0-9]*) SPEC="@databricks-solutions/lakebase-scm-utils@${SCM_UTILS_REF#v}" ;;
43
45
  esac
46
+ if [ -n "$SPEC" ]; then
47
+ TARBALL_URL="$(npm view "${SPEC}" dist.tarball 2>/dev/null || true)"
48
+ if [ -z "$TARBALL_URL" ] || ! curl -fsSI --max-time 15 "$TARBALL_URL" >/dev/null 2>&1; then
49
+ echo "resolve-substrate: registry cannot serve ${SPEC} yet (same-day publish screen); falling back to GitHub."
50
+ SPEC=""
51
+ fi
52
+ fi
53
+ [ -z "$SPEC" ] && SPEC="github:databricks-solutions/lakebase-scm-utils#${SCM_UTILS_REF}"
54
+ echo "SCM_UTILS_NPX_PKG=${SPEC}" >> "$GITHUB_ENV"
44
55
 
45
56
  - name: Detect project language
46
57
  id: detect-lang
@@ -176,6 +176,16 @@ if [ "$#" -eq 0 ] && [ -f "$REPO_ROOT/client/package.json" ]; then
176
176
  ( cd "$REPO_ROOT/client" && npm install --include=dev )
177
177
  fi
178
178
  fi
179
+ # Strict typecheck BEFORE the tests, matching CI. CI builds the client with
180
+ # `tsc --noEmit && vite build` (strict), but the local test lanes run vitest +
181
+ # Playwright against the Vite dev server, which does NOT strict-typecheck the whole
182
+ # app — so a cross-story type regression (a later story making a field REQUIRED,
183
+ # breaking an earlier story's construction of that type) passed the local honest-GREEN
184
+ # + deploy feature-verify and was caught ONLY by CI, after promote. Run the SAME strict
185
+ # typecheck here so local GREEN matches CI. `--if-present` no-ops on an older scaffold
186
+ # with no `typecheck` script; a type error fails the run (set -e), exactly like a test.
187
+ echo "Running client strict typecheck (tsc --noEmit, matching CI's build)..."
188
+ ( cd "$REPO_ROOT/client" && npm run typecheck --if-present )
179
189
  echo "Running client unit tests (Vitest)..."
180
190
  ( cd "$REPO_ROOT/client" && npm test )
181
191
  fi
@@ -41,9 +41,16 @@ def _restore_migration_head_after_each_test():
41
41
 
42
42
  from alembic import command
43
43
  from alembic.config import Config
44
+ from alembic.util.exc import CommandError
45
+ from sqlalchemy.exc import OperationalError
44
46
 
45
47
  ini = str(Path(__file__).resolve().parent.parent / "alembic.ini")
46
48
  command.upgrade(Config(ini), "head")
47
- except Exception:
48
- # Best-effort isolation; never fail a test on teardown restoration.
49
- pass
49
+ except (CommandError, OperationalError) as exc:
50
+ # Best-effort isolation, but never SILENT and never an umbrella swallow:
51
+ # surface a restore failure instead of hiding it (a broken migration must
52
+ # be visible, not masked as routine teardown noise). CommandError wraps
53
+ # alembic's own failures; OperationalError covers DBAPI/connection errors.
54
+ # Everything else (a real schema error) propagates and fails loudly, which
55
+ # is the correct behavior for a genuinely broken restore.
56
+ print(f"WARNING: migration-head restore failed during teardown: {exc}")