fix: Don't change github regex if override is active#132
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 15 minutes and 2 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModified Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@PatchPanda.Web/Services/DockerService.cs`:
- Around line 290-291: The current guard around
existingContainer.OverrideGitHubRepo prevents copying
runningContainer.GitHubVersionRegex when a container is overridden, leaving
GitHubVersionRegex null and breaking VersionService and UpdateService flows;
modify the logic in DockerService.cs (around
existingContainer.OverrideGitHubRepo and GitHubVersionRegex handling) so that
you still do not overwrite when OverrideGitHubRepo is set, but if
existingContainer.GitHubVersionRegex is null then backfill it from
runningContainer.GitHubVersionRegex (i.e., only assign GitHubVersionRegex when
the target property is null), ensuring UpdateService and VersionService receive
a non-null regex while preserving override semantics.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6fef1fca-db81-4276-9352-442de1a61770
📒 Files selected for processing (1)
PatchPanda.Web/Services/DockerService.cs
| if (existingContainer.OverrideGitHubRepo is null) | ||
| existingContainer.GitHubVersionRegex = runningContainer.GitHubVersionRegex; |
There was a problem hiding this comment.
Preserve override behavior, but backfill missing GitHubVersionRegex to prevent update-flow failures.
On Line 290, the new guard can leave overridden containers with GitHubVersionRegex == null forever. That causes empty version results in PatchPanda.Web/Services/VersionService.cs (Line 98), suppresses updates in PatchPanda.Web/Services/UpdateService.cs (Line 78), and can throw in update execution (Line 341). Keep the non-overwrite intent, but backfill when missing.
Proposed fix
- if (existingContainer.OverrideGitHubRepo is null)
- existingContainer.GitHubVersionRegex = runningContainer.GitHubVersionRegex;
+ if (existingContainer.OverrideGitHubRepo is null)
+ {
+ existingContainer.GitHubVersionRegex = runningContainer.GitHubVersionRegex;
+ }
+ else if (existingContainer.GitHubVersionRegex is null)
+ {
+ // Preserve user override semantics, but avoid null regex in update paths.
+ existingContainer.GitHubVersionRegex = runningContainer.GitHubVersionRegex;
+ }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@PatchPanda.Web/Services/DockerService.cs` around lines 290 - 291, The current
guard around existingContainer.OverrideGitHubRepo prevents copying
runningContainer.GitHubVersionRegex when a container is overridden, leaving
GitHubVersionRegex null and breaking VersionService and UpdateService flows;
modify the logic in DockerService.cs (around
existingContainer.OverrideGitHubRepo and GitHubVersionRegex handling) so that
you still do not overwrite when OverrideGitHubRepo is set, but if
existingContainer.GitHubVersionRegex is null then backfill it from
runningContainer.GitHubVersionRegex (i.e., only assign GitHubVersionRegex when
the target property is null), ensuring UpdateService and VersionService receive
a non-null regex while preserving override semantics.
Summary by CodeRabbit