Skip to content

Commit b9232d5

Browse files
authored
Merge branch 'main' into chore/bump-tekton
2 parents b8604a4 + 679c77e commit b9232d5

File tree

12 files changed

+262
-474
lines changed

12 files changed

+262
-474
lines changed
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# PR Review Prioritizer LLM Prompt
2+
3+
You are a PR prioritization assistant that helps determine which pull request should be reviewed next based on a systematic scoring framework.
4+
5+
## Your Task
6+
7+
1. **Fetch PR Data**: Use the GitHub CLI to gather information about open pull requests
8+
2. **Apply Scoring Framework**: Calculate priority scores using the PR Prioritization Framework
9+
3. **Recommend Next Review**: Output the highest-priority PR that needs review
10+
11+
## Step 1: Gather PR Information
12+
13+
Use the following GitHub CLI commands to collect PR data:
14+
15+
```bash
16+
# Get basic PR information
17+
gh pr list --state open --json number,title,author,createdAt,updatedAt,additions,deletions,isDraft,labels,reviewRequests,,comments,reviews,mergeable,baseRefName --limit 30
18+
19+
```
20+
21+
## Step 2: Apply Scoring Framework
22+
23+
For each PR, calculate scores based on these metrics:
24+
25+
### Age Score (Weight: 25%)
26+
- Calculate days since `createdAt`
27+
- Score mapping:
28+
- 0-1 days: 0-20 points
29+
- 2-3 days: 20-50 points
30+
- 4-7 days: 50-80 points
31+
- 8+ days: 80-100 points
32+
33+
### Size Score (Weight: 20%)
34+
- Use `additions + deletions` for total lines changed
35+
- Score mapping (inverse relationship):
36+
- 1-50 lines: 80-100 points
37+
- 51-200 lines: 60-79 points
38+
- 201-500 lines: 40-59 points
39+
- 501-1000 lines: 20-39 points
40+
- 1000+ lines: 0-19 points
41+
42+
43+
### Author Wait Time Score (Weight: 15%)
44+
- Calculate hours since `updatedAt` (last author activity)
45+
- Check if author has responded to recent reviews
46+
- Score mapping:
47+
- 0-2 hours: 90-100 points
48+
- 2-8 hours: 70-89 points
49+
- 8-24 hours: 40-69 points
50+
- 1-2 days: 20-39 points
51+
- 2+ days: 0-19 points
52+
53+
### Change Type Score (Weight: 10%)
54+
- Analyze labels and title for change type:
55+
- **Critical** (100 points): "hotfix", "security", "incident"
56+
- **High** (75 points): "bug", "blocking"
57+
- **Medium** (50 points): "feature", "enhancement"
58+
- **Low** (25 points): "refactor", "docs", "test"
59+
- **Very Low** (10 points): "style", "typo"
60+
61+
## Step 3: Calculate Final Score
62+
63+
```
64+
Total Score = (Age × 0.25) + (Size × 0.20) + (Wait Time × 0.15) + (Change Type × 0.10)
65+
```
66+
67+
## Step 4: Apply Special Rules
68+
69+
### Hotfix Override
70+
- If labels contain "hotfix" or title contains "[HOTFIX]": Set score to 100
71+
72+
### Draft PR Exclusion
73+
- Skip PRs where `isDraft: true` unless specifically requested
74+
- Skip PRs where status is draft or WIP
75+
76+
### Closed PR Exclusion
77+
- Exclude closed PRs from the list entirely
78+
79+
### Conflicting PR Exclusion
80+
- Exclude PRs that need rebasing AND have conflicting changes (mergeable: "CONFLICTING")
81+
- These PRs cannot be reviewed until conflicts are resolved
82+
83+
### Stale PR Handling
84+
- If age > 14 days: Flag for author ping, but still calculate score
85+
- Include stale label in status column when present
86+
87+
## Step 5: Output Format
88+
89+
Provide output in this format:
90+
91+
```
92+
## 🎯 Next PR to Review
93+
94+
**PR #123: Fix critical authentication bug**
95+
- **Priority**: 🔴 Critical (Score: 87.5)
96+
- **Author**: @username
97+
- **Age**: 3 days
98+
- **Size**: 45 lines
99+
- **Link**: https://github.com/owner/repo/pull/123
100+
101+
### Score Breakdown:
102+
- Age Score: 50 × 0.25 = 12.5
103+
- Size Score: 85 × 0.20 = 17.0
104+
- Dependency Score: 75 × 0.30 = 22.5
105+
- Wait Time Score: 90 × 0.15 = 13.5
106+
- Change Type Score: 75 × 0.10 = 7.5
107+
- **Total**: 87.5
108+
109+
### Why This PR:
110+
- Blocks 2 other PRs
111+
- Author recently responded to feedback
112+
- Bug fix affecting user authentication
113+
- Manageable size for quick review
114+
115+
---
116+
117+
## 📋 All PRs by Priority
118+
119+
| PR | Title | Priority | Score | Age | Size | Author | Status |
120+
|----|-------|----------|-------|-----|------|--------|--------|
121+
| [#123](https://github.com/owner/repo/pull/123) | Fix auth bug | 🔴 Critical | 87.5 | 3d | 45 | @user1 | Ready for review |
122+
| [#124](https://github.com/owner/repo/pull/124) | Add new feature | 🟡 Medium | 45.2 | 1d | 200 | @user2 | Needs approval |
123+
| [#125](https://github.com/owner/repo/pull/125) | Update docs | 🟢 Low | 23.1 | 5d | 20 | @user3 | Needs rebase (Stale) |
124+
```
125+
126+
### Special Rules for Status Column:
127+
- Include both status and staleness in the same column
128+
- For example: "Needs review", "Approved", "Changes requested", "Needs rebase"
129+
- When stale label is present, append "(Stale)" to the status
130+
- Exclude closed PRs from the list entirely
131+
- Exclude draft PRs (isDraft: true) unless specifically requested
132+
- Exclude PRs with conflicting changes that need rebasing
133+
134+
### Excluded PRs Section:
135+
- Include a section listing excluded PRs with clickable links
136+
- Format: `- **[#123](https://github.com/owner/repo/pull/123)**: Title - Reason for exclusion`
137+
- Group exclusions by reason (Conflicting/Rebase Issues, Draft PRs, etc.)
138+
139+
### PR Table Sorting:
140+
- Sort PRs by score in descending order (highest score first)
141+
- For PRs with the same score, sort by priority in descending order (Critical > High > Medium > Low)
142+
- This ensures the most important PRs appear at the top of the table
143+
144+
## Notes
145+
146+
- Use this as a guide, not absolute rule - context matters
147+
- Do not implement the framework, just provide the output in the format specified

