Mark PyDABs generated files as auto-generated - #6394
Merged
Conversation
Collaborator
Integration test reportCommit: 660d03d
Top 3 slowest tests (at least 2 minutes):
|
janniklasrose
approved these changes
Aug 27, 2026
The PyDABs codegen writes databricks/bundles/<ns>/_models/*.py and each namespace __init__.py, but those files carried no generated-file marker. - Prepend a "# Code generated by pydabs-codegen. DO NOT EDIT." header in both writer paths (_write_code, _write_exports) and regenerate. - Add a nested python/databricks/bundles/.gitattributes marking the generated _models trees and namespace __init__.py files as linguist-generated (core/ and resources/ stay hand-written). Addresses review comments on #6335. Co-authored-by: Isaac <no-reply@databricks.com>
Match all namespace __init__.py files and unset the hand-written core one, instead of listing each generated namespace. New resource namespaces are then marked automatically without touching .gitattributes. Co-authored-by: Isaac <no-reply@databricks.com>
Sankalp-Mittal
force-pushed
the
sankalp-mittal/pydabs-mark-generated-files
branch
from
August 28, 2026 12:30
8290083 to
660d03d
Compare
Base automatically changed from
sankalp-mittal/automate-pybads-resources
to
main
August 28, 2026 12:57
hejcman-enverus
pushed a commit
to hejcman-enverus/databricks_cli
that referenced
this pull request
Sep 3, 2026
## Changes - Update `tools/validate_nextchanges.py` to be more opinionated: - Leading bullet `*` required - All `databricks#123` numbers are expanded github links (issues and PRs) - Ends in a bullet and has trailing PR in parentheses. - Trailing PR link is skipped if no PR is associated to the branch/commit (e.g. while locally developing) - Remove `tools/update_github_links.py` and have all link validation be done in `tools/validate_nextchanges.py` - `.github/workflows/changelog-preview.yml` workflow (runs on PRs and pushes to main) does strict validation on the PR being added to new fragments ## Why We've been skipping PR numbers/links for a few releases. This enforces it. ## Tests Added 4 test.md files (see https://github.com/databricks/cli/tree/99d5458b3248482f21e2b5f12568bbd8d74d6c44/.nextchanges/cli) Workflow validation of test files added to this PR: ``` /home/runner/work/cli/cli/.nextchanges/cli/test1.md: must start with a "* " bullet marker /home/runner/work/cli/cli/.nextchanges/cli/test2.md: unexpanded reference databricks#123: write it as a markdown link, e.g. [databricks#123](databricks#123) /home/runner/work/cli/cli/.nextchanges/cli/test3.md: trailing PR link databricks#6394 must include the PR that added this fragment (databricks#6395) ``` When fixing the PR attribution in test3.md to 6395 locally and running `task changelog-preview` it passes (because locally the test calls `gh` and associates the branch to an open PR). If running locally before opening a PR (or quickly renaming branch) the test passes since we don't enforce PR link logic there. Valid entries look like this (`task changelog-preview`): ``` ## Release v1.15.0 (2026-08-27) ### CLI * This is an entry. ([databricks#6395](databricks#6395)) * This is another entry. This feature was developed in a stack of PRs. ([databricks#6394](databricks#6394), [databricks#6395](databricks#6395)) ``` --------- Co-authored-by: Isaac <no-reply@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #6393.
The PyDABs codegen (
python/codegen) writesdatabricks/bundles/<ns>/_models/*.pyand each namespace__init__.py, but those files carried no generated-file marker. This addresses review comments on #6335 asking to mark generated files as such.Changes
# Code generated by pydabs-codegen. DO NOT EDIT.in both writer paths (_write_code,_write_exports) inpython/codegen/codegen/main.py, then regenerate. The regeneration diff is exactly the header (+2 lines per file) — nothing else moves..gitattributes: add a nestedpython/databricks/bundles/.gitattributesmarking the generated_modelstrees and the six generated namespace__init__.pyfiles (alerts, catalogs, jobs, pipelines, schemas, volumes) aslinguist-generated.core/andresources/are hand-written and stay unmarked.Verification
git check-attrconfirms generated files are marked, hand-written files are not.codegen_tests: 8 passed;pydabs-test: 220 passed.ruff format+checkclean onmain.py.This pull request and its description were written by Isaac.