Skip to content

ci: add CODEOWNERS and fix Unit Tests check for required status checks#104

Merged
tarun-etikala merged 3 commits into
red-hat-data-services:mainfrom
tarun-etikala:add-codeowners
May 18, 2026
Merged

ci: add CODEOWNERS and fix Unit Tests check for required status checks#104
tarun-etikala merged 3 commits into
red-hat-data-services:mainfrom
tarun-etikala:add-codeowners

Conversation

@tarun-etikala
Copy link
Copy Markdown
Contributor

@tarun-etikala tarun-etikala commented May 18, 2026

Description

Two changes to support the new repo-level ruleset ("Require reviews"):

  1. Adds .github/CODEOWNERS — assigns @red-hat-data-services/agentic-starter-kits-maintainers as code owners for all files, activating the require_code_owner_review rule so at least one team member must approve every PR.

  2. Updates agent-tests.yml — the ruleset requires the Unit Tests check to pass, but the workflow previously used path-based triggers (paths: ['agents/**']), so PRs not touching agent files never reported the check, leaving it pending indefinitely. The workflow now always runs but skips the expensive test steps (Python setup, uv, test execution) when no agents/ files changed.

Jira Ticket

RHAIENG-4065

Testing

  • No testing required (documentation/config change only)

After merge:

  • Open a test PR touching non-agent files and confirm Unit Tests check passes (skipped) and review is requested from agentic-starter-kits-maintainers
  • Open a test PR touching agents/ and confirm tests actually run

Checklist

  • I have read CONTRIBUTING.md
  • No .env or secret files are included in this PR
  • All changes are within scope of the linked Jira ticket (if not, explain in Description)

Review Guidance

  • .github/CODEOWNERS — single line, confirm the team name matches the GitHub team
  • .github/workflows/agent-tests.yml — removed paths trigger, added a changes step that sets agents=true only when agents/ files are modified; all subsequent steps are gated on that output

Related PRs

Assigns agentic-starter-kits-maintainers as code owners for all files,
enabling the require_code_owner_review rule in the repo-level ruleset.

Ref: RHAIENG-4065

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a repository-wide CODEOWNERS rule assigning * to the maintainers group; updates the agent-tests workflow to restrict PR triggers to main, add an in-job "Check for agent changes" that gates Setup/Install/Run test steps on edits under agents/**, and tighten the publish-report condition.

Changes

Repository ownership

Layer / File(s) Summary
Repository ownership configuration
.github/CODEOWNERS
Adds a CODEOWNERS entry assigning repository-wide ownership (*) to @red-hat-data-services/agentic-starter-kits-maintainers.

Agent tests workflow

Layer / File(s) Summary
PR trigger branch filter
.github/workflows/agent-tests.yml
Adds pull_request filter branches: [main] so the workflow triggers only for PRs targeting main.
Changes detection and gating
.github/workflows/agent-tests.yml
Adds an in-job “Check for agent changes” step that diffs the PR base for agents/ paths and exposes agents output; Setup Python, Install uv, and Run tests are conditioned on steps.changes.outputs.agents == 'true'.
Publish report condition
.github/workflows/agent-tests.yml
Modifies the publish step condition to require that the Run tests step was not skipped (steps.run-tests.outcome != 'skipped').

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title accurately summarizes the main changes: adding CODEOWNERS and fixing the Unit Tests workflow to report status on all PRs.
Description check ✅ Passed The description clearly explains both changes, their purpose for the repo-level ruleset, testing strategy, and includes a related Jira ticket reference.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

The repo-level ruleset requires the "Unit Tests" check to pass before
merge. With path filtering, PRs that don't touch agents/ never ran the
workflow, leaving the check pending indefinitely. Replace the path
filter with dorny/paths-filter and add a skip job that reports success
when no agent files changed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added size/s and removed size/xs labels May 18, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/agent-tests.yml (1)

115-123: ⚡ Quick win

Consider documenting the duplicate job name pattern.

Both the test and skip jobs share the name "Unit Tests" to ensure that one always runs and reports to GitHub's required status check, preventing it from remaining pending. While this is a known workaround pattern and the mutually exclusive conditions ensure correctness, it can be confusing for maintainers unfamiliar with this approach.

📝 Suggested improvement: Add a clarifying comment
+  # Note: Both 'test' and 'skip' jobs are named "Unit Tests" so that one always runs
+  # and satisfies the required status check, preventing it from staying pending.
   skip:
     name: Unit Tests
     needs: changes
     if: needs.changes.outputs.agents != 'true'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/agent-tests.yml around lines 115 - 123, Add a short
clarifying comment to the GitHub Actions workflow explaining why the 'test' and
'skip' jobs both use the same name "Unit Tests" (the duplicate-name pattern
ensures a required status check is always reported and prevents a pending check
when one branch of the conditional is skipped); place this comment near the job
definitions for the 'test' and 'skip' jobs in agent-tests.yml so future
maintainers see the rationale next to the name "Unit Tests" and the conditional
logic (needs.changes.outputs.agents and if conditions).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In @.github/workflows/agent-tests.yml:
- Around line 115-123: Add a short clarifying comment to the GitHub Actions
workflow explaining why the 'test' and 'skip' jobs both use the same name "Unit
Tests" (the duplicate-name pattern ensures a required status check is always
reported and prevents a pending check when one branch of the conditional is
skipped); place this comment near the job definitions for the 'test' and 'skip'
jobs in agent-tests.yml so future maintainers see the rationale next to the name
"Unit Tests" and the conditional logic (needs.changes.outputs.agents and if
conditions).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: e0187807-9872-4d5a-a3fe-b86556799e5c

📥 Commits

Reviewing files that changed from the base of the PR and between 797c2b7 and b4ef188.

📒 Files selected for processing (1)
  • .github/workflows/agent-tests.yml

Two jobs with the same display name caused duplicate checks on PRs.
Consolidate into a single "Unit Tests" job that always runs but skips
the test steps when no agent files changed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tarun-etikala tarun-etikala changed the title ci: add CODEOWNERS for team-based review enforcement ci: add CODEOWNERS and fix Unit Tests check for required status checks May 18, 2026
@tarun-etikala
Copy link
Copy Markdown
Contributor Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

Copy link
Copy Markdown
Contributor

@mpk-droid mpk-droid left a comment

Choose a reason for hiding this comment

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

Lgtm

@tarun-etikala tarun-etikala merged commit 84444c9 into red-hat-data-services:main May 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants