Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…pilation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Report hard error for workflows on repos without discussions
Validate repository features (discussions/issues) during workflow compilation
Oct 25, 2025
pelikhan
approved these changes
Oct 25, 2025
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds compile-time validation to ensure workflows using discussion or issue-related safe-outputs target repositories with those features enabled. Previously, workflows would fail at runtime if discussions/issues were disabled; now they fail during compilation with actionable error messages.
Key changes:
- Added repository feature validation during workflow compilation
- Implemented GitHub API checks for discussions (GraphQL) and issues (REST)
- Tests cover unit, integration, and real API call scenarios
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/validation.go | Adds validation functions for checking repository discussions/issues via GitHub APIs |
| pkg/workflow/repository_features_validation_test.go | Unit tests for repository feature validation logic |
| pkg/workflow/repository_features_validation_integration_test.go | Integration tests that verify validation with actual GitHub API calls |
| pkg/workflow/compiler.go | Integrates repository feature validation into the compilation workflow |
| docs/src/content/docs/reference/frontmatter-full.md | Removes commented-out feature flag documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
Agentic Changeset Generator triggered by this pull request. |
github-actions bot
added a commit
that referenced
this pull request
Oct 25, 2025
Update CLI documentation to reflect recent feature additions: - Document firewall log parsing in --parse flag (PR #2349, #2350) - Logs and audit commands now generate firewall.md files - JSON output includes firewall analysis - Update --dependabot documentation (PR #2359) - Added pip and Go ecosystem support - Clarified command detection patterns - Add repository feature validation section (PR #2347) - Compile validates discussions/issues enabled - Prevents runtime failures for incompatible workflows 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
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.
Workflows using
create-discussion,create-issue, oradd-comment with discussion: truenow fail at compile time if the target repository doesn't have those features enabled, preventing runtime failures.Implementation
Validation logic (
pkg/workflow/validation.go):validateRepositoryFeatures()- Checks required features during compilationcheckRepositoryHasDiscussions()- GraphQL query for discussions statuscheckRepositoryHasIssues()- REST API query for issues statusgetCurrentRepository()- Resolves repository from git context via gh CLICompiler integration (
pkg/workflow/compiler.go):Coverage:
safe-outputs.create-discussionsafe-outputs.create-issuesafe-outputs.add-commentwithdiscussion: trueBehavior
Validation is graceful:
Error messages specify the missing feature and remediation:
Testing
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.