Skip to content

Split PathNode into PathNode and PatternNode#4455

Draft
denik wants to merge 10 commits intomainfrom
denik/path-node-split2
Draft

Split PathNode into PathNode and PatternNode#4455
denik wants to merge 10 commits intomainfrom
denik/path-node-split2

Conversation

@denik
Copy link
Contributor

@denik denik commented Feb 5, 2026

Changes

Separate concrete paths from wildcard patterns at the type level:

  • PathNode: for concrete paths without wildcards (used by Get, Set, Walk)
  • PatternNode: for patterns that may include wildcards (used by WalkType, Validate)
  • PathNodeBase: shared struct with common fields and methods

Add cleaner parsing API:

  • ParsePath(s) -> (*PathNode, error)
  • ParsePattern(s) -> (*PatternNode, error)
  • MustParsePath(s), MustParsePattern(s) for tests

Rename validation functions for consistency:

  • ValidatePath for PathNode
  • ValidatePattern for PatternNode

Update HasChange to accept *PathNode with precalculated paths.

Why

Make it clear where we work with concrete path and where with pattern.

@denik denik temporarily deployed to test-trigger-is February 5, 2026 16:23 — with GitHub Actions Inactive
@denik denik marked this pull request as draft February 5, 2026 16:24
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Feb 5, 2026

Commit: 0debcd3

Run: 21757177510

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 7 1 7 451 731 27:30
🟨​ aws windows 7 1 7 417 741 20:59
🟨​ aws-ucws linux 3 9 5 704 584 61:23
🟨​ aws-ucws windows 3 9 5 667 595 47:20
💚​ azure linux 2 9 451 730 26:54
💚​ azure windows 2 9 417 740 22:34
🔄​ azure-ucws linux 3 5 7 664 595 60:17
💚​ azure-ucws windows 6 7 629 606 42:00
💚​ gcp linux 2 9 440 736 21:21
💚​ gcp windows 2 9 406 746 20:24
19 interesting tests: 7 KNOWN, 5 SKIP, 5 RECOVERED, 2 flaky
Test Name aws linux aws windows aws-ucws linux aws-ucws windows azure linux azure windows azure-ucws linux azure-ucws windows gcp linux gcp windows
🟨​ TestAccept 🟨​K 🟨​K 🟨​K 🟨​K 💚​R 💚​R 🔄​f 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/deployment/bind/alert 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/generate/alert 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🔄​ TestAccept/bundle/invariant/migrate 🙈​s 🙈​s ✅​p ✅​p 🙈​s 🙈​s 🔄​f ✅​p 🙈​s 🙈​s
🔄​ TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl ✅​p ✅​p 🔄​f ✅​p
💚​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 💚​R 💚​R 🙈​S 🙈​S 💚​R 💚​R 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/alerts/basic 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/alerts/with_file 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/permissions 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions 🟨​K 🟨​K 🟨​K 🟨​K 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 🟨​K 🟨​K
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/with_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions 🟨​K 🟨​K 💚​R 💚​R 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=direct 🟨​K 🟨​K 💚​R 💚​R
🟨​ TestAccept/bundle/resources/permissions/jobs/destroy_without_mgmtperms/without_permissions/DATABRICKS_BUNDLE_ENGINE=terraform 🟨​K 🟨​K 💚​R 💚​R
💚​ TestAccept/bundle/resources/synced_database_tables/basic 🙈​S 🙈​S 💚​R 💚​R 🙈​S 🙈​S 💚​R 💚​R 🙈​S 🙈​S
💚​ TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform 💚​R 💚​R 💚​R 💚​R
💚​ TestAccept/ssh/connection 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 50 slowest tests (at least 2 minutes):
duration env testname
19:38 azure-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
13:33 azure-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
8:54 aws-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
8:47 aws-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
8:26 aws-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
7:41 aws-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
7:35 aws-ucws linux TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
7:30 aws-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
7:30 azure-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
7:05 aws-ucws windows TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
6:56 aws-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
6:45 aws-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
6:43 aws-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
6:40 aws-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
6:37 aws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
6:24 aws-ucws windows TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
6:23 aws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
6:20 aws-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
6:15 aws-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
6:04 aws-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
6:00 aws-ucws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:56 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:50 aws-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
5:48 aws-ucws linux TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
5:45 aws-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:42 aws linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:31 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:21 gcp linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:17 aws-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
5:05 azure-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
5:03 gcp windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
5:02 azure-ucws windows TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=direct
5:01 gcp linux TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
4:49 azure-ucws linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
4:44 azure-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
4:41 azure windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
4:35 azure-ucws windows TestAccept/bundle/resources/synced_database_tables/basic/DATABRICKS_BUNDLE_ENGINE=terraform
4:29 azure-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
4:24 azure windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=terraform
4:15 azure-ucws windows TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
3:53 azure-ucws windows TestAccept/bundle/resources/clusters/deploy/update-after-create/DATABRICKS_BUNDLE_ENGINE=direct
3:51 azure-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
3:45 gcp windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:44 azure-ucws linux TestAccept/bundle/invariant/migrate/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
3:37 azure-ucws linux TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=synced_database_table.yml.tmpl
3:29 azure-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_instance.yml.tmpl
3:18 azure linux TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct
3:18 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=terraform
3:15 azure-ucws windows TestAccept/bundle/invariant/no_drift/DATABRICKS_BUNDLE_ENGINE=direct/INPUT_CONFIG=database_catalog.yml.tmpl
3:15 aws windows TestAccept/bundle/resources/apps/inline_config/DATABRICKS_BUNDLE_ENGINE=direct

