{"record":{"id":"a00222d7027cf9c8","repo":"gastownhall/beads","slug":"invalid-pull-filter-w","errorCode":null,"errorMessage":"invalid pull filter: %w","messagePattern":"invalid pull filter: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/bd/ado.go","lineNumber":537,"sourceCode":"\n\tout := cmd.OutOrStdout()\n\tctx := context.Background()\n\n\t// Create and initialize the ADO tracker\n\tat := &ado.Tracker{}\n\tcliProjects, _ := cmd.Flags().GetStringSlice(\"project\")\n\tif len(cliProjects) > 0 {\n\t\tat.SetProjects(tracker.DeduplicateStrings(cliProjects))\n\t}\n\tif err := at.Init(ctx, store); err != nil {\n\t\treturn fmt.Errorf(\"initializing Azure DevOps tracker: %w\", err)\n\t}\n\n\t// Build pull filters from CLI flags, falling back to config values.\n\tfilters := buildADOPullFilters(ctx, cmd)\n\tif filters != nil {\n\t\tif err := filters.Validate(); err != nil {\n\t\t\treturn fmt.Errorf(\"invalid pull filter: %w\", err)\n\t\t}\n\t\tat.SetFilters(filters)\n\t}\n\n\t// Create the sync engine\n\tengine := tracker.NewEngine(at, store, actor)\n\tvar warnings []string\n\tif !jsonOutput {\n\t\tengine.OnMessage = func(msg string) { _, _ = fmt.Fprintln(out, \"  \"+msg) }\n\t}\n\tengine.OnWarning = func(msg string) {\n\t\twarnings = append(warnings, msg)\n\t\t_, _ = fmt.Fprintf(os.Stderr, \"Warning: %s\\n\", msg)\n\t}\n\n\t// Set up ADO-specific pull hooks (with bootstrap matching and no-create support)\n\tvar bootstrapMatched int\n\tengine.PullHooks = buildADOPullHooks(ctx, at, adoBootstrapMatch, adoNoCreate, &bootstrapMatched, engine.OnWarning)","sourceCodeStart":519,"sourceCodeEnd":555,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/cmd/bd/ado.go#L519-L555","documentation":"Wraps a failure from filters.Validate() on the pull filters built by buildADOPullFilters for `bd ado sync`. Pull filters (from CLI flags falling back to config values, e.g. state/area/work-item-type constraints) are validated before being handed to the tracker; an invalid combination or value aborts the sync with this message.","triggerScenarios":"buildADOPullFilters produces a non-nil filter set whose Validate() fails — e.g. an invalid state name, malformed area/iteration path, contradictory filter flags, or an invalid value in the ado config's pull-filter section.","commonSituations":"Typo in a work item type or state ('activ' vs 'active'); a filter copied from another org with different area paths; config file edited by hand with wrong casing; a flag added in a newer bd version used with an older binary (unknown/invalid combination).","solutions":["Read the wrapped cause after 'invalid pull filter:' — it names the offending filter field/value.","Remove or correct the invalid filter flag on the bd ado sync invocation.","Check the ado pull-filter entries in `bd config` values against names in Azure DevOps (states, area paths, types).","If the filter came from config, fix or delete the entry, then re-run sync.","Verify filter semantics against `bd ado sync --help` (which flags combine)."],"exampleFix":"// before\nbd ado sync --state actv\n\n// after\nbd ado sync --state active","handlingStrategy":"validation","validationCode":"func validatePullFilter(f pullFilter) error {\n\tif f.State != \"\" && !slices.Contains(validStates, f.State) {\n\t\treturn fmt.Errorf(\"unknown state %q\", f.State)\n\t}\n\tif f.Type != \"\" && !slices.Contains(validTypes, f.Type) {\n\t\treturn fmt.Errorf(\"unknown type %q\", f.Type)\n\t}\n\treturn nil\n}","typeGuard":"func isValidFilterValue(v string, allowed []string) bool {\n\treturn slices.Contains(allowed, v)\n}","tryCatchPattern":"if err := bd(\"ado\", \"sync\", filterFlags...); err != nil {\n\tif strings.Contains(err.Error(), \"invalid pull filter\") {\n\t\tlog.Printf(\"fix filter flags or ado config: %v\", err)\n\t}\n\treturn err\n}","preventionTips":["Copy state/type/area values from Azure DevOps UI or API, don't type from memory.","Keep pull filters in one reviewed config section, not scattered flags.","Re-validate filters after org changes (renames change area paths/states).","Test with `bd ado sync --dry-run` first where available."],"tags":["azure-devops","filters","validation","sync"],"backgroundTag":"invalid-filter","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}