Skip to content

Support segment and recursive wildcards in fault patterns - #7238

Merged
shreyas-goenka merged 2 commits into
shreyas-goenka_data/shreyas/generate-omit-deployment-metadatafrom
shreyas-goenka_data/shreyas/test-fault-glob-segments
Oct 28, 2026
Merged

shreyas-goenka merged 2 commits into
shreyas-goenka_data/shreyas/generate-omit-deployment-metadatafrom
shreyas-goenka_data/shreyas/test-fault-glob-segments

Conversation

@shreyas-goenka

@shreyas-goenka shreyas-goenka commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Changes

Support * within a path segment and ** across path segments in fault.py patterns. Both match zero or more characters; all other characters are literal. Compile each pattern once when its rule is registered..

Why

useful for tests being added in #7231.

@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 7e1f99a9c | Workflow run

Regression test report

Selected 2 changed tests (limit=20, 0 not selected)

3 tests: regression=0 unreleased=1 coverage=2 failing=0

test branch main (d27fd75) latest (v1.22.1)
TestAccept/bundle/dms/operation-upload-fails-once/DMS=true ✅ ✅ ❌
TestAccept/bundle/resources/dashboards/publish-failure-stale-content/DMS= ✅ ✅ ✅
TestAccept/bundle/resources/dashboards/publish-failure-stale-content/DMS=true ✅ ✅ ✅
TestAccept/bundle/dms/operation-upload-fails-once/DMS=true: branch ✅ | main (d27fd75) ✅ | latest (v1.22.1) ❌

latest (v1.22.1):

