Conversation
…g Coverage and Lint.
tailor.Metric to output metrics including Coverage and Lint.
This comment has been minimized.
This comment has been minimized.
tailor.Metric to output metrics including Coverage and Lint.metrics output
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR modifies the structure of tailor.Metric to enhance metrics output functionality and adds new coverage and lint metrics reporting capabilities.
- Replace
Descriptionfield withKey,Unit, andErrorfields in the Metric struct - Add coverage percentage and lint warnings total metrics to metrics output
- Enhance metrics command with table formatting, lint warnings display, and octocov format output support
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tailor/metrics.go | Updates Metric struct fields and adds coverage/lint metrics computation |
| tailor/metrics_test.go | Updates all test cases to use new Metric struct field names and adds coverage for new metrics |
| cmd/metrics.go | Enhances metrics command with table output, coverage reports, lint warnings, and octocov format support |
| cmd/coverage.go | Adds division by zero protection for coverage calculations |
| go.mod | Adds tablewriter dependency and updates existing dependencies |
| README.md | Updates documentation to reflect new metrics structure and command options |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
toiroakr
reviewed
Sep 11, 2025
Comment on lines
+641
to
+651
| expectedKeys := map[string]string{ | ||
| "pipeline_resolver_step_coverage_percentage": "pipeline_resolver_step_coverage_percentage", | ||
| "lint_warnings_total": "lint_warnings_total", | ||
| "pipelines_total": "pipelines_total", | ||
| "pipeline_resolvers_total": "pipeline_resolvers_total", | ||
| "pipeline_resolver_steps_total": "pipeline_resolver_steps_total", | ||
| "pipeline_resolver_execution_paths_total": "pipeline_resolver_execution_paths_total", | ||
| "tailordbs_total": "tailordbs_total", | ||
| "tailordb_types_total": "tailordb_types_total", | ||
| "tailordb_type_fields_total": "tailordb_type_fields_total", | ||
| "stateflows_total": "stateflows_total", |
There was a problem hiding this comment.
What does it tests here?
If testing metric.Key is in expected key set:
expectedKeys := map[string]struct{}{
"pipeline_resolver_step_coverage_percentage": struct{}{},
...
}
for _, metric := range metrics {
_, exists := expectedKeys[metric.Key]
if !exists {
t.Errorf("Unexpected metric: %s", metric.Key)
}
// `if expectedKey != metric.Key` is not needed
}
Contributor
Author
There was a problem hiding this comment.
The purpose of the Name field had changed, making the test unnecessary.
This comment has been minimized.
This comment has been minimized.
Contributor
Code Metrics Report
Details | | main (b4d7b80) | #27 (77bc9c1) | +/- |
|---------------------|----------------|---------------|-------|
- | Coverage | 32.5% | 30.7% | -1.8% |
| Files | 12 | 12 | 0 |
| Lines | 406 | 481 | +75 |
+ | Covered | 132 | 148 | +16 |
- | Code to Test Ratio | 1:1.7 | 1:1.4 | -0.3 |
| Code | 1142 | 1345 | +203 |
- | Test | 1970 | 1924 | -46 |
+ | Test Execution Time | 8s | 3s | -5s |Code coverage of files in pull request scope (32.1% → 27.1%)
Reported by octocov |
toiroakr
approved these changes
Sep 11, 2025
Contributor
Author
|
@toiroakr Thank you! |
Merged
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.
tailor.Metric