Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/go-pr-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ on:
description: 'Directory depth level to extract app name'
type: number
default: 2
normalize_to_filter:
description: 'Collapse every changed file under a filter_paths entry into that one component (working_dir = the filter itself), instead of the path_level-trimmed directory. Default true: without it, a change deeper than path_level segments inside a filtered component (e.g. "apps/dict/components/hub/api/services/command/x.go" under the filter "apps/dict/components/hub/api") spawns a bogus matrix entry rooted at that subdirectory, where no Makefile and no testable package exist — so no coverage.txt is produced, the upload finds no file, and the coverage job fails with "Artifact not found". Mirrors the same input in frontend-pr-analysis.yml.'
type: boolean
default: true
app_name_prefix:
description: 'Prefix for app names in matrix output'
type: string
Expand Down Expand Up @@ -129,6 +133,7 @@ jobs:
path-level: ${{ inputs.path_level }}
get-app-name: 'true'
app-name-prefix: ${{ inputs.app_name_prefix }}
normalize-to-filter: ${{ inputs.normalize_to_filter }}
fallback-app-name: ${{ inputs.app_name_prefix != '' && inputs.app_name_prefix || 'app' }}

# ============================================
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/go-pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ on:
description: 'Directory depth level to extract the component name from filter_paths'
type: number
default: 2
normalize_to_filter:
description: 'Collapse every changed file under a filter_paths entry into that one component (working_dir = the filter itself) instead of the path_level-trimmed directory. Forwarded to go-pr-analysis; see that workflow for why the default is true.'
type: boolean
default: true
coverage_threshold:
description: 'Minimum coverage percentage required (0-100)'
type: number
Expand Down Expand Up @@ -272,6 +276,7 @@ jobs:
app_name_prefix: ${{ inputs.app_name_prefix }}
filter_paths: ${{ inputs.filter_paths }}
path_level: ${{ inputs.path_level }}
normalize_to_filter: ${{ inputs.normalize_to_filter }}
coverage_threshold: ${{ inputs.coverage_threshold }}
fail_on_coverage_threshold: ${{ inputs.fail_on_coverage_threshold }}
go_private_modules: ${{ inputs.go_private_modules }}
Expand Down
1 change: 1 addition & 0 deletions docs/go-pr-analysis-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ jobs:
| `runner_type` | GitHub runner type | No | `firmino-lxc-runners` |
| `filter_paths` | JSON array of paths to monitor for changes. If empty, treats repo as single-app. | No | `''` |
| `path_level` | Directory depth level to extract app name | No | `2` |
| `normalize_to_filter` | Collapse every changed file under a `filter_paths` entry into that one component (`working_dir` = the filter itself) instead of the `path_level`-trimmed directory. With `false`, a change deeper than `path_level` segments inside a filtered component spawns a bogus matrix entry rooted at that subdirectory — no testable package, so no `coverage.txt`, and the coverage job fails with "Artifact not found". | No | `true` |
| `app_name_prefix` | Prefix for app names in matrix output | No | `''` |
| `go_version` | Go version to use | No | `1.23` |
| `golangci_lint_version` | GolangCI-Lint version | No | `v1.62.2` |
Expand Down
1 change: 1 addition & 0 deletions docs/go-pr-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ The `go-analysis`, `security` and `lib-version` pipelines each have a `*-gate` a
| `app_name_prefix` | Prefix used to namespace coverage/build artifacts | string | `''` |
| `filter_paths` | Newline-separated component path prefixes for monorepo per-component analysis (lint/tests/coverage) **and** security scanning; empty = single-app root run. When using it for security, leave `dockerfile_path` empty so each component Dockerfile is discovered | string | `''` |
| `path_level` | Directory depth level to extract the component name from `filter_paths` | number | `2` |
| `normalize_to_filter` | Collapse every changed file under a `filter_paths` entry into that one component instead of the `path_level`-trimmed directory; forwarded to `go-pr-analysis` | boolean | `true` |
| `coverage_threshold` | Minimum coverage percentage (0-100) | number | `80` |
| `fail_on_coverage_threshold` | Fail when coverage is below threshold | boolean | `true` |
| `go_private_modules` | GOPRIVATE pattern for private modules | string | `''` |
Expand Down
Loading