Skip to content

Commit

Permalink
[Internal] Improve Changelog by grouping changes (#703)
Browse files Browse the repository at this point in the history
## Changes
Improve Changelog by grouping changes and enforce tag in PRs

## Tests
- [X] `make test` run locally
- [X] `make fmt` applied
- [ ] relevant integration tests applied
- [X] Recreate old changelog

```

## 0.30.0

### Other Changes

 * Add Windows WorkFlow ([#692](#692)).
 * Check trailing slash in host url ([#681](#681)).
 * Fix auth tests for windows. ([#697](#697)).
 * Remove duplicate ubuntu tests ([#693](#693)).
 * Support partners in SDK ([#648](#648)).
 * fix windows path ([#660](#660)) ([#673](#673)).


### API Changes:

 * Added [w.serving_endpoints_data_plane](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/serving_endpoints_data_plane.html) workspace-level service.
 * Added `deploy()` and `start()` methods for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Added `batch_get()` method for [w.consumer_listings](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/consumer_listings.html) workspace-level service.
 * Added `batch_get()` method for [w.consumer_providers](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/consumer_providers.html) workspace-level service.
 * Added `create_schedule()`, `create_subscription()`, `delete_schedule()`, `delete_subscription()`, `get_schedule()`, `get_subscription()`, `list()`, `list_schedules()`, `list_subscriptions()` and `update_schedule()` methods for [w.lakeview](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/lakeview.html) workspace-level service.
 * Added `query_next_page()` method for [w.vector_search_indexes](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/vector_search_indexes.html) workspace-level service.
 * Added `databricks.sdk.service.serving.AppDeploymentMode`, `databricks.sdk.service.serving.ModelDataPlaneInfo` and `databricks.sdk.service.serving.StartAppRequest` dataclasses.
 * Added `databricks.sdk.service.catalog.CatalogIsolationMode` and `databricks.sdk.service.catalog.ListAccountStorageCredentialsResponse` dataclasses.
 * Added `databricks.sdk.service.dashboards.CreateScheduleRequest`, `databricks.sdk.service.dashboards.CreateSubscriptionRequest`, `databricks.sdk.service.dashboards.CronSchedule`, `databricks.sdk.service.dashboards.DashboardView`, `databricks.sdk.service.dashboards.DeleteScheduleRequest`, `any`, `databricks.sdk.service.dashboards.DeleteSubscriptionRequest`, `any`, `databricks.sdk.service.dashboards.GetScheduleRequest`, `databricks.sdk.service.dashboards.GetSubscriptionRequest`, `databricks.sdk.service.dashboards.ListDashboardsRequest`, `databricks.sdk.service.dashboards.ListDashboardsResponse`, `databricks.sdk.service.dashboards.ListSchedulesRequest`, `databricks.sdk.service.dashboards.ListSchedulesResponse`, `databricks.sdk.service.dashboards.ListSubscriptionsRequest`, `databricks.sdk.service.dashboards.ListSubscriptionsResponse`, `databricks.sdk.service.dashboards.Schedule`, `databricks.sdk.service.dashboards.SchedulePauseStatus`, `databricks.sdk.service.dashboards.Subscriber`, `databricks.sdk.service.dashboards.Subscription`, `databricks.sdk.service.dashboards.SubscriptionSubscriberDestination`, `databricks.sdk.service.dashboards.SubscriptionSubscriberUser` and `databricks.sdk.service.dashboards.UpdateScheduleRequest` dataclasses.
 * Added `databricks.sdk.service.jobs.PeriodicTriggerConfiguration` and `databricks.sdk.service.jobs.PeriodicTriggerConfigurationTimeUnit` dataclasses.
 * Added `databricks.sdk.service.marketplace.BatchGetListingsRequest`, `databricks.sdk.service.marketplace.BatchGetListingsResponse`, `databricks.sdk.service.marketplace.BatchGetProvidersRequest`, `databricks.sdk.service.marketplace.BatchGetProvidersResponse`, `databricks.sdk.service.marketplace.ProviderIconFile`, `databricks.sdk.service.marketplace.ProviderIconType` and `databricks.sdk.service.marketplace.ProviderListingSummaryInfo` dataclasses.
 * Added `databricks.sdk.service.oauth2.DataPlaneInfo` dataclass.
 * Added `databricks.sdk.service.vectorsearch.QueryVectorIndexNextPageRequest` dataclass.
 * Added `isolation_mode` field for `databricks.sdk.service.catalog.ExternalLocationInfo`.
 * Added `max_results` and `page_token` fields for `databricks.sdk.service.catalog.ListCatalogsRequest`.
 * Added `next_page_token` field for `databricks.sdk.service.catalog.ListCatalogsResponse`.
 * Added `table_serving_url` field for `databricks.sdk.service.catalog.OnlineTable`.
 * Added `isolation_mode` field for `databricks.sdk.service.catalog.StorageCredentialInfo`.
 * Added `isolation_mode` field for `databricks.sdk.service.catalog.UpdateExternalLocation`.
 * Added `isolation_mode` field for `databricks.sdk.service.catalog.UpdateStorageCredential`.
 * Added `termination_category` field for `databricks.sdk.service.jobs.ForEachTaskErrorMessageStats`.
 * Added `on_streaming_backlog_exceeded` field for `databricks.sdk.service.jobs.JobEmailNotifications`.
 * Added `environment_key` field for `databricks.sdk.service.jobs.RunTask`.
 * Added `environments` field for `databricks.sdk.service.jobs.SubmitRun`.
 * Added `dbt_task` and `environment_key` fields for `databricks.sdk.service.jobs.SubmitTask`.
 * Added `on_streaming_backlog_exceeded` field for `databricks.sdk.service.jobs.TaskEmailNotifications`.
 * Added `periodic` field for `databricks.sdk.service.jobs.TriggerSettings`.
 * Added `on_streaming_backlog_exceeded` field for `databricks.sdk.service.jobs.WebhookNotifications`.
 * Added `provider_summary` field for `databricks.sdk.service.marketplace.Listing`.
 * Added `service_principal_id` and `service_principal_name` fields for `databricks.sdk.service.serving.App`.
 * Added `mode` field for `databricks.sdk.service.serving.AppDeployment`.
 * Added `mode` field for `databricks.sdk.service.serving.CreateAppDeploymentRequest`.
 * Added `data_plane_info` field for `databricks.sdk.service.serving.ServingEndpointDetailed`.
 * Added `query_type` field for `databricks.sdk.service.vectorsearch.QueryVectorIndexRequest`.
 * Added `next_page_token` field for `databricks.sdk.service.vectorsearch.QueryVectorIndexResponse`.
 * Changed `list()` method for [a.account_storage_credentials](https://databricks-sdk-py.readthedocs.io/en/latest/account/account_storage_credentials.html) account-level service to return `databricks.sdk.service.catalog.ListAccountStorageCredentialsResponse` dataclass.
 * Changed `isolation_mode` field for `databricks.sdk.service.catalog.CatalogInfo` to `databricks.sdk.service.catalog.CatalogIsolationMode` dataclass.
 * Changed `isolation_mode` field for `databricks.sdk.service.catalog.UpdateCatalog` to `databricks.sdk.service.catalog.CatalogIsolationMode` dataclass.
 * Removed `create_deployment()` method for [w.apps](https://databricks-sdk-py.readthedocs.io/en/latest/workspace/apps.html) workspace-level service.
 * Removed `condition_task`, `dbt_task`, `notebook_task`, `pipeline_task`, `python_wheel_task`, `run_job_task`, `spark_jar_task`, `spark_python_task`, `spark_submit_task` and `sql_task` fields for `databricks.sdk.service.jobs.SubmitRun`.

OpenAPI SHA: 7437dabb9dadee402c1fc060df4c1ce8cc5369f0, Date: 2024-06-24
```
  • Loading branch information
hectorcast-db authored Jul 9, 2024
1 parent 18c143f commit 984490d
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 6 deletions.
1 change: 1 addition & 0 deletions .codegen.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"formatter": "yapf -pri $FILENAMES && autoflake -i $FILENAMES && isort $FILENAMES",
"changelog_config": ".codegen/changelog_config.yml",
"template_libraries": [
".codegen/lib.tmpl"
],
Expand Down
44 changes: 38 additions & 6 deletions .codegen/changelog.md.tmpl
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# Version changelog

## {{.Version}}
{{- range .GroupChanges}}

{{range .Changes -}}
### {{.Type.Message}}
{{range .Changes}}
* {{.}}.
{{end}}{{- if .ApiChanges}}
API Changes:
{{range .ApiChanges}}
* {{.Action}} {{template "what" .}}{{if .Extra}} {{.Extra}}{{with .Other}} {{template "what" .}}{{end}}{{end}}.
{{- end}}
{{end}}
{{if .ApiChanges}}
### API Changes:
{{range .ApiChanges.GroupDiff}}
* {{.Action}} {{template "group-what" .}}{{if .Extra}} {{.Extra}}{{with .Other}} {{template "other-what" .}}{{end}}{{end}}.
{{- end}}

OpenAPI SHA: {{.Sha}}, Date: {{.Changed}}
Expand All @@ -20,7 +24,35 @@ Dependency updates:

## {{.PrevVersion}}

{{- define "what" -}}
{{- define "group-what" -}}
{{if gt (len .Changes) 1 -}} {{template "single-what" .Changes.First}}{{end -}}
{{range .Changes.Middle -}}, {{template "single-what" .}}{{end -}}
{{if gt (len .Changes) 1}} and {{end}}{{template "single-what" .Changes.Last}}{{template "suffix-what" .}}
{{- end -}}

{{- define "single-what" -}}
{{if eq .X "package" -}}
`databricks.sdk.service.{{.Package.Name}}`
{{- else if eq .X "service" -}}
{{template "service" .Service}}
{{- else if eq .X "method" -}}
`{{.Method.SnakeName}}()`
{{- else if eq .X "entity" -}}
{{template "entity" .Entity}}
{{- else if eq .X "field" -}}
`{{.Field.SnakeName}}`
{{- end}}
{{- end -}}

{{- define "suffix-what" -}}
{{if eq .Type "package" }} package{{if gt (len .Changes) 1}}s{{end}}
{{- else if eq .Type "method" }} method{{if gt (len .Changes) 1}}s{{end}} for {{template "service" .Parent.Service}}
{{- else if eq .Type "entity" }} dataclass{{if gt (len .Changes) 1}}es{{end}}
{{- else if eq .Type "field" }} field{{if gt (len .Changes) 1}}s{{end}} for {{template "entity" .Parent.Entity}}
{{- end}}
{{- end -}}

{{- define "other-what" -}}
{{if eq .X "package" -}}
`databricks.sdk.service.{{.Package.Name}}` package
{{- else if eq .X "service" -}}
Expand Down
11 changes: 11 additions & 0 deletions .codegen/changelog_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
change_types:
- message: New Features and Improvements
tag: "[Feature]"
- message: Bug Fixes
tag: "[Fix]"
- message: Documentation
tag: "[Doc]"
- message: Internal Changes
tag: "[Internal]"
# Default for messages without a tag
- message: Other Changes
19 changes: 19 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,22 @@ jobs:

- name: Fail on differences
run: git diff --exit-code

commit-message:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Validate Tag
run: |
TAG=$(echo ${{ github.event.pull_request.title }} | sed -ne 's/\[\(.*\)\].*/\1/p')
if grep -q "tag: \"[$TAG]\"" .codegen/changelog_config.yml; then
echo "Invalid or missing tag in commit message: [$TAG]"
exit 1
else
echo "Valid tag found: [$TAG]"
fi

0 comments on commit 984490d

Please sign in to comment.