Skip to content
Open
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
38 changes: 38 additions & 0 deletions .github/scripts/stale_component_handler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Stale Component Handler

Handles components approaching or past their verification deadline.

## What it Does

1. Uses `scripts/check_component_freshness` to categorize components:
- 🟡 **Warning (270-360 days)**: Creates GitHub issues to notify owners
- 🔴 **Stale (>360 days)**: Creates PRs to remove the component

2. For **warning** components:
- Creates issues with `stale-component` label
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.

We need to make sure that this label exists.

- Assigns component owners (up to 10)
- Includes instructions for verification

3. For **stale** components:
- Creates a branch `remove-stale-{component-name}`
- Removes the component directory
- Regenerates the category README to update the index
- Opens a PR with `stale-component-removal` label
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.

We need to make sure that this label exists.

- Adds component owners as reviewers

## Usage

```bash
# Dry run (see what would be created)
uv run .github/scripts/stale_component_handler/stale_component_handler.py \
--repo owner/repo --dry-run

# Create issues and PRs
GITHUB_TOKEN=ghp_xxx uv run .github/scripts/stale_component_handler/stale_component_handler.py \
--repo owner/repo
```

## Requirements

- `gh` CLI (pre-installed on GitHub Actions runners)
- `GITHUB_TOKEN` with `issues: write`, `contents: write`, `pull-requests: write` permissions
1 change: 1 addition & 0 deletions .github/scripts/stale_component_handler/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Stale component handler module
28 changes: 28 additions & 0 deletions .github/scripts/stale_component_handler/issue_body.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Component Verification Required

The component **{{ name }}** has not been verified in {{ age_days }} days and is approaching the staleness threshold.

**If not verified within the next {{ 360 - age_days }} days, a PR will be created to remove this component.**
Comment on lines +4 to +5
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

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

issue_body.md.j2 computes 360 - age_days to show “days remaining”. For fully stale components (age_days > 360) this becomes negative, producing misleading instructions (e.g., “within the next -40 days”). Either avoid creating this warning issue for fully-stale components, or adjust the template to handle age_days >= 360 with different messaging / a max(0, …) style calculation.

Suggested change
**If not verified within the next {{ 360 - age_days }} days, a PR will be created to remove this component.**
{% if age_days < 360 %}
**If not verified within the next {{ 360 - age_days }} days, a PR will be created to remove this component.**
{% else %}
**This component has exceeded the staleness threshold, and a PR may be created at any time to remove this component if it is not re-verified.**
{% endif %}

Copilot uses AI. Check for mistakes.

| Field | Value |
|-------------------------|---------------------|
| Path | `{{ path }}` |
| Last Verified | {{ last_verified }} |
| Days Since Verification | {{ age_days }} |

### Maintainers

{{ owners_mention }}

### How to Resolve

1. Verify the component still works with the current KFP version
2. Run any associated tests
3. Update `lastVerified` in `{{ path }}/metadata.yaml`:

```yaml
lastVerified: {{ today }}
```

4. Submit a PR with the updated metadata

34 changes: 34 additions & 0 deletions .github/scripts/stale_component_handler/removal_pr_body.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Stale Component Removal

This PR removes the component **{{ name }}** which has not been verified in {{ age_days }} days.

| Field | Value |
|-------------------------|---------------------|
| Path | `{{ path }}` |
| Last Verified | {{ last_verified }} |
| Days Since Verification | {{ age_days }} |

### Changes

- Removes `{{ path }}/` directory
- Updates category README to remove component from index

### Maintainers

{{ owners_mention }}

### Why This PR Was Created

Components must be verified at least once per year to ensure they remain functional and compatible with current KFP versions. This component has exceeded the staleness threshold and no verification was performed.

### Before Merging

If this component should be kept:
1. Close this PR
2. Verify the component still works
3. Update `lastVerified` in `{{ path }}/metadata.yaml`
4. Submit a PR with the updated metadata

If this component should be removed:
1. Review the changes
2. Approve and merge this PR
Loading