task: Add FilesCheck option to breaking check#227
Open
hound672 wants to merge 3 commits into
Open
Conversation
Member
|
Стоит обновить валидатор и генерацию схемы конфига. |
There was a problem hiding this comment.
Pull request overview
Adds an opt-in “FilesCheck” mode to the breaking-change checker so that moving protobuf entities between .proto files can be treated as a breaking change, and wires this option through config and core initialization.
Changes:
- Introduces
filesChecksupport inBreakingCheckerand emits new “moved” issues for services/messages/oneofs/enums when enabled. - Extends breaking-check configuration to accept a
breaking.uselist (e.g.FILES_CHECK) and maps it intocore.BreakingCheckConfig.FilesCheck. - Updates the example config to demonstrate enabling
FILES_CHECK.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/core/breaking_checker.go | Adds optional file-move detection and new “moved” issue constructors. |
| internal/core/breaking_check.go | Adds config constant and threads FilesCheck into BreakingChecker. |
| internal/config/breaking_check.go | Extends YAML/JSON config model with use. |
| internal/api/temporaly_helper.go | Maps breaking.use into core.BreakingCheckConfig.FilesCheck. |
| example.easyp.yaml | Documents enabling FILES_CHECK in config. |
Comments suppressed due to low confidence (2)
internal/core/breaking_checker.go:264
hasFilesCheckErrorcomparesProtoFilePathvalues coming from different walkers: the on-disk walker yields paths relative tobreakingCheckRoot, while the git-tree walker yields repo-relative paths (e.g. with a subdir prefix whenbreakingCheckRootis not the repo root). WithfilesCheckenabled this will produce false “moved” issues for unchanged files. Normalize both paths to the same base (preferably repo-relative) before comparing, or adjust the git walker to report paths relative to the requested root/path so both sides match.
func (b *BreakingChecker) hasFilesCheckError(path1, path2 string) bool {
if b.filesCheck && path1 != path2 {
return true
}
return false
}
internal/core/breaking_checker.go:447
- These new “moved” issue messages include a trailing newline (
\n), but the text formatter already appends\nwhen printing each issue. This will introduce extra blank lines in text output; consider removing the trailing newline from the message strings for consistency with most existing breaking-check messages.
message := fmt.Sprintf(
"Previously present Message \"%s\" was moved from \"%s\" file to \"%s\" file\n",
againstMessage.MessagePath,
againstMessage.ProtoFilePath,
currentMessage.ProtoFilePath,
)
return buildBreakingCheckIssue(againstMessage.ProtoFilePath, message, againstMessage.Meta.Pos)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+7
to
9
| AgainstGitRef string `json:"against_git_ref,omitempty" yaml:"against_git_ref,omitempty"` | ||
| Use []string `json:"use,omitempty" yaml:"use,omitempty"` | ||
| } |
Comment on lines
+91
to
+95
| if b.hasFilesCheckError(currentService.ProtoFilePath, againstService.ProtoFilePath) { | ||
| issue := getServiceMovedIssue(currentService, againstService) | ||
| res = append(res, issue) | ||
| } | ||
|
|
Yakwilik
approved these changes
May 18, 2026
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.
No description provided.