Add git hooks and DESIGN.md to protected-files defaults and sync docs#28127
Add git hooks and DESIGN.md to protected-files defaults and sync docs#28127
Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/498c782f-ccc3-4b74-be23-768f00cd8a46 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot maintain the list of protected files/paths in the docs too |
There was a problem hiding this comment.
Pull request overview
Updates the workflow safe-outputs “protected files” defaults to cover design documentation and repository-tracked git hook scripts, and extends tests to validate the new defaults.
Changes:
- Add
DESIGN.mdto the default protected file basenames. - Add
.githooks/and.husky/to the default protected path prefixes. - Update/create focused tests to assert these new defaults in generated configs.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/runtime_definitions.go | Extends default protected basenames and path prefixes (DESIGN.md, .githooks/, .husky/). |
| pkg/workflow/safe_outputs_config_generation_test.go | Asserts new defaults appear in generated create_pull_request safe-outputs config. |
| pkg/workflow/compiler_safe_outputs_config_test.go | Updates protected-files exclusion test expectations and adds assertions for default protected path prefixes. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 1
| ppStrings := make([]string, 0, len(ppAny)) | ||
| for _, v := range ppAny { | ||
| if s, ok := v.(string); ok { | ||
| ppStrings = append(ppStrings, s) | ||
| } | ||
| } |
There was a problem hiding this comment.
The conversion of protected_path_prefixes from []any to []string silently drops non-string values (if s, ok := v.(string); ok { ... }). This can mask a serialization/type regression in the config. Consider asserting each element is a string (fail fast) and/or using a small helper to parse []any -> []string to avoid duplicating this pattern.
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/cdb6ed80-8a2f-41d2-87cf-190b85ad753e Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/cdb6ed80-8a2f-41d2-87cf-190b85ad753e Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/cdb6ed80-8a2f-41d2-87cf-190b85ad753e Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This PR expands the default protected-files coverage for safe outputs and keeps the reference documentation aligned with those defaults.
Changes Made
DESIGN.mdto the default basename-protected files..githooks/and.husky/to default protected path prefixes.docs/src/content/docs/reference/safe-outputs-pull-requests.mdso the protected files/paths list matches runtime behavior.Validation
make agent-finishand captured pre-existing unrelated baseline failures.