Skip to content

structaccess: accept dyn.Path directly#3503

Merged
denik merged 3 commits intomainfrom
denik/structaccess-path
Aug 28, 2025
Merged

structaccess: accept dyn.Path directly#3503
denik merged 3 commits intomainfrom
denik/structaccess-path

Conversation

@denik
Copy link
Contributor

@denik denik commented Aug 27, 2025

Changes

Make structaccess.Get accept dyn.Path rather than string.

Follow up to #3466

Why

I plan to check more than one struct (config and remote state) and it's good to reuse parsed path between those.

Tests

Existing tests.

There is also a new test added but it's not a regression test for this PR (the bad syntax never reaches NewPathFromString), just on related topic.

@denik denik temporarily deployed to test-trigger-is August 27, 2025 15:41 — with GitHub Actions Inactive
@denik denik changed the title Denik/structaccess path structaccess: accept dyn.Path directly Aug 27, 2025
@denik denik temporarily deployed to test-trigger-is August 27, 2025 15:45 — with GitHub Actions Inactive
@denik denik enabled auto-merge August 27, 2025 15:45
@eng-dev-ecosystem-bot
Copy link
Collaborator

eng-dev-ecosystem-bot commented Aug 27, 2025

Run: 17271734795

Env ✅‌pass ❌‌FAIL 🙈‌skip
✅‌ aws linux 308 498
✅‌ aws windows 309 497
❌‌ aws-ucws linux 419 5 394
❌‌ aws-ucws windows 419 6 393
✅‌ azure linux 308 497
✅‌ azure windows 309 496
✅‌ azure-ucws linux 424 393
✅‌ azure-ucws windows 425 392
✅‌ gcp linux 307 499
✅‌ gcp windows 308 498
6 failing tests:
Test Name aws-ucws linux aws-ucws windows
TestAccept ❌‌FAIL ❌‌FAIL
TestAccept/bundle/deploy/lakebase/database-catalog ❌‌FAIL ❌‌FAIL
TestAccept/bundle/deploy/lakebase/database-instance/single-instance ❌‌FAIL ❌‌FAIL
TestAccept/bundle/deploy/lakebase/database-instance/single-instance/DATABRICKS_CLI_DEPLOYMENT=direct-exp ❌‌FAIL ❌‌FAIL
TestAccept/bundle/deploy/lakebase/database-instance/single-instance/DATABRICKS_CLI_DEPLOYMENT=terraform ❌‌FAIL ❌‌FAIL
TestAccept/bundle/deploy/lakebase/synced-database-table ✅‌pass ❌‌FAIL

}
value, err := structaccess.Get(config, fieldPath)
dynPath, err := dyn.NewPathFromString(fieldPath)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the above code uses dynvar, I don't think this ever triggers.

We should be more strict here to begin with and make sure everything after ${ is valid.

@denik denik disabled auto-merge August 28, 2025 07:59
@denik denik merged commit 451dfea into main Aug 28, 2025
21 of 23 checks passed
@denik denik deleted the denik/structaccess-path branch August 28, 2025 07:59
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.

3 participants