-
Notifications
You must be signed in to change notification settings - Fork 33
feat(ci): Add scheduled GitHub Action to create issues for stale components #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e624b41
ce63d00
0299356
ddeee94
6503710
84668ee
78728ec
c460145
2539ad7
c631bb6
02011e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| - 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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # Stale component handler module |
| 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
|
||||||||||||||||||
| **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 %} |
| 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 |
There was a problem hiding this comment.
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.