Separate concrete paths from wildcard patterns at the type level:
- PathNode: for concrete paths without wildcards (used by Get, Set, Walk)
- PatternNode: for patterns that may include wildcards (used by WalkType, Validate)
- PathNodeBase: shared struct with common fields and methods

Add cleaner parsing API:
- ParsePath(s) -> (*PathNode, error)
- ParsePattern(s) -> (*PatternNode, error)
- MustParsePath(s), MustParsePattern(s) for tests

Rename validation functions for consistency:
- ValidatePath for PathNode
- ValidatePattern for PatternNode

Update HasChange to accept *PathNode with precalculated paths.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@denik denik force-pushed the denik/path-node-split2 branch from 26b99a6 to 4bf169b Compare February 6, 2026 12:51
@denik denik temporarily deployed to test-trigger-is February 6, 2026 12:52 — with GitHub Actions Inactive
Introduce PatternNode as a type definition of PathNode (type PatternNode PathNode)
to distinguish between concrete paths (no wildcards) and patterns (with wildcards).

- PatternNode methods delegate to PathNode via type casting
- Add ParsePath() and ParsePattern() wrapper functions
- Add PatternNode constructors (NewPatternDotStar, NewPatternBracketStar, etc.)
- Remove NewDotStar/NewBracketStar from PathNode (wildcards only valid in patterns)
- Unify path_test.go to test concrete paths with both APIs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@denik denik force-pushed the denik/path-node-split2 branch from 4bf169b to 405f6a0 Compare February 6, 2026 12:57
@denik denik temporarily deployed to test-trigger-is February 6, 2026 12:57 — with GitHub Actions Inactive
denik and others added 4 commits February 6, 2026 14:01
ValidatePath's internal validateNodeSlice already handles wildcards
(BracketStar and DotStar), so no need for the slice copying loop.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Reimplement AsSlice() directly instead of delegating to PathNode
- Restore the state machine transitions documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename Parse to parse (unexported)
- Return (*PatternNode, error) instead of (*PathNode, *PatternNode, error)
- ParsePattern returns directly, ParsePath casts to *PathNode
- Restore state machine transitions documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Return error immediately when wildcard is encountered and
wildcardAllowed is false, instead of tracking and checking at the end.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@denik denik temporarily deployed to test-trigger-is February 6, 2026 15:43 — with GitHub Actions Inactive
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@denik denik temporarily deployed to test-trigger-is February 6, 2026 15:49 — with GitHub Actions Inactive
PathNode should not have wildcard-related methods since wildcards
can only exist in PatternNode. This enforces type safety - code
working with PathNode cannot accidentally handle wildcards.

- Remove DotStar() and BracketStar() from PathNode
- Remove NewDotStar() and NewBracketStar() constructors
- PatternNode now has its own DotStar/BracketStar implementations
- validateNodeSlice now accepts []*PatternNode
- ValidatePath delegates to ValidatePattern via cast

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@denik denik temporarily deployed to test-trigger-is February 6, 2026 15:57 — with GitHub Actions Inactive
The parse function now builds *PatternNode directly using PatternNode
constructors, rather than building *PathNode and casting at the end.
This is more consistent since wildcards only exist in PatternNode.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@denik denik temporarily deployed to test-trigger-is February 6, 2026 16:01 — with GitHub Actions Inactive
- Fix parse function doc comment to match new signature
- Restore comments in validateNodeSlice

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@denik denik temporarily deployed to test-trigger-is February 6, 2026 16:06 — with GitHub Actions Inactive
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