Skip to content

Add git hooks and DESIGN.md to protected-files defaults and sync docs#28127

Merged
pelikhan merged 5 commits intomainfrom
copilot/add-git-hooks-and-design-md
Apr 23, 2026
Merged

Add git hooks and DESIGN.md to protected-files defaults and sync docs#28127
pelikhan merged 5 commits intomainfrom
copilot/add-git-hooks-and-design-md

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

This PR expands the default protected-files coverage for safe outputs and keeps the reference documentation aligned with those defaults.

Changes Made

  • Added DESIGN.md to the default basename-protected files.
  • Added .githooks/ and .husky/ to default protected path prefixes.
  • Updated focused workflow tests to assert the new protected file/path defaults.
  • Updated documentation in docs/src/content/docs/reference/safe-outputs-pull-requests.md so the protected files/paths list matches runtime behavior.

Validation

  • Ran formatting and focused tests for the changed workflow package files.
  • Ran make agent-finish and captured pre-existing unrelated baseline failures.
  • Ran parallel validation (Code Review + CodeQL).

Copilot AI requested a review from pelikhan April 23, 2026 16:12
@pelikhan pelikhan marked this pull request as ready for review April 23, 2026 16:28
Copilot AI review requested due to automatic review settings April 23, 2026 16:28
@pelikhan
Copy link
Copy Markdown
Collaborator

@copilot maintain the list of protected files/paths in the docs too

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.md to 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

Comment on lines +2396 to +2401
ppStrings := make([]string, 0, len(ppAny))
for _, v := range ppAny {
if s, ok := v.(string); ok {
ppStrings = append(ppStrings, s)
}
}
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
@github-actions github-actions Bot mentioned this pull request Apr 23, 2026
@pelikhan pelikhan merged commit 29591ed into main Apr 23, 2026
17 of 18 checks passed
@pelikhan pelikhan deleted the copilot/add-git-hooks-and-design-md branch April 23, 2026 16:39
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 23, 2026

@copilot maintain the list of protected files/paths in the docs too

Updated docs to keep the protected defaults list in sync: added DESIGN.md, .githooks/, and .husky/ in safe-outputs-pull-requests.md (commit a3b2960). No UI changes were involved.

Copilot AI changed the title Add git hooks and DESIGN.md to protected-files defaults Add git hooks and DESIGN.md to protected-files defaults and sync docs Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants