Skip to content

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

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

denik wants to merge 3 commits 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: f8f05cc

Run: 37924012388

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 276 17 4:12
✅​ aws-windows-latest-4core-16gb 278 15 3:56
✅​ azure linux-2core-8gb 275 17 4:11
✅​ azure-windows-latest-4core-16gb 277 15 3:41
✅​ gcp linux-2core-8gb 276 17 4:13
✅​ gcp-windows-latest-4core-16gb 278 15 3:49
Top 4 slowest tests (at least 2 minutes):
duration env testname
3:54 aws-windows-latest-4core-16gb TestAccept
3:47 gcp-windows-latest-4core-16gb TestAccept
3:39 azure-windows-latest-4core-16gb TestAccept
2:01 gcp linux-2core-8gb TestAccept

@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/structpath-build-not-parse branch from c0e686b to 5e82fbb Compare October 8, 2026 11:19
@denik
denik force-pushed the denik/structpath-build-not-parse branch from 5e82fbb to 31eb3d5 Compare October 8, 2026 11:34
@denik
denik force-pushed the denik/structpath-build-not-parse branch from bbddd4b to 9da018f Compare October 8, 2026 16:33
@denik
denik force-pushed the denik/structpath-build-not-parse branch from 9da018f to e992389 Compare October 8, 2026 16:35
@denik
denik added this pull request to stack #6997 October 9, 2026 08:18
@denik
denik force-pushed the denik/structpath-build-not-parse branch from e992389 to 0e02a61 Compare October 9, 2026 08:24
@github-actions github-actions Bot added the DABs DABs related issues label Oct 9, 2026
@denik
denik force-pushed the denik/structpath-build-not-parse branch from 0e02a61 to e084a08 Compare October 9, 2026 08:42
@denik
denik force-pushed the denik/structpath-build-not-parse branch from e084a08 to 17a9f2a Compare October 9, 2026 08:44
@denik
denik force-pushed the denik/structpath-build-not-parse branch from 17a9f2a to bcafaf0 Compare October 9, 2026 10:44
denik and others added 2 commits October 9, 2026 13:17
Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@denik
denik force-pushed the denik/structpath-build-not-parse branch from bcafaf0 to 7ef5a60 Compare October 9, 2026 11:19
…ument, type-check String() and receivers

Co-authored-by: Isaac <no-reply@databricks.com>

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

DABs DABs related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants