refactor: ⚙️scope parsing updated to a more consistent and easier to understand format - #322
Merged
Conversation
Add graphify-out/ to .gitignore so the locally generated knowledge graph (graph.json, graph.html, wiki, manifests) is not committed. These artifacts are regenerated by graphify on demand and must remain local working state.
…c ORG: scope parser Rewrite internal/cmd/util/scope.Parse to use an explicit ORG: organization marker and a leading-slash no-project marker instead of the ambiguous validPrefixes/prefixLen heuristics. Key changes: - Add DisallowProject and DisallowTargets options; MaxTargets==0 now means unbounded. - Structured wrappers no longer classify a bare segment as organization (only ParseOrganizationArg keeps bare ORG for org-only commands). - Legacy organization/slash forms are rejected with ORG: guidance where structurally detectable; ambiguous forms follow canonical project-first interpretation. Tests rewritten to full Path equality covering every wrapper mode, markers, unbounded targets, malformed colons, default-org resolution, and legacy rejection/reinterpretation.
…PO grammar Replace legacy [ORGANIZATION/]PROJECT/REPO regexes with a splitName tokenizer that mirrors the shared scope parser: explicit ORG: prefix, restored organization-name validation, and rejection of legacy slash forms with ORG: guidance. Preserve URL/SSH parsing, hostname validation, and slash-delimited FullName display. Add a testdata organization fixture for the git: name-routing case. Consolidate splitName tests into public-API coverage (ProjectFromName/RepositoryFromName).
Resolve pre-existing lint blockers so make lint passes with golangci-lint 2.12.2. All changes are behavior-preserving: - Replace unsafe.Pointer endianness probe with binary.NativeEndian. - Narrow test file opens with nolint justification (paths derive from t.TempDir()). - Eliminate int->int32 overflow by using rand.Intn. - Use typed context keys instead of string keys. - Drop always-nil error return and unused params/fields. - Move test-only cache helpers into _test.go so they are excluded under run.tests=false.
Update all command Use/Long/Example/argument strings and call sites to the new [ORG:]PROJECT/... forms and the /TARGET no-project marker. Affected command groups: boards iteration, pipelines, projects, teams, graph users, service endpoints, security groups/permissions/namespaces, and repositories. Notable adjustments: - Commands now route through the deterministic parser and the ParseProjectScope/ParsePoolAgentTargetWithDefaultOrganization wrappers. - Composed scopes (graph user list) use ORG:PROJECT. - No-project modes (pool/agent, namespace) use the / marker with DisallowProject. - Normalize optional organization notation to [ORG:] across command help.
Add black-box and table-driven tests covering explicit/default organization routing, no-project markers, legacy slash rejection and project-first reinterpretation, and parser-mode errors across the migrated command groups: boards, pipelines, projects, teams, graph users, service endpoints, security groups/permissions/namespaces, and repositories. New test files added for previously untested parsers and commands: ParseSubjectTarget, parseNamespaceTarget, and several group/serviceendpoint commands.
Regenerate docs/ via make docs to reflect canonical [ORG:] scope notation across all migrated commands, and expand AGENTS.md commit & PR guidelines with topological batching, test-after-prod ordering, and agent git restrictions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.