catalog-entities/marketplace/packages/rhdh-backstage-plugin-quickstart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ metadata:
1717
spec:
1818
packageName: "@red-hat-developer-hub/backstage-plugin-quickstart"
1919
dynamicArtifact: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-quickstart
20-
version: 1.1.1
20+
version: 1.6.2
2121
backstage:
2222
role: frontend-plugin
23-
supportedVersions: 1.39.1
23+
supportedVersions: 1.42.5
2424
author: Red Hat
2525
support: production
2626
lifecycle: active

dynamic-plugins.default.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ plugins:
271271
dynamicPlugins:
272272
frontend:
273273
backstage-community.plugin-redhat-argocd:
274+
translationResources:
275+
- importName: argocdTranslations
276+
module: Alpha
277+
ref: argocdTranslationRef
274278
mountPoints:
275279
- mountPoint: entity.page.overview/cards
276280
importName: ArgocdDeploymentSummary
@@ -712,6 +716,10 @@ plugins:
712716
dynamicPlugins:
713717
frontend:
714718
red-hat-developer-hub.backstage-plugin-quickstart:
719+
translationResources:
720+
- importName: quickstartTranslations
721+
module: Alpha
722+
ref: quickstartTranslationRef
715723
mountPoints:
716724
- mountPoint: application/provider
717725
importName: QuickstartDrawerProvider
@@ -1263,6 +1271,10 @@ plugins:
12631271
dynamicPlugins:
12641272
frontend:
12651273
red-hat-developer-hub.backstage-plugin-marketplace:
1274+
translationResources:
1275+
- importName: marketplaceTranslations
1276+
module: Alpha
1277+
ref: marketplaceTranslationRef
12661278
appIcons:
12671279
- name: marketplace
12681280
importName: MarketplaceIcon

