Allow permissions: none shorthand in schema validation#55972
permissions: none shorthand in schema validation#55972Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
permissions: none shorthand in schema validation
|
Great work! 🎉 This PR looks ready for review. You've successfully aligned the JSON schema with the parser's existing support for the The changes are focused and well-coordinated across schema, documentation, autocomplete, and tests. The new test This is ready to move forward!
|
|
Triage update: Category: bug | Risk: medium | Score: 48/100 (impact 24 + urgency 14 + quality 10) | Action: batch_review | Batch: workflow-runtime
|
|
Triage update: Category: bug | Risk: medium | Score: 48/100 (impact 24 + urgency 14 + quality 10) | Action: batch_review | Batch: workflow-runtime
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. No ADR enforcement needed: PR does not have the 'implementation' label and has 16 new lines in business logic directories (threshold is 100).
|
|
✅ PR Code Quality Reviewer completed the code quality review. Completed PR review for #55972; no GitHub write comments were needed because no actionable changed-line issues were found.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff
|
There was a problem hiding this comment.
The changes are correct and complete. permissions_parser.go already handled 'none' as a shorthand at runtime - this PR aligns schema validation, autocomplete data, and documentation with that existing behavior, and adds a test to cover it.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet46 · 21.3 AIC · ⌖ 9.01 AIC · ⊞ 6.2K
There was a problem hiding this comment.
Pull request overview
Aligns schema validation, documentation, and editor autocomplete with existing permissions: none runtime support.
Changes:
- Adds
noneto the permissions schema and autocomplete. - Documents the shorthand.
- Adds schema validation coverage.
Show a summary per file
| File | Description |
|---|---|
pkg/parser/schemas/main_workflow_schema.json |
Allows the none shorthand. |
pkg/parser/schema_test.go |
Tests schema acceptance. |
docs/src/content/docs/reference/permissions.md |
Documents none. |
docs/public/editor/autocomplete-data.json |
Adds autocomplete support. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Balanced
| "enum": ["read-all", "write-all", "none"], | ||
| "description": "Simple permissions string: 'read-all' (all read permissions), 'write-all' (all write permissions), or 'none' (no permissions)" |
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd — approving with one minor suggestion.
📋 Key Themes & Highlights
Positive Highlights
- ✅ Clean, minimal fix: schema enum updated in one place and kept in sync across schema JSON, autocomplete data, and docs
- ✅ Regression test added with clear name and appropriate
t.Parallel()usage - ✅ PR description clearly explains the root cause (schema gap vs. parser support)
Minor Finding
- One inline comment on the hardcoded
/tmp/gh-aw/...path in the new test — a cosmetic alignment with the rest of the test file
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet46 · 17.7 AIC · ⌖ 9.87 AIC · ⊞ 7.6K
Comment /matt to run again
| "permissions": "none", | ||
| } | ||
|
|
||
| err := ValidateMainWorkflowFrontmatterWithSchemaAndLocation(validFrontmatter, "/tmp/gh-aw/permissions-none-shorthand-valid-test.md") |
There was a problem hiding this comment.
[/tdd] The hardcoded /tmp/gh-aw/... path works today but ties the test to a specific sandbox layout. Other tests in this file use descriptive in-memory paths — consider using t.TempDir() or a simple placeholder like "/workflow.md".
💡 Suggested fix
err := ValidateMainWorkflowFrontmatterWithSchemaAndLocation(validFrontmatter, "/workflow.md")The path is only used for error message context in schema validation, so any plausible string works.
@copilot please address this.
|
@copilot run pr-finisher skill |
permissions: noneis a real, implemented shorthand inpkg/workflow/permissions_parser.go(converted viaNewPermissionsNone()), but the JSON schema only allowedread-all/write-allas string values for top-levelpermissions, causing schema-valid frontmatter to be rejected.Schema
"none"to the string enum for top-levelpermissionsinpkg/parser/schemas/main_workflow_schema.json, updated its description to match.Docs
noneas an equivalent to{}for computation-only workflows indocs/src/content/docs/reference/permissions.md.Editor autocomplete
permissionsenum indocs/public/editor/autocomplete-data.jsonso autocomplete stays consistent with the schema.Tests
TestValidateMainWorkflowFrontmatterWithSchemaAndLocation_PermissionsNoneShorthandassertingpermissions: nonepasses schema validation.This previously failed schema validation despite being valid, parser-supported input.
permissions: nonein schema (parser already supports it, docs already imply it) #55961