Skip to content

structpath: build computed paths and patterns from parts; lint rule - #6984

Draft
denik wants to merge 1 commit into
denik/bundle-struct-no-dynfrom
denik/structpath-build-not-parse
Draft

denik wants to merge 1 commit into
denik/bundle-struct-no-dynfrom
denik/structpath-build-not-parse

Conversation

@denik

@denik denik commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Changes

  • structpath.NewPattern(prev, parts...): the pattern counterpart of NewPath, with structpath.AnyKey (.*) and structpath.AnyIndex ([*]) wildcards.
  • Computed paths and patterns in production code are built from parts instead of concatenating strings and parsing them (38 sites: library/path visitors, sync, permissions, validators).
  • New ruleguard rule NoComputedStructpathParse: outside tests, MustParsePath/MustParsePattern/MustParsePaths take string literals only, and ParsePath/ParsePattern must not parse a formatted or concatenated string.
  • Agent guideline in .agents/rules/style-guide-go.md.

Why

Parsing a computed string re-validates what the code just built, allocates, and panics on keys with characters the parser reserves. Literals, tests and user input still parse.

Stacked on #6954. No behaviour change: rendered paths and patterns are identical.

This pull request and its description were written by Isaac.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: c0e686b

Run: 37746213972

Env ✅​pass 🙈​skip Time
✅​ aws linux 276 18 6:13
✅​ aws windows 278 16 4:19
✅​ azure linux 275 18 6:16
✅​ azure windows 277 16 4:34
✅​ gcp linux 276 18 6:23
✅​ gcp windows 278 16 4:09
Top 6 slowest tests (at least 2 minutes):
duration env testname
3:56 gcp windows TestAccept
3:55 aws linux TestAccept
3:52 gcp linux TestAccept
3:44 aws windows TestAccept
3:44 azure linux TestAccept
3:37 azure windows TestAccept

@denik
denik force-pushed the denik/bundle-struct-no-dyn branch from 67d1321 to d49f829 Compare October 8, 2026 07:52
@denik
denik force-pushed the denik/structpath-build-not-parse branch from 7f56ac9 to c0e686b Compare October 8, 2026 07:52
@denik
denik force-pushed the denik/bundle-struct-no-dyn branch from d49f829 to b22dd28 Compare October 8, 2026 11:18
Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik force-pushed the denik/structpath-build-not-parse branch from c0e686b to 5e82fbb Compare October 8, 2026 11:19

This branch has not been deployed

No deployments
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