Skip to content

Allow permissions: none shorthand in schema validation - #55972

Open
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/deep-report-allow-permissions-none
Open

Allow permissions: none shorthand in schema validation#55972
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/deep-report-allow-permissions-none

Conversation

Copilot AI commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

permissions: none is a real, implemented shorthand in pkg/workflow/permissions_parser.go (converted via NewPermissionsNone()), but the JSON schema only allowed read-all/write-all as string values for top-level permissions, causing schema-valid frontmatter to be rejected.

Schema

  • Added "none" to the string enum for top-level permissions in pkg/parser/schemas/main_workflow_schema.json, updated its description to match.

Docs

  • Documented none as an equivalent to {} for computation-only workflows in docs/src/content/docs/reference/permissions.md.

Editor autocomplete

  • Synced the permissions enum in docs/public/editor/autocomplete-data.json so autocomplete stays consistent with the schema.

Tests

  • Added TestValidateMainWorkflowFrontmatterWithSchemaAndLocation_PermissionsNoneShorthand asserting permissions: none passes schema validation.
---
on: push
permissions: none
---

This previously failed schema validation despite being valid, parser-supported input.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix validation to support permissions: none in schema Allow permissions: none shorthand in schema validation Aug 26, 2026
Copilot AI requested a review from pelikhan August 26, 2026 07:05
@github-actions

Copy link
Copy Markdown
Contributor

Great work! 🎉 This PR looks ready for review. You've successfully aligned the JSON schema with the parser's existing support for the permissions: none shorthand — a solid bug fix that ensures schema-valid frontmatter won't be rejected.

The changes are focused and well-coordinated across schema, documentation, autocomplete, and tests. The new test TestValidateMainWorkflowFrontmatterWithSchemaAndLocation_PermissionsNoneShorthand directly validates the fix, and the docs update clarifies the none shorthand for maintainers and contributors.

This is ready to move forward!

Generated by ✅ Contribution Check · copilot · auto · 51.6 AIC · ⌖ 5.39 AIC · ⊞ 9.3K ·

@github-actions

Copy link
Copy Markdown
Contributor

Triage update: Category: bug | Risk: medium | Score: 48/100 (impact 24 + urgency 14 + quality 10) | Action: batch_review | Batch: workflow-runtime

Generated by 🔧 PR Triage Agent · copilot · mai10 · 17.1 AIC · ⌖ 2.78 AIC · ⊞ 15.6K ·

@github-actions

Copy link
Copy Markdown
Contributor

Triage update: Category: bug | Risk: medium | Score: 48/100 (impact 24 + urgency 14 + quality 10) | Action: batch_review | Batch: workflow-runtime

Generated by 🔧 PR Triage Agent · copilot · mai10 · 17.1 AIC · ⌖ 2.78 AIC · ⊞ 15.6K ·

@pelikhan
pelikhan marked this pull request as ready for review August 26, 2026 13:54
Copilot AI balanced review requested due to automatic review settings August 26, 2026 13:54
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #55972

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

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).

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

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.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Aligns schema validation, documentation, and editor autocomplete with existing permissions: none runtime support.

Changes:

  • Adds none to 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

Comment on lines +2489 to +2490
"enum": ["read-all", "write-all", "none"],
"description": "Simple permissions string: 'read-all' (all read permissions), 'write-all' (all write permissions), or 'none' (no permissions)"
@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-26T13:58:34.326388+00:00
review_event: COMMENT
top_themes:
  - schema/docs/autocomplete alignment for permissions shorthand looks consistent
  - no changed-line correctness or maintainability regressions found
files_reviewed:
  - docs/public/editor/autocomplete-data.json
  - docs/src/content/docs/reference/permissions.md
  - pkg/parser/schema_test.go
  - pkg/parser/schemas/main_workflow_schema.json
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · pi · gpt54 · 4.9 AIC · ⌖ 6.84 AIC · ⊞ 7K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread pkg/parser/schema_test.go
"permissions": "none",
}

err := ValidateMainWorkflowFrontmatterWithSchemaAndLocation(validFrontmatter, "/tmp/gh-aw/permissions-none-shorthand-valid-test.md")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/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.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[deep-report] Allow permissions: none in schema (parser already supports it, docs already imply it)

3 participants