Skip to content

Commit cf73241

Browse files
Merge remote-tracking branch 'origin/main' into interpolation-parser-pr1
# Conflicts: # bundle/phases/initialize.go # libs/dyn/dynvar/resolve.go
2 parents 033b1a2 + f0edaa4 commit cf73241

2,499 files changed

Lines changed: 62479 additions & 18769 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Review if the agent instructions (`.agent/`, `.claude/`, `.cursor/`) are still up to date and correct.
2+
3+
- Paths might need to be updated if files have been moved.
4+
- There might be drift (e.g. missing symlinks for rules)
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
description: Rules for how to deal with auto-generated files
3+
globs:
4+
- ".codegen/openapi.json"
5+
- ".gitattributes"
6+
- "acceptance/**/out*"
7+
- "acceptance/**/output.txt"
8+
- "acceptance/**/output.*.txt"
9+
- "acceptance/**/output/**"
10+
- "cmd/account/*.go"
11+
- "cmd/account/**/*.go"
12+
- "cmd/workspace/*.go"
13+
- "cmd/workspace/**/*.go"
14+
- "internal/genkit/tagging.py"
15+
- "internal/mocks/**/*.go"
16+
- "bundle/direct/dresources/*.generated.yml"
17+
- "bundle/docsgen/output/**/*.md"
18+
- "bundle/internal/schema/annotations_openapi.yml"
19+
- "bundle/internal/validation/generated/*.go"
20+
- "bundle/schema/jsonschema.json"
21+
- "bundle/schema/jsonschema_for_docs.json"
22+
- "python/databricks/bundles/version.py"
23+
- "python/databricks/bundles/*/__init__.py"
24+
- "python/databricks/bundles/*/_models/*.py"
25+
paths:
26+
- ".codegen/openapi.json"
27+
- ".gitattributes"
28+
- "acceptance/**/out*"
29+
- "acceptance/**/output.txt"
30+
- "acceptance/**/output.*.txt"
31+
- "acceptance/**/output/**"
32+
- "cmd/account/*.go"
33+
- "cmd/account/**/*.go"
34+
- "cmd/workspace/*.go"
35+
- "cmd/workspace/**/*.go"
36+
- "internal/genkit/tagging.py"
37+
- "internal/mocks/**/*.go"
38+
- "bundle/direct/dresources/*.generated.yml"
39+
- "bundle/docsgen/output/**/*.md"
40+
- "bundle/internal/schema/annotations_openapi.yml"
41+
- "bundle/internal/validation/generated/*.go"
42+
- "bundle/schema/jsonschema.json"
43+
- "bundle/schema/jsonschema_for_docs.json"
44+
- "python/databricks/bundles/version.py"
45+
- "python/databricks/bundles/*/__init__.py"
46+
- "python/databricks/bundles/*/_models/*.py"
47+
---
48+
49+
# Rules for how to deal with auto-generated files
50+
51+
## Identification
52+
53+
Files matching this rule's glob pattern are most likely generated artifacts. Auto-generated files generally have a comment (when the file type allows it) at or near the top indicating they are generated, or their name or path signals it. You may also consult the Makefile as a starting point to determine if a file is auto-generated.
54+
55+
## Rules
56+
57+
**RULE: Do not manually edit auto-generated files.**
58+
59+
**RULE: To change a generated file, edit the source and regenerate.**
60+
61+
1. Find the source logic, template, or annotation that drives the file.
62+
2. Run the appropriate generator or update command.
63+
3. Commit both the source change (if any) and the regenerated outputs.
64+
65+
### Core generation commands
66+
67+
- Everything, in one shot:
68+
- `./task generate` — aggregator that runs all generators below
69+
- OpenAPI SDK/CLI command stubs and related generated artifacts:
70+
- `./task generate-genkit`
71+
- Includes generated `cmd/account/**`, `cmd/workspace/**`, `.gitattributes`, `internal/genkit/tagging.py`.
72+
- Direct engine generated YAML:
73+
- `./task generate-direct` (or `./task generate-direct-apitypes`, `./task generate-direct-resources`)
74+
- Bundle schemas:
75+
- `./task generate-schema`
76+
- `./task generate-schema-docs`
77+
- This can also refresh `bundle/internal/schema/annotations_openapi.yml` when OpenAPI annotation extraction is enabled.
78+
- Bundle docs:
79+
- `./task generate-docs`
80+
- Validation generated code:
81+
- `./task generate-validation`
82+
- Mock files:
83+
- `go run github.com/vektra/mockery/v2@b9df18e0f7b94f0bc11af3f379c8a9aea1e1e8da`
84+
- Python bundle codegen:
85+
- `./task pydabs-codegen`
86+
87+
### Acceptance and test generated outputs
88+
89+
**RULE: Do not hand-edit acceptance outputs.** Exception: rare, intentional mass replacement when explicitly justified by repo guidance.
90+
91+
Regeneration commands:
92+
93+
- `./task test-update`
94+
- `./task test-update-templates` (templates only)
95+
96+
Typical generated files:
97+
98+
- `acceptance/**/out*`
99+
- `acceptance/**/output.txt`
100+
- `acceptance/**/output.*.txt`
101+
- `acceptance/**/output/**` (materialized template output trees)
102+
103+
**RULE: When touching acceptance sources, regenerate outputs instead of editing generated files.** Sources include `databricks.yml`, scripts, templates, and test config.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
---
2+
description: Databricks template schema file reference template and guidance
3+
globs: **/databricks_template_schema.json
4+
paths:
5+
- "**/databricks_template_schema.json"
6+
---
7+
8+
# Databricks template schema file reference template and guidance
9+
10+
A `databricks_template_schema.json` file is used to configure bundle templates.
11+
12+
## Reference template
13+
14+
Below is a good reference template:
15+
16+
```json
17+
{
18+
"welcome_message": "\nWelcome to the dbt template for Declarative Automation Bundles!\n\nA workspace was selected based on your current profile. For information about how to change this, see https://docs.databricks.com/dev-tools/cli/profiles.html.\nworkspace_host: {{workspace_host}}",
19+
"properties": {
20+
"project_name": {
21+
"type": "string",
22+
"pattern": "^[A-Za-z_][A-Za-z0-9-_]+$",
23+
"pattern_match_failure_message": "Name must consist of letters, numbers, dashes, and underscores.",
24+
"default": "dbt_project",
25+
"description": "\nPlease provide a unique name for this project.\nproject_name",
26+
"order": 1
27+
},
28+
"http_path": {
29+
"type": "string",
30+
"pattern": "^/sql/.\\../warehouses/[a-z0-9]+$",
31+
"pattern_match_failure_message": "Path must be of the form /sql/1.0/warehouses/<warehouse id>",
32+
"description": "\nPlease provide the HTTP Path of the SQL warehouse you would like to use with dbt during development.\nYou can find this path by clicking on \"Connection details\" for your SQL warehouse.\nhttp_path [example: /sql/1.0/warehouses/abcdef1234567890]",
33+
"order": 2
34+
},
35+
"default_catalog": {
36+
"type": "string",
37+
"default": "{{default_catalog}}",
38+
"pattern": "^\\w*$",
39+
"pattern_match_failure_message": "Invalid catalog name.",
40+
"description": "\nPlease provide an initial catalog{{if eq (default_catalog) \"\"}} (leave blank when not using Unity Catalog){{end}}.\ndefault_catalog",
41+
"order": 3
42+
},
43+
"personal_schemas": {
44+
"type": "string",
45+
"description": "\nWould you like to use a personal schema for each user working on this project? (e.g., 'catalog.{{short_name}}')\npersonal_schemas",
46+
"enum": [
47+
"yes, use a schema based on the current user name during development",
48+
"no, use a shared schema during development"
49+
],
50+
"order": 4
51+
},
52+
"shared_schema": {
53+
"skip_prompt_if": {
54+
"properties": {
55+
"personal_schemas": {
56+
"const": "yes, use a schema based on the current user name during development"
57+
}
58+
}
59+
},
60+
"type": "string",
61+
"default": "default",
62+
"pattern": "^\\w+$",
63+
"pattern_match_failure_message": "Invalid schema name.",
64+
"description": "\nPlease provide an initial schema during development.\ndefault_schema",
65+
"order": 5
66+
}
67+
},
68+
"success_message": "\n📊 Your new project has been created in the '{{.project_name}}' directory!\nIf you already have dbt installed, just type 'cd {{.project_name}}; dbt init' to get started.\nRefer to the README.md file for full \"getting started\" guide and pduction setup instructions.\n"
69+
}
70+
```
71+
72+
### Explanations
73+
74+
Notice that:
75+
- The welcome message has the template name.
76+
- By convention, property messages include the property name after a newline, e.g. `default_catalog` above has a description that says `"\nPlease provide an initial catalog [...].\ndefault_catalog"`,
77+
- Each property defines a variable that is used for the template.
78+
- Each property has a unique 'order' value that increments by 1 with each property.
79+
- Enums use `"type": "string"` and have an `enum` field with a list of possible values.
80+
- Helpers such as `{{default_catalog}}` and `{{short_name}}` can be used within property descriptors.
81+
- Properties can be referenced in messages and descriptions using `{{.property_name}}`. `{{.project_name}}` is an example.

.agent/rules/dresources.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
description: Rules for implementing resources in bundle/direct/dresources
3+
globs: bundle/direct/dresources/**/*.go
4+
paths:
5+
- "bundle/direct/dresources/**/*.go"
6+
---
7+
8+
**RULE: Before implementing or modifying a resource, read `bundle/direct/dresources/README.md`.** It covers constraints, field classification, update mask rules, async patterns, testing requirements, and state compatibility.

0 commit comments

Comments
 (0)