Skip to content

internal: structpath: accurate struct <-> string mapping#3631

Closed
denik wants to merge 5 commits intomainfrom
denik/accurate-structpath
Closed

internal: structpath: accurate struct <-> string mapping#3631
denik wants to merge 5 commits intomainfrom
denik/accurate-structpath

Conversation

@denik
Copy link
Copy Markdown
Contributor

@denik denik commented Sep 19, 2025

Changes

  • PathNode: Drop AnyKey/AnyIndex and use DotStar, BracketStar for accurate representation of path.
  • Add a standalone helper to convert PathNode to dyn.Path that uses Path information to disambiguate.

Why

Previously structpath could represent AnyKey and AnyIndex as struct but as string they were both represented as field[*].

On the other hand, there was no unambigous representation of x.*.

This commit fixes struct mapping to match string representation 1-1 so that Parse(x.String()) == x.

Tests

New unit tests.

Enabled testing reconstructed PathNode equality in structwalk tests.

Previously structpath could represent AnyKey and AnyIndex as struct
but as string they were both represented as field[*].

On the other hand, there was no unambigous representation of x.*.

This commit fixes struct mapping to match string representation 1-1 so
that Parse(x.String()) == x.
@denik denik temporarily deployed to test-trigger-is September 19, 2025 08:42 — with GitHub Actions Inactive
@denik denik marked this pull request as draft September 19, 2025 08:50
@eng-dev-ecosystem-bot
Copy link
Copy Markdown
Collaborator

eng-dev-ecosystem-bot commented Sep 19, 2025

Run: 17855144343

Env ✅​pass 🔄​flaky 🙈​skip
✅​ aws linux 311 528
✅​ aws windows 312 527
✅​ aws-ucws linux 423 426
✅​ aws-ucws windows 424 425
✅​ azure linux 311 527
✅​ azure windows 312 526
✅​ azure-ucws linux 423 425
✅​ azure-ucws windows 424 424
✅​ gcp linux 310 529
🔄​ gcp windows 310 1 528
Test Name gcp windows
TestFetchRepositoryInfoAPI_FromRepo 🔄​flaky

@denik denik temporarily deployed to test-trigger-is September 19, 2025 09:41 — with GitHub Actions Inactive
@denik denik marked this pull request as ready for review September 19, 2025 09:41
@denik denik temporarily deployed to test-trigger-is September 19, 2025 09:46 — with GitHub Actions Inactive
@denik
Copy link
Copy Markdown
Contributor Author

denik commented Sep 22, 2025

Looking into making ConvertPathNodeToDynPath unnecessary

@denik
Copy link
Copy Markdown
Contributor Author

denik commented Sep 22, 2025

Superseded by #3640

@denik denik closed this Sep 22, 2025
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