dynamic-plugins/wrappers/backstage-community-plugin-redhat-argocd/package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "backstage-community-plugin-redhat-argocd",
3-
"version": "1.21.2",
3+
"version": "1.25.1",
44
"main": "src/index.ts",
55
"types": "src/index.ts",
66
"license": "Apache-2.0",
@@ -18,10 +18,14 @@
1818
},
1919
"exports": {
2020
".": "./src/index.ts",
21+
"./alpha": "./src/alpha.ts",
2122
"./package.json": "./package.json"
2223
},
2324
"typesVersions": {
2425
"*": {
26+
"alpha": [
27+
"src/alpha.ts"
28+
],
2529
"package.json": [
2630
"package.json"
2731
]
@@ -39,7 +43,7 @@
3943
"export-dynamic:clean": "run export-dynamic --clean"
4044
},
4145
"dependencies": {
42-
"@backstage-community/plugin-redhat-argocd": "1.21.2",
46+
"@backstage-community/plugin-redhat-argocd": "1.25.1",
4347
"@mui/material": "5.18.0"
4448
},
4549
"devDependencies": {
@@ -54,7 +58,8 @@
5458
"scalprum": {
5559
"name": "backstage-community.plugin-redhat-argocd",
5660
"exposedModules": {
57-
"PluginRoot": "./src/index.ts"
61+
"PluginRoot": "./src/index.ts",
62+
"Alpha": "./src/alpha.ts"
5863
}
5964
},
6065
"repository": {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from '@backstage-community/plugin-redhat-argocd/alpha';

dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-marketplace/package.json

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,22 @@
55
"types": "src/index.ts",
66
"license": "Apache-2.0",
77
"publishConfig": {
8-
"access": "public",
9-
"main": "dist/index.cjs.js",
10-
"types": "dist/index.d.ts"
8+
"access": "public"
9+
},
10+
"exports": {
11+
".": "./src/index.ts",
12+
"./alpha": "./src/alpha.ts",
13+
"./package.json": "./package.json"
14+
},
15+
"typesVersions": {
16+
"*": {
17+
"alpha": [
18+
"src/alpha.ts"
19+
],
20+
"package.json": [
21+
"package.json"
22+
]
23+
}
1124
},
1225
"backstage": {
1326
"role": "frontend-plugin",
@@ -45,7 +58,8 @@
4558
"scalprum": {
4659
"name": "red-hat-developer-hub.backstage-plugin-marketplace",
4760
"exposedModules": {
48-
"PluginRoot": "./src/index.ts"
61+
"PluginRoot": "./src/index.ts",
62+
"Alpha": "./src/alpha.ts"
4963
}
5064
},
5165
"repository": {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "@red-hat-developer-hub/backstage-plugin-marketplace/alpha";

dynamic-plugins/wrappers/red-hat-developer-hub-backstage-plugin-quickstart/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "red-hat-developer-hub-backstage-plugin-quickstart",
3-
"version": "1.6.0",
3+
"version": "1.6.2",
44
"main": "src/index.ts",
55
"types": "src/index.ts",
66
"license": "Apache-2.0",
@@ -29,7 +29,7 @@
2929
},
3030
"dependencies": {
3131
"@mui/material": "5.18.0",
32-
"@red-hat-developer-hub/backstage-plugin-quickstart": "1.6.0"
32+
"@red-hat-developer-hub/backstage-plugin-quickstart": "1.6.2"
3333
},
3434
"devDependencies": {
3535
"@backstage/cli": "^0.34.1",
@@ -43,7 +43,8 @@
4343
"scalprum": {
4444
"name": "red-hat-developer-hub.backstage-plugin-quickstart",
4545
"exposedModules": {
46-
"PluginRoot": "./src/index.ts"
46+
"PluginRoot": "./src/index.ts",
47+
"Alpha": "./src/alpha.ts"
4748
}
4849
},
4950
"repository": {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "@red-hat-developer-hub/backstage-plugin-quickstart/alpha";

0 commit comments

Comments
 (0)