Skip to content

chore(fork): merge upstream main 54581e24aeb9 onto the bucket engine (RIG-9206) - #24

Merged
mattwilkinsonn merged 19 commits into
rigel-releasefrom
dependencies/rig-9206-merge-upstream-main-54581e24aeb9
Nov 14, 2026
Merged

mattwilkinsonn merged 19 commits into
rigel-releasefrom
dependencies/rig-9206-merge-upstream-main-54581e24aeb9

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Nov 11, 2026 •

Copy link
Copy Markdown

Summary

Merges upstream woodpecker-ci/autoscaler 54581e24 (bucket/plan engine, DeployAgent(ctx, agent, Capability) / Capabilities()) into the fork. The four fork features are ported onto the new engine. Refs RIG-9400, RIG-9206.

  • danglingSince grace (engine/cleanup.go): a provider-only instance is removed only after it has been absent past AgentInactivityTimeout. Upstream e2e drift tests (TestProviderServerDriftIsReconciled, TestFailedDriftCleanupCanBeRetried/provider_only, TestVanishedBootRegistrationNoLongerCoversDemand) now assert the grace pass first.
  • drainOutdatedAgents (engine/agents.go, OutdatedAgentLister): outdated agents are drained, never reactivated, and removed once task-free. They are not counted as reusable, and createAgents caps fresh creates at MaxAgents, so a rollout never surges past the ceiling.
  • labelfilter netting (engine/netting.go): pending tasks that free non-pool slots can run are netted out before computeBucketStates.
  • PoolPlatform eligibility (engine/netting.go): with WOODPECKER_POOL_PLATFORM set, only tasks the modeled pool filter accepts count as demand. With it unset, the step is skipped and upstream bucket routing decides.
  • AWS: upstream capability-filtered DeployAgent plus the fork launch-template / CreateFleet path, with tests ported.
  • kubernetes: Capabilities() reports {Backend: kubernetes} with the platform unknown. The agent pod's self-reported platform can differ from the step platform: the prod arm64 pool runs its agent on amd64. Buckets route on PoolPlatform instead.

Verification

On the Azure VM (go1.27.3), gofmt -l is empty, and go vet ./..., go build ./... and go test ./... all pass.

Risks

  • With WOODPECKER_POOL_PLATFORM unset, a kubernetes pool advertises no platform label, so platform-keyed tasks never scale it. Startup warns about this. Every prod scaler sets it.
  • The labelfilter transliteratedFromVersion pin was bumped to v3.19.0 after reading v3.19.0 server/scheduler/filter.go. The logic is identical.

Refs RIG-9206

Co-authored-by: Matt Wilkinson matt@rigel.build

renovate Bot and others added 18 commits October 17, 2026 04:36
…ci#773)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
…odpecker-ci#581)

Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Robert Kaussow <xoxys@rknet.org>
An hourly billed agent can remain drained when a running job carries it past its billing boundary. The machine is retained for the newly paid hour, but stays unschedulable until demand triggers reactivation.

Restore scheduling during drained-agent cleanup, after demand-driven scaling. Reactivation requires a known creation time, at least one elapsed hour, and a match against current provider capabilities and configured agent labels. Agents retired for configuration drift stay drained. Failed API updates preserve the local drained state.

Extend existing billing tests and port missing regression cases covering zero, one and two pending workflows, running jobs across rollover, removal in the next teardown window, invalid creation times, and update failures.

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robert Kaussow <mail@thegeeklab.de>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…#781)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…dpecker-ci#782)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
…4.1.3 (woodpecker-ci#788)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Harsh Singh <unpredictablemr434@gmail.com>
Co-authored-by: 6543 <6543@obermui.de>
@rigel-mintaka rigel-mintaka changed the title Update pre-commit hook golangci/golangci-lint to v2.15.0 (#773) chore(fork): merge upstream main 54581e24aeb9 onto the bucket engine (RIG-9206) Nov 11, 2026
@linear-code

linear-code Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

RIG-9400

RIG-9206

@rigel-mintaka
rigel-mintaka force-pushed the dependencies/rig-9206-merge-upstream-main-54581e24aeb9 branch from cbfa74a to fa73f0f Compare November 11, 2026 08:44
@rigelbuild-bot

Copy link
Copy Markdown

Review round 1 (cbfa74a) is fixed and squashed into the merge at fa73f0f. rjc accepts only a single merge commit for upstream syncs, so the interdiff is lost; this comment records it.

  • High: an outdated rollout broke MaxAgents. computeBucketStates now takes the outdated set and leaves outdated NoSchedule agents out of ReusableAgents. createAgents caps fresh creates at MaxAgents - len(agents). Regression test: Test_createAgents_outdated/busy_outdated_agents_hold_their_slots_under_MaxAgents, which runs a Reconcile with footprint = MaxAgents = 1 and asserts no AgentCreate. It was red on cbfa74a.
  • High: arm64-pool agents that report linux/amd64 were drained. The kubernetes Capabilities() now returns {Backend: kubernetes} with the platform unknown. agentBuckets routes on PoolPlatform instead. Tests: Test_arm64PoolAgentOnAmd64Node and TestCapabilitiesLeavePlatformUnknown; the latter was red on cbfa74a.
  • Medium: the MaxAgents test passed vacuously. It is replaced by the Reconcile-level test above, which uses a task that routes to the bucket.
  • Low: the PoolPlatform warning understated the effect. The warning now names the kubernetes case. With the platform unknown, an unset PoolPlatform no longer zeroes the capabilities.

On the VM, go vet, go build ./... and go test ./... all pass.

@rigel-mintaka
rigel-mintaka force-pushed the dependencies/rig-9206-merge-upstream-main-54581e24aeb9 branch from fa73f0f to 2b05827 Compare November 13, 2026 01:20
@rigel-mintaka

Copy link
Copy Markdown
Author

Review all-clear for head 2b05827.

  • Interdiff since fa73f0f: the devShell now includes hadolint and pre-commit, which the pre-push hooks need (system hook hadolint, plus pre-commit meta hooks). The three guard tests reviewed earlier (fail-when-guard-removed, run at fa73f0f) are now part of this commit.
  • Findings: 0 high, 0 medium. 1 low (the test files go beyond the hook-tool change): accepted, since they are the earlier reviewed review fixes.
  • Pre-push hooks passed on rbuild@macpro2013.

@rigel-mintaka
rigel-mintaka marked this pull request as ready for review November 13, 2026 01:23
@rigel-mintaka

Copy link
Copy Markdown
Author

Handoff from deps to go-migration (lane fold, 2026-11-13). Head 2b05827, review all-clear posted for that head, ready. Next: Matt merges into rigel-release; then close RIG-9400.

@rigel-mintaka

Copy link
Copy Markdown
Author

CI note: the red CI (meta) and CI (pr) checks come from the fork's upstream .woodpecker/ pipelines, which do not fit Rigel CI: vendor fails before it writes any log. They are not required on rigel-release. Tracked in RIG-7324 (drop the fork's Woodpecker pipelines); it is not caused by this sync.

@mattwilkinsonn
mattwilkinsonn merged commit 7144a68 into rigel-release Nov 14, 2026
2 of 4 checks passed
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.

8 participants