Skip to content

fix: correctly identify ondemand challenges to prune#71

Merged
hi-liang merged 1 commit into
masterfrom
fix-prune-query
Jun 7, 2026
Merged

fix: correctly identify ondemand challenges to prune#71
hi-liang merged 1 commit into
masterfrom
fix-prune-query

Conversation

@hi-liang

@hi-liang hi-liang commented Jun 7, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings June 7, 2026 22:44

Copilot AI left a comment

Copy link
Copy Markdown

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 updates pruning behavior to correctly target on-demand (“dynamic”) challenge instances by selecting builds based on instancecount == DYNAMIC_INSTANCES rather than relying on a schema name prefix, and updates/extends tests accordingly.

Changes:

  • Update Manager.Prune() to delete old instances by filtering on builds.instancecount == DYNAMIC_INSTANCES (instead of schema LIKE "manual-%").
  • Refactor prune tests to parameterize build InstanceCount and validate dynamic vs fixed-pool behavior.
  • Add a test ensuring age-based pruning releases reserved ports via ON DELETE CASCADE.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
cmgr/prune_test.go Updates fixtures/tests to validate pruning selection by instance count and adds port-release coverage.
cmgr/api.go Changes pruning SQL filter to target on-demand builds by instancecount.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmgr/api.go Outdated
Comment thread cmgr/api.go

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

Comment thread cmgr/api.go
Comment thread cmgr/api.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread cmgr/api.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@hi-liang hi-liang merged commit 1caef5c into master Jun 7, 2026
2 checks passed
@hi-liang hi-liang deleted the fix-prune-query branch June 7, 2026 23:52
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