acceptance_test.go:1341: Diff:
        --- bundle/dms/operation-upload-fails-once/output.txt
        +++ /tmp/TestAcceptbundledmsoperation-upload-fails-onceDMS=true1813912408/002/output.txt
        @@ -14,7 +14,7 @@
           "lineage": "[UUID]",
           "serial": 1,
           "features": {
        -    "deployment_history_shadow": {}
        +    "deployment_history": {}
           }
         }
         
        @@ -39,18 +39,9 @@
          "lineage": "[UUID]",
          "serial": 1,
          "features": {
        -  "deployment_history_shadow": {}
        +  "deployment_history": {}
          },
        - "state": {
        -  "resources.schemas.foo": {
        -   "__id__": "main.dms_upload_fails_once_schema_[UNIQUE_NAME]",
        -   "state": {
        -    "catalog_name": "main",
        -    "comment": "v1",
        -    "name": "dms_upload_fails_once_schema_[UNIQUE_NAME]"
        -   }
        -  }
        - }
        + "state": {}
         }
         
         === A recreate records twice, and the first one fails: the second must still carry the sequence id staging left, because a rejected update earned no new one
        @@ -64,113 +54,13 @@
         This action will result in the deletion or recreation of the following UC schemas. Any underlying data may be lost:
           recreate resources.schemas.foo
         Recreated schemas.foo
        -Warn: Failed to record deployment history: recording operation for resources.schemas.foo: Fault injected by test.
        -Files: 2 uploaded, 0 deleted
        -Resources: 1 created, 0 changed, 1 deleted, 0 unchanged
        +Error: recording operation for resources.schemas.foo: Fault injected by test. (500 INJECTED)
         
        -=== The service lists the schema with the failure
        ->>> MSYS_NO_PATHCONV=1 [CLI] bundle-deployments list-resources deployments/[DEPLOYMENT_ID] -o json
        -[
        -  {
        -    "last_action_type": "OPERATION_ACTION_TYPE_RECREATE",
        -    "last_version_id": "2",
        -    "resource_key": "schemas.foo"
        -  }
        -]
        +Endpoint: PATCH [DATABRICKS_URL]/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/2/operations/schemas.foo?update_mask=state%2Cerror_message%2Cstatus
        +HTTP Status: 500 Internal Server Error
        +API error_code: INJECTED
        +API message: Fault injected by test.
         
        -=== The raw recorded state after the failure
        ->>> print_state.py --no-dms
        -{
        - "state_version": 3,
        - "cli_version": "[CLI_VERSION]",
        - "lineage": "[UUID]",
        - "serial": 2,
        - "features": {
        -  "deployment_history_shadow": {}
        - },
        - "state": {
        -  "resources.schemas.foo": {
        -   "__id__": "dms_other_[UNIQUE_NAME].dms_upload_fails_once_schema_[UNIQUE_NAME]",
        -   "state": {
        -    "catalog_name": "dms_other_[UNIQUE_NAME]",
        -    "comment": "v1",
        -    "name": "dms_upload_fails_once_schema_[UNIQUE_NAME]"
        -   }
        -  }
        - }
        -}
        +Files: 2 uploaded, 0 deleted
         
        ->>> print_requests.py --dms //api/2.0/bundle
        -{
        -  "method": "POST",
        -  "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions",
        -  "q": {
        -    "version_id": "2"
        -  },
        -  "body": {
        -    "cli_version": "[CLI_VERSION]",
        -    "operations": [
        -      {
        -        "action_type": "OPERATION_ACTION_TYPE_RECREATE",
        -        "resource_key": "schemas.foo"
        -      }
        -    ],
        -    "previous_version_id": "1",
        -    "version_type": "VERSION_TYPE_DEPLOY"
        -  }
        -}
        -{
        -  "method": "PATCH",
        -  "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/2/operations/schemas.foo",
        -  "q": {
        -    "update_mask": "state,error_message,status"
        -  },
        -  "body": {
        -    "error_message": "",
        -    "sequence_id": 0,
        -    "status": "OPERATION_STATUS_PENDING"
        -  }
        -}
        -{
        -  "method": "PATCH",
        -  "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/2/operations/schemas.foo",
        -  "q": {
        -    "update_mask": "state,error_message,resource_id,status"
        -  },
        -  "body": {
        -    "error_message": "",
        -    "resource_id": "dms_other_[UNIQUE_NAME].dms_upload_fails_once_schema_[UNIQUE_NAME]",
        -    "sequence_id": 0,
        -    "state": "{\"state\":{\"catalog_name\":\"dms_other_[UNIQUE_NAME]\",\"comment\":\"v1\",\"name\":\"dms_upload_fails_once_schema_[UNIQUE_NAME]\"}}",
        -    "status": "OPERATION_STATUS_SUCCEEDED"
        -  }
        -}
        -{
        -  "method": "POST",
        -  "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/2/complete",
        -  "body": {
        -    "completion_reason": "VERSION_COMPLETE_FAILURE"
        -  }
        -}
        -
        -=== A completion failure does not block destroy or remote file cleanup
        ->>> fault.py POST /api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/3/complete 400 0 1
        -
        ->>> [CLI] bundle destroy --auto-approve
        -The following resources will be deleted:
        -  delete resources.schemas.foo
        -
        -This action will result in the deletion of the following UC schemas. Any underlying data may be lost:
        -  delete resources.schemas.foo
        -
        -All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/dms-upload-fails-once-[UNIQUE_NAME]/default
        -
        -Warn: Failed to complete deployment history version: Fault injected by test.
        -Destroy: 1 deleted
        -
        ->>> print_requests.py --dms //versions/3 --oneline
        -{"method": "PATCH", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/3/operations/schemas.foo", "q": {"update_mask": "state,error_message,status"}, "body": {"error_message": "", "sequence_id": 0, "status": "OPERATION_STATUS_SUCCEEDED"}}
        -{"method": "POST", "path": "/api/2.0/bundle/deployments/[DEPLOYMENT_ID]/versions/3/complete", "body": {"completion_reason": "VERSION_COMPLETE_SUCCESS"}}
        -
        ->>> musterr env MSYS_NO_PATHCONV=1 [CLI] workspace get-status /Workspace/Users/[USERNAME]/.bundle/dms-upload-fails-once-[UNIQUE_NAME]/default/state/resources.json
        -Error: Path (/Workspace/Users/[USERNAME]/.bundle/dms-upload-fails-once-[UNIQUE_NAME]/default/state/resources.json) doesn't exist.
        +Exit code: 1
        
    acceptance_test.go:1119: 
        LOG.catalog: {
        LOG.catalog:   "catalog_type": "MANAGED_CATALOG",
        LOG.catalog:   "created_at": 1793204571360,
        LOG.catalog:   "created_by": "tester@databricks.com",
        LOG.catalog:   "full_name": "dms_other_m3hzipo2pjffzfbdwkoihzzh7e",
        LOG.catalog:   "metastore_id": "7a07bcf8-2141-3923-7a07-bcf8214139fb",
        LOG.catalog:   "name": "dms_other_m3hzipo2pjffzfbdwkoihzzh7e",
        LOG.catalog:   "owner": "tester@databricks.com",
        LOG.catalog:   "updated_at": 1793204571360,
        LOG.catalog:   "updated_by": "tester@databricks.com"
        LOG.catalog: }

@shreyas-goenka
shreyas-goenka marked this pull request as ready for review October 28, 2026 16:45
@shreyas-goenka
shreyas-goenka requested review from a team as code owners October 28, 2026 16:45
@shreyas-goenka
shreyas-goenka merged commit 6de33d6 into shreyas-goenka_data/shreyas/generate-omit-deployment-metadata Oct 28, 2026
25 checks passed
@shreyas-goenka
shreyas-goenka deleted the shreyas-goenka_data/shreyas/test-fault-glob-segments branch October 28, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants