Skip to content

Conversation

@ianchen0119
Copy link
Contributor

No description provided.

@ianchen0119 ianchen0119 requested review from Copilot and vx416 January 12, 2026 10:41
@ianchen0119 ianchen0119 merged commit 67ea325 into main Jan 12, 2026
6 checks passed
@ianchen0119 ianchen0119 deleted the fix/server-intent branch January 12, 2026 10:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes two issues related to intent processing and pod identification: (1) adds command regex filtering to ensure only processes matching the intent's CommandRegex are scheduled, and (2) improves the pod UID regex pattern to correctly handle both systemd (underscore) and cgroupfs (dash) formats with strict UUID structure validation.

Changes:

  • Added command regex filtering in ProcessIntents to match processes against intent CommandRegex before creating scheduling intents
  • Updated podRegex pattern from a loose pattern to strict UUID format validation supporting both underscore and dash separators

if process.Command == pauseCommand {
continue
}
if !regexp.MustCompile(intent.CommandRegex).MatchString(process.Command) {
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The regex is being compiled on every iteration of the process loop. This is inefficient and can cause performance issues when processing pods with many processes. Consider compiling the regex once outside the loop or caching compiled regex patterns.

Copilot uses AI. Check for mistakes.
Comment on lines +87 to +89
if !regexp.MustCompile(intent.CommandRegex).MatchString(process.Command) {
continue
}
Copy link

Copilot AI Jan 12, 2026

Choose a reason for hiding this comment

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

The new command regex filtering logic lacks test coverage. The ProcessIntents function now filters processes based on CommandRegex, but there are no tests verifying this behavior. Consider adding tests that verify processes are correctly filtered based on the regex pattern, including edge cases like invalid regex patterns or partial matches.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants