Skip to content

chore(ci): replace Dosu stale and size labeling with native workflows - #2504

Merged
Andrei Kvapil (kvaps) merged 3 commits into
mainfrom
chore/replace-dosu-stale-size
May 1, 2026
Merged

chore(ci): replace Dosu stale and size labeling with native workflows#2504
Andrei Kvapil (kvaps) merged 3 commits into
mainfrom
chore/replace-dosu-stale-size

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Replace Dosu's stale-management and PR-size labeling with native GitHub Actions ahead of disabling the Dosu app on this repo, and migrate the six size:* labels to the canonical size/* namespace while we're rewriting the sizing path.

Background: Dosu (the SaaS) currently writes lifecycle/stale lifecycle and size:* labels via its bot. Audit of .github/workflows/ (full grep) confirmed zero hard dependencies on Dosu's outputs — backport* is human-applied, release is auto-applied by tags.yaml itself, and nothing else consumes Dosu-applied labels in any workflow.

.github/workflows/stale.yaml (new)

Daily cron at 04:37 UTC plus manual dispatch. Uses actions/stale@v10:

  • Stale after 60 days idle: applies lifecycle/stale.
  • Closes 14 days later, applying lifecycle/rotten.
  • remove-stale-when-updated: true — activity un-stales automatically.
  • 100 ops/run.

Issue and PR exempt lists differ on purpose: an accepted issue (triage/accepted) is a known long-tail task, not stale; a held PR (do-not-merge/hold) is paused intentionally. Priority/security/regression labels protect issues someone explicitly decided to keep visible.

.github/workflows/pr-size.yaml (new)

Triggers on opened, synchronize, reopened (pull_request_target). Inline actions/github-script@v7 — no third-party labeler dependency. Diff-line count with thresholds matching the descriptions in .github/labels.yml:

label lines
size/XS 0–9
size/S 10–29
size/M 30–99
size/L 100–499
size/XL 500–999
size/XXL 1000+

