-
Notifications
You must be signed in to change notification settings - Fork 233
Add bump-serverless-env-version skill #6419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9de3e50
Add bump-serverless-env-version skill
rugpanov b3e7cb9
Address devil's-advocate review
rugpanov b8addc9
Address multi-source review findings
rugpanov b8415a2
Address re-review findings (v2)
rugpanov 07f8cac
Fix Step 4 verify rationale (v3 review)
rugpanov 238ce2c
Tighten wording (v4 review)
rugpanov 14c6b16
Narrow Step 3 to the comments with compatibility reasoning (v5 review)
rugpanov 4bc5e84
Refine serverless environment bump skill
rugpanov ef72ef0
Address serverless bump skill review
rugpanov 5e633fd
Merge branch 'main' into bump-serverless-env-skill
rugpanov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| --- | ||
| name: bump-serverless-env-version | ||
| description: "Use when bumping or upgrading the default serverless environment version shipped by Databricks bundle templates, including its coupled Python and DB Connect pins." | ||
| user-invocable: true | ||
| allowed-tools: Read, Edit, Write, Bash, Glob, Grep, WebFetch, AskUserQuestion | ||
| --- | ||
|
|
||
| # Bump the serverless environment version | ||
|
|
||
| Read `.agents/rules/template-versions.md` first for compatibility and | ||
| synchronization policy. Never hand-edit generated acceptance output. | ||
|
|
||
| ## 1. Resolve a compatible version set | ||
|
|
||
| Use the requested environment version, or the newest published version when none | ||
| was specified. Confirm its runtime Python version from the | ||
| [environment release notes](https://docs.databricks.com/aws/en/release-notes/serverless/environment-version/) | ||
| and [databricks/environments](https://github.com/databricks/environments). | ||
|
|
||
| Apply `.agents/rules/template-versions.md` to the environment, Python, and DB | ||
| Connect pins. Check Python compatibility in the | ||
| [DB Connect requirements](https://docs.databricks.com/dev-tools/databricks-connect/python/index.html#requirements). | ||
| Advance `conservative_db_connect_version_spec` when compatibility requires it or its | ||
| DBR line has six months or less of support remaining. Use the supported-LTS table in | ||
| the [Databricks Runtime release notes](https://docs.databricks.com/aws/en/release-notes/runtime/) | ||
| to choose the oldest compatible replacement with more than six months of support remaining. | ||
| Do not advance it merely to match the environment version. | ||
|
|
||
| ## 2. Update every template source | ||
|
|
||
| Find both macro definitions and hardcoded literals; trust the search results: | ||
|
|
||
| ```bash | ||
| grep -rn 'environment_version\|environment-version\|requires-python\|default_python_version' libs/template/templates/ | ||
| ``` | ||
|
|
||
| Inspect every hit and change only values that pin a version. Re-run the command | ||
| after editing and confirm every version-bearing template hit uses the target. | ||
| If all sources and coupled pins already match the resolved set and the worktree has | ||
| no partial bump, report that no changes are needed and stop. | ||
|
|
||
| Current sources include: | ||
|
|
||
| - `serverless_environment_version` definitions in `default/library/versions.tmpl` | ||
| and `dbt-sql/library/versions.tmpl`; | ||
| - a hardcoded value in the `default-scala` job template; | ||
| - three hardcoded values in `lakeflow-integrations`, including its | ||
| `--environment-version` argument. | ||
|
|
||
| In `default/library/versions.tmpl`, update `python_version_spec` and | ||
| `default_python_version` when the runtime Python version changes. Update | ||
| `conservative_db_connect_version_spec` only under the compatibility and support rule | ||
| above. Keep the version-specific compatibility comments accurate even when their pin | ||
| is unchanged. Do not synchronize unrelated DBR or SQL-template DB Connect macros. | ||
|
|
||
| Update version-specific examples in `.agents/rules/template-versions.md` so its | ||
| policy remains accurate; do not change the policy itself as part of the bump. | ||
|
|
||
| Also inspect `defaultServerlessVersion` in `libs/localenv/envkey.go`. It is the | ||
| product-spec fallback for `databricks environments setup-local`, not a template | ||
| pin; do not infer that it should move with the templates. Change it only when the | ||
| user or current product specification also requires the fallback to move, and first | ||
| confirm `python/serverless/serverless-v{N}/pyproject.toml` exists in | ||
| `databricks/environments`. Then update default-version help, error, and test | ||
| expectations under `libs/localenv` and `cmd/environments`; verify with | ||
| `go test ./libs/localenv ./cmd/environments`, then update and verify with: | ||
|
|
||
| ```bash | ||
| go test ./acceptance -run '^TestAccept/localenv' -update -timeout=60m | ||
| go test ./acceptance -run '^TestAccept/localenv' -timeout=60m | ||
| ``` | ||
|
|
||
| Otherwise leave it unchanged and record why. Do not change the intentionally older | ||
| SSH fixtures in `acceptance/ssh/connect-serverless-*`. | ||
|
|
||
| ## 3. Regenerate and verify goldens | ||
|
|
||
| Update and verify the acceptance suite: | ||
|
|
||
| ```bash | ||
| ./task test-update | ||
| go test ./acceptance -run '^TestAccept$' -timeout=60m | ||
| ``` | ||
|
|
||
| The non-update command must pass. Update mode selects covering `EnvMatrix` variants; | ||
| the non-update run verifies every variant against the regenerated goldens. | ||
|
|
||
| ## 4. Add the changelog fragment | ||
|
|
||
| Add `.nextchanges/bundles/serverless-environment-version-v{N}.md`. Follow the | ||
| `pr-checklist` skill's changelog conventions. Describe a benefit stated in the | ||
| target version's release notes, link the actual version page, and mention the DB | ||
| Connect version only if it changed. | ||
|
|
||
| Cross-check the final source and generated-output footprint against the prior | ||
| template bumps in [PR #3897](https://github.com/databricks/cli/pull/3897) and | ||
| [PR #6378](https://github.com/databricks/cli/pull/6378). Explain material | ||
| differences in the final handoff or PR description. Prior PRs are not sources of | ||
| truth: revalidate their compatibility decisions, wording, URLs, and file lists. | ||
|
|
||
| ## 5. Finish only when requested | ||
|
|
||
| **Required sub-skill:** use `pr-checklist`, run its checks, and inspect the final | ||
| diff. If formatting or linting changes generated acceptance files, fix the source | ||
| and regenerate them. | ||
|
|
||
| Commit, push, or create/update a PR only when the user explicitly requests that | ||
| operation. When requested, follow `pr-checklist` rather than duplicating its commit | ||
| and PR-body instructions here. | ||
|
|
||
| When creating a PR for the bump, suggest `lennartkats-db` as a reviewer. | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.