Conversation
… standardized report templates - Added clear expected behavior definitions for all 6 test modes: * all: all repos and objects accessible (min-integrity == none) * public: only public repos and objects accessible (min-integrity == none) * owner: only owner's repos and objects accessible (min-integrity == none) * repo: only single repo and objects accessible (min-integrity == none) * prefix: only prefix-matching repos and objects accessible (min-integrity == none) * multi: only repos matching criteria with merged objects (min-integrity == merged) - Added standardized markdown report templates for consistent output formatting - Updated test descriptions to clarify filtering expectations vs repository allowlist behavior - Enhanced validation criteria for each mode with proper pass/fail conditions This addresses the need for clear test expectations and consistent reporting across all GitHub Guard modes for better test automation and validation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Copilot test runner prompt generation for GitHub Guard modes to make expected behavior and output reporting more explicit and consistent across modes.
Changes:
- Rewrites per-mode prompt text to include clearer expected behavior definitions (scope + min-integrity).
- Introduces standardized Markdown report templates (tables + summary sections) for each mode.
- Refines validation guidance for global/user vs repo-scoped tool behavior in guarded modes.
Comments suppressed due to low confidence (6)
guards/github-guard/scripts/run_copilot_test.sh:1301
- The report template code fence is written as "```". Since backticks don't need escaping in a heredoc, this will leave stray backslashes in the prompt and break Markdown rendering/parsing; switch to plain triple backticks (and update the closing fence in this template too).
\`\`\`
# GitHub Guard Prefix-Only Mode Test Results
guards/github-guard/scripts/run_copilot_test.sh:766
- The report template uses escaped Markdown code fences ("```") inside the heredoc, which will render literal backslashes instead of starting/ending a code block. Use plain triple backticks in the generated prompt (and update the closing fence in the same template accordingly) so the report format is valid Markdown and easier to parse.
\`\`\`
# GitHub Guard All Mode Test Results
guards/github-guard/scripts/run_copilot_test.sh:1036
- The report template code fence is escaped as "```". This prevents the generated prompt from containing real Markdown code blocks; please use plain triple backticks here (and update the matching closing fence for this template).
\`\`\`
# GitHub Guard Owner-Only Mode Test Results
guards/github-guard/scripts/run_copilot_test.sh:1174
- The report template starts with an escaped code fence ("```") which will not render as a Markdown code block. Use plain triple backticks here (and ensure the closing fence in this template is updated to match).
\`\`\`
# GitHub Guard Repo-Only Mode Test Results
guards/github-guard/scripts/run_copilot_test.sh:1430
- The report template begins with an escaped Markdown fence ("```"). This will produce a literal backslash in the generated prompt and can break any tooling that expects a standard code block; use plain triple backticks here (and update the closing fence accordingly).
\`\`\`
# GitHub Guard Multi-Only Mode Test Results
guards/github-guard/scripts/run_copilot_test.sh:772
- The all-mode report template hardcodes the "Private Repository" as lpcox/github-guard. Since the runner already has a configurable ${DIFC_SCOPE} (and derives owner/repo from it), consider using ${DIFC_SCOPE} here so the template stays accurate when the test scope repo is overridden.
- **Policy**: ${ALLOW_ONLY_ALL_POLICY}
- **Private Repository**: lpcox/github-guard
- **Public Repository**: octocat/Hello-World
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…r' in all-mode prompt Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
…de report templates Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
…lates Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.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.
Problem
The current copilot test prompts lack clear expected behavior definitions for each GitHub Guard mode, leading to inconsistent testing and unclear pass/fail criteria. Test output formatting was also inconsistent across different modes.
Solution
This PR updates
scripts/run_copilot_test.shwith:1. Clear Expected Behavior Definitions for All 6 Modes:
2. Standardized Markdown Report Templates
Each mode now includes a consistent report template with:
3. Enhanced Validation Criteria
Benefits
Testing
The updated test expectations have been verified against the behavior matrix:
Files Changed
guards/github-guard/scripts/run_copilot_test.sh: Updated all 6 test mode definitions with proper expectations and report templatesThis addresses the need for clear, consistent test expectations across all GitHub Guard modes.