Inline ignore patterns skip:

  • vendored Go deps (vendor/**)
  • kubebuilder/openapi inline generated files (zz_generated.{deepcopy,conversion,defaults,openapi}.go)
  • whole code-generated trees: any path under generated/, plus *.pb.go
  • vendored Helm charts (packages/system/*/charts/**)
  • lockfiles (go.sum, *.lock, *.lockb)

Concurrency group keyed on PR number with cancel-in-progress: true (latest push wins). removeLabel is wrapped in try/catch tolerating 404 for races between event payload and execution.

size:size/ namespace migration

The legacy size:X (colon) form was an artefact of the previous sizing bot; with that bot being replaced and every other label namespace in the repo using slashes (kind/, area/, priority/, triage/, lifecycle/, do-not-merge/, security/), size/ is the consistent form. Migration via aliases in labels.yml — IDs preserved, every existing labelled PR follows the rename automatically.

The new pr-size.yaml emits size/* from day 1 and accepts both prefixes when looking up the previous size label, to handle the brief window between merge and the next labels-sync run.

Out of scope (intentional)

  • lgtm replacement — deferred. 33/33 of lgtm events in the last 100 PRs come from Dosu; humans never apply it manually. Whether reviewers actually rely on it is unclear — observe for 7 days post-Dosu-disable before adding a pull_request_review-on-approve workflow.
  • LLM-based issue auto-classification (kind/bug/kind/feature on inbound issues) — accepted loss; manual triage replaces.
  • Cleanup of wontfix/invalid in labels.yml — separate cleanup PR.

Release note

NONE

Summary by CodeRabbit

  • New Features

    • Pull requests now automatically receive size labels (XS, S, M, L, XL, XXL) based on lines changed.
    • Issues and pull requests are automatically marked as stale after 60 days of inactivity and closed 14 days later if still inactive.
  • Chores

    • PR size label namespace updated to a slash-based format (size/...) while preserving the old names as aliases for backward compatibility.

Add two GitHub-native workflows ahead of disabling the Dosu app and
migrate size labels to canonical k8s namespacing.

- .github/workflows/stale.yaml uses actions/stale@v10 to manage the
  lifecycle/stale and lifecycle/rotten lifecycle. Daily cron, 60d
  before stale, 14d before close. Issue/PR exempt lists differ on
  purpose: an accepted issue (triage/accepted) is a known long-tail
  task, not stale; a held PR (do-not-merge/hold) is paused
  intentionally. Priority/security/regression labels protect issues
  someone explicitly decided to keep visible.

- .github/workflows/pr-size.yaml uses actions/github-script@v7 to
  apply size/* labels based on diff line count. Thresholds match the
  descriptions in .github/labels.yml. Inline ignore patterns skip
  vendored deps, kubebuilder/openapi inline generated files
  (zz_generated.{deepcopy,conversion,defaults,openapi}.go), whole
  code-generated trees (any path under generated/ or *.pb.go),
  vendored Helm charts, and lockfiles. Concurrency group keyed on PR
  number with cancel-in-progress: true. removeLabel is wrapped in
  try/catch tolerating 404 for races between event payload and
  execution.

- Migrate the six size labels from legacy 'size:X' (colon) to
  canonical 'size/X' (slash) via aliases in .github/labels.yml. The
  colon form was an artefact of the previous sizing bot's output;
  with the bot replaced and namespacing already used everywhere else
  (kind/, area/, priority/, triage/, lifecycle/, do-not-merge/,
  security/), the slash form aligns with the rest of the scheme. The
  alias migration preserves IDs and keeps every existing labelled PR
  pointing at the renamed entry.

  pr-size.yaml emits the new 'size/' form from day 1 and accepts
  either prefix when looking up the previous size label, to handle
  the brief window between PR merge and the labels-sync run.

Verification of zero hard dependencies on Dosu in workflows: only
backport.yaml (consumes backport*, applied by humans only) and
pull-requests*.yaml + tags.yaml (consume release, applied by tags
workflow itself) — none of those labels come from Dosu.

The lgtm label (33/33 in last 100 PRs from Dosu, none from humans)
is intentionally not replaced in this PR — observe reviewer
behaviour for 7 days after Dosu is disabled and decide whether a
pull_request_review-on-approve workflow is needed.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@dosubot dosubot Bot added the size/XS This PR changes 0-9 lines, ignoring generated files label Apr 27, 2026
@github-actions github-actions Bot added area/ci Issues or PRs related to CI workflows, GitHub Actions, automation kind/cleanup Categorizes issue or PR as related to cleanup of code, process, or technical debt labels Apr 27, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request modernizes the repository's automation infrastructure by transitioning from the Dosu SaaS platform to native GitHub Actions. The changes establish new workflows for stale issue management and automated PR size labeling, while simultaneously standardizing the label naming convention to align with the repository's existing taxonomy.

Highlights

  • Native GitHub Actions Migration: Replaced Dosu-based stale management and PR sizing with native GitHub Actions workflows to reduce third-party dependencies.
  • Label Namespace Standardization: Migrated legacy 'size:X' labels to the canonical 'size/*' namespace, utilizing label aliases to ensure existing PRs maintain their metadata.
  • Automated PR Sizing: Implemented a new 'pr-size.yaml' workflow that calculates PR size based on diff-line counts while excluding generated files and vendored dependencies.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Ignored Files
  • Ignored by pattern: .github/workflows/** (2)
    • .github/workflows/pr-size.yaml
    • .github/workflows/stale.yaml
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai

coderabbitai Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 722c40e9-b5bb-4830-9c56-072e8942cde2

📥 Commits

Reviewing files that changed from the base of the PR and between bc6d147 and 1d938a8.

📒 Files selected for processing (1)
  • .github/workflows/stale.yaml
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/stale.yaml

📝 Walkthrough

Walkthrough

Renames PR size labels from size:* to size/* (with aliases), adds a workflow that computes and applies PR size labels based on changed lines (filtering ignored paths), and adds a scheduled stale issue/PR management workflow.

Changes

Cohort / File(s) Summary
Label Definition Rename
.github/labels.yml
Renamed six PR size labels from size:XS/S/M/L/XL/XXL to size/XS/S/M/L/XL/XXL, adding aliases entries to preserve the old size:* names and removed the old top-level size:* definitions.
PR Size Automation
.github/workflows/pr-size.yaml
New workflow (pull_request_target) that paginates PR files, filters ignored paths (vendored, generated, *.pb.go, Helm charts, lockfiles, go.sum), sums additions+deletions, chooses a size bucket (XS ≤9, S ≤29, M ≤99, L ≤499, XL ≤999, XXL >999), removes non-target size labels and applies the computed size/{bucket} label.
Stale Management
.github/workflows/stale.yaml
New scheduled workflow using actions/stale@v10 to mark issues/PRs stale after 60 days, close after 14 more days, with exempt labels, removal of stale on activity, and custom notification messages.

Sequence Diagram

sequenceDiagram
    participant GitHub as GitHub
    participant Runner as Workflow Runner
    participant API as GitHub API

    GitHub->>Runner: PR opened/synchronized/reopened
    Runner->>API: List PR files (paginated)
    loop per page
        API-->>Runner: File batch (path, additions, deletions)
    end
    Runner->>Runner: Filter ignored paths (vendored, generated, *.pb.go, charts, lockfiles, go.sum)
    Runner->>Runner: Sum additions+deletions → totalLines
    Runner->>Runner: Map totalLines → sizeBucket (XS/S/M/L/XL/XXL)
    Runner->>API: Get PR labels
    API-->>Runner: Current labels
    Runner->>Runner: Determine labels to remove (legacy/current non-target)
    alt target label not sole size label
        Runner->>API: Remove non-target size labels
        Runner->>API: Add `size/{bucket}` label
    else
        Runner->>Runner: No label change
    end
    Runner-->>GitHub: Label updated or unchanged
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~18 minutes

Poem

🐰 I tally hops and tiny lines today,
Slash-sized labels hop in bright array,
A workflow counts each nibble, patch, and fix,
Old names aliased in the garden mix,
Stale threads tucked gently—time for a nap. 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: replacing Dosu-managed stale and size labeling with native GitHub Actions workflows, which is the primary objective of this PR.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/replace-dosu-stale-size

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Build job hit an OCI registry race on the ubuntu-container-disk:latest
manifest push ("Conflicted with another upload of the same manifest").
Empty commit to re-trigger.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.github/workflows/pr-size.yaml (1)

32-39: Optional: extend lockfile/ignore patterns for non-Go ecosystems.

path.endsWith('.lock') covers yarn.lock, Cargo.lock, Pipfile.lock, Gemfile.lock, poetry.lock, etc., and .lockb covers Bun — but the two most commonly auto-generated lockfiles in JS tooling, package-lock.json and pnpm-lock.yaml, won't match and will count toward the size bucket. Low priority for a Go-dominated repo, but cheap to add now.

♻️ Proposed extension
               path === 'go.sum' || path.endsWith('/go.sum') ||
-              path.endsWith('.lock') || path.endsWith('.lockb');
+              path.endsWith('.lock') || path.endsWith('.lockb') ||
+              path === 'package-lock.json' || path.endsWith('/package-lock.json') ||
+              path === 'pnpm-lock.yaml' || path.endsWith('/pnpm-lock.yaml');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/pr-size.yaml around lines 32 - 39, The isIgnored predicate
currently ignores generic .lock and .lockb files but misses common JS lockfiles;
update the isIgnored function to also return true for 'package-lock.json',
'pnpm-lock.yaml' and 'yarn.lock' (and optionally 'npm-shrinkwrap.json') so these
auto-generated lockfiles don't count toward PR size buckets—locate the isIgnored
arrow function in the diff and add path-based checks (e.g., path ===
'package-lock.json' or path.endsWith('pnpm-lock.yaml')) alongside the existing
.lock/.lockb checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/stale.yaml:
- Around line 32-37: The exempt-issue-labels list currently omits the
priority/important-longterm label so long-term important issues get auto-staled;
update the exempt-issue-labels value to include priority/important-longterm
alongside priority/critical-urgent and priority/important-soon (i.e., add
"priority/important-longterm" to the comma-separated list under
exempt-issue-labels) so those issues are protected from the stale workflow.

---

Nitpick comments:
In @.github/workflows/pr-size.yaml:
- Around line 32-39: The isIgnored predicate currently ignores generic .lock and
.lockb files but misses common JS lockfiles; update the isIgnored function to
also return true for 'package-lock.json', 'pnpm-lock.yaml' and 'yarn.lock' (and
optionally 'npm-shrinkwrap.json') so these auto-generated lockfiles don't count
toward PR size buckets—locate the isIgnored arrow function in the diff and add
path-based checks (e.g., path === 'package-lock.json' or
path.endsWith('pnpm-lock.yaml')) alongside the existing .lock/.lockb checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d26fc0c8-e541-41df-9602-909c16aca492

📥 Commits

Reviewing files that changed from the base of the PR and between bdf23e6 and bc6d147.

📒 Files selected for processing (3)
  • .github/labels.yml
  • .github/workflows/pr-size.yaml
  • .github/workflows/stale.yaml

Comment thread .github/workflows/stale.yaml

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request renames the PR size labels in .github/labels.yml from the size: prefix to size/ and updates the label descriptions to reference the new .github/workflows/pr-size.yaml workflow. Additionally, it adds aliases for the old label names to maintain backward compatibility. I have no feedback to provide.

Address review feedback from coderabbitai on .github/workflows/stale.yaml:37:
add priority/important-longterm to exempt-issue-labels. The label is
documented in labels.yml as "Important over the long term, but may
not be staffed and/or may need multiple releases to complete" — such
issues sit idle for 60+ days by design and must not be auto-staled.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
@kvaps
Andrei Kvapil (kvaps) merged commit 9432cdf into main May 1, 2026
11 checks passed
@kvaps
Andrei Kvapil (kvaps) deleted the chore/replace-dosu-stale-size branch May 1, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci Issues or PRs related to CI workflows, GitHub Actions, automation kind/cleanup Categorizes issue or PR as related to cleanup of code, process, or technical debt size/XS This PR changes 0-9 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants