🌱 Address Copilot feedback on mission deep-link matching#1762
🌱 Address Copilot feedback on mission deep-link matching#1762clubanderson merged 1 commit intomainfrom
Conversation
- Use Set instead of arrays for word-overlap scoring to prevent duplicate word inflation (Copilot #2) - Use >= instead of > for threshold comparison so missions scoring exactly 0.6 are accepted (Copilot #1) - Restrict cncfProject shortcut to installer missions only — solutions use slug/title matching as before (Copilot #3) Signed-off-by: Andrew Anderson <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubestellarconsole ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hey @clubanderson — thanks for opening this PR!
This is an automated message. |
|
Welcome to KubeStellar! 🚀 Thank you for submitting this Pull Request. Before your PR can be merged, please ensure: ✅ DCO Sign-off - All commits must be signed off with ✅ PR Title - Must start with an emoji: ✨ (feature), 🐛 (bug fix), 📖 (docs), 🌱 (infra/tests), Getting Started with KubeStellar: Contributor Resources:
🌟 Help KubeStellar Grow - We Need Adopters! Our roadmap is driven entirely by adopter feedback. Whether you're using KubeStellar yourself or know someone who could benefit from multi-cluster Kubernetes: 📋 Take our Multi-Cluster Survey - Share your use cases and help shape our direction! A maintainer will review your PR soon. Feel free to ask questions in the comments or on Slack! |
|
🎉 Thank you for your contribution! Your PR has been successfully merged. 🌟 Help KubeStellar Grow - We Need Adopters! Our roadmap is driven entirely by adopter feedback - nothing else. Whether you're using KubeStellar yourself or know organizations that could benefit from multi-cluster Kubernetes, we need your help: 📋 Take our Multi-Cluster Survey - Share your use cases and help shape our direction! 🗣️ Spread the word - Tell colleagues, write blog posts, present at meetups 💬 Share feedback on Slack #kubestellar-dev Every adopter story helps us prioritize what matters most. Thank you for being part of the KubeStellar community! |
There was a problem hiding this comment.
Pull request overview
Follow-up to #1760 to refine fuzzy mission deep-link matching in MissionBrowser, aiming to make matching more accurate and align behavior with the documented threshold semantics.
Changes:
- Switch fuzzy matching from arrays to
Set-based word overlap to avoid duplicate-word inflation. - Make the acceptance threshold inclusive by using
>=in best-match selection. - Restrict the high-confidence
cncfProjectexact-match shortcut to installer missions.
| // Fuzzy word-overlap (set intersection) on title + cncfProject | ||
| const missionWordSet = toWordSet(`${m.title || ''} ${m.cncfProject || ''}`) | ||
| if (slugWordSet.size === 0 || missionWordSet.size === 0) return 0 |
There was a problem hiding this comment.
The PR description says solutions should use slug/title matching only, but the fuzzy word-overlap still builds missionWordSet from title + cncfProject even when isInstaller is false. Either update the implementation to exclude cncfProject for solutions, or adjust the description/inline strategy comment so behavior matches what’s intended.
| const score = scoreMission(m) | ||
| if (score > bestScore) { best = m; bestScore = score } | ||
| const score = scoreMission(m, isInstaller) | ||
| if (score >= bestScore) { best = m; bestScore = score } |
There was a problem hiding this comment.
Using score >= bestScore changes tie-breaking: missions with the same score will overwrite the current best, so the selected deep-link target becomes dependent on list ordering (and may change if ordering changes). If the goal is only to make the threshold inclusive (accept exactly 0.6), consider keeping strict > for best selection and handling the == MIN_WORD_OVERLAP_RATIO case only when best is still undefined.
| if (score >= bestScore) { best = m; bestScore = score } | |
| if (score > bestScore || (!best && score === MIN_WORD_OVERLAP_RATIO)) { | |
| best = m | |
| bestScore = score | |
| } |
Summary
Follow-up to #1760 — addresses all 3 Copilot review comments:
Setfor word-overlap — prevents duplicate words from inflating match scores>=instead of>) — missions scoring exactly 0.6 are now accepted, matching the documented "≥ threshold" behaviorcncfProjectmatch to installers — solutions use slug/title matching only, preserving prior behaviorTest plan
/missions/install-open-policy-agent-opa→ opens OPA installer/missions/install-keylime→ still works (exact match)/missions/nonexistent→ shows Mission Browser (no crash)