Conversation
9189ac8 to
ef0ae7e
Compare
ef0ae7e to
1746039
Compare
95a3c84 to
76392de
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new codeowners-review-analysis action that helps PR authors understand the CODEOWNERS review requirements for their changes by analyzing changed files against patterns and current review status.
- Adds a complete GitHub Action that parses CODEOWNERS files and matches them against PR changed files
- Implements CODEOWNERS pattern matching logic translated from the hmarr/codeowners Go library
- Provides both workflow summary and optional PR comment outputs showing review status
Reviewed Changes
Copilot reviewed 22 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| actions/codeowners-review-analysis/action.yml | Action definition with post-comment input parameter |
| actions/codeowners-review-analysis/src/run.ts | Main orchestration logic that coordinates file analysis and review status |
| actions/codeowners-review-analysis/src/codeowners-pattern.ts | CODEOWNERS pattern matching implementation translated from Go |
| actions/codeowners-review-analysis/src/github-gql.ts | GraphQL queries to fetch PR review status and decisions |
| actions/codeowners-review-analysis/src/strings.ts | Markdown formatting functions for summary and PR comments |
| actions/codeowners-review-analysis/src/review-status.ts | Review state management and precedence logic |
| actions/codeowners-review-analysis/src/github.ts | REST API interactions for files, comments, and repository data |
| actions/codeowners-review-analysis/src/codeowners.ts | CODEOWNERS file parsing and file-to-pattern matching |
| actions/codeowners-review-analysis/src/run-inputs.ts | Input parsing and context validation |
| actions/codeowners-review-analysis/src/index.ts | Entry point that calls the main run function |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
actions/codeowners-review-analysis/src/run-inputs.ts:1
- Typo in 'currrent' should be 'current'.
import * as core from "@actions/core";
actions/codeowners-review-analysis/src/run.ts:1
- Typo in 'currrent' should be 'current'.
import * as github from "@actions/github";
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| on paths." | ||
|
|
||
| runs: | ||
| using: "node20" |
There was a problem hiding this comment.
| using: "node20" | |
| using: node24 |
There was a problem hiding this comment.
I have not tested anything w/ node24 yet. Will leave this as node20 for now, and maybe we can update most of our actions to node24 in one big swoop.
This adds a
codeowners-review-analysisaction which helps PR authors understand theCODEOWNERSreview requirements for their changes.High-level overview
This action does the following:
Testing
I tested here: https://github.com/smartcontractkit/releng-test/pull/138#issuecomment-3286728832 (and locally using
scripts/test.sh)Triggering
I did some preliminary testing via org-wide ruleset here: smartcontractkit/gha-org-workflows#17
Basically you can only operate on top-level
pull_requestevents, not sub events likepr.labeled, or different top-level eventsissue_comment. So if this is implemented org-wide it won't be seamless to trigger.Current Flow w/ Org-wide ruleset:
analyze-reviewslabel to their PR and pushes a new commit.This could look better if we added the workflow at the repo level, as we could have it trigger via comments, or labels, but then we need to maintain it to some degree. This is feasible because there's not that many repos where shared ownership makes codeowners hunting difficult.
Notes
Include minimal unit tests - will follow up w/ these in another PR.
DX-1787