rusackas opened a new pull request, #41070: URL: https://github.com/apache/superset/pull/41070
### SUMMARY The docs deploy-preview build is gated by an `ignore` command in `docs/netlify.toml`, but it has **never been skipping for PRs** — every pull request builds the docs preview whether or not it touches docs, wasting Netlify compute. Evidence from the Netlify API (last 25 deploys of `superset-docs-preview`): | context | skipped? | |---|---| | deploy-preview (PRs) | **0 of 17 skipped** | | production (master) | skips correctly | (The "Deploy Preview canceled" status some PRs show is a `state: error` build that ran then errored/was superseded — *not* a skip.) **Cause:** the production path uses `$CACHED_COMMIT_REF` and works. The deploy-preview path referenced `$COMMIT_REF` (the PR head SHA), but Netlify checks out a **merge commit** for previews, so `$COMMIT_REF` is frequently unresolvable in the clone, and `git merge-base` can also fail on the shallow clone — so the command fell through to a build on every PR. **Fix:** diff the checked-out `HEAD` against its merge-base with `master`, deepening the shallow clone until the merge-base resolves, and fail safe (build) only when it genuinely can't be determined. ### TESTING INSTRUCTIONS Validated locally against real branches: - a non-docs branch → `git diff --quiet <merge-base> HEAD -- docs/ README.md` returns 0 → **skip** ✅ - a docs-touching branch → returns non-zero → **build** ✅ Note: this PR itself changes `docs/netlify.toml` (under `docs/`), so its *own* preview will correctly build. The skip behavior takes effect for subsequent non-docs PRs; it can be confirmed by watching that non-docs PRs start showing skipped deploys after this merges. ### ADDITIONAL INFORMATION - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
