Thanks to visit codestin.com
Credit goes to GitHub.com

Skip to content

Conversation

@blp
Copy link
Member

@blp blp commented Jan 30, 2026

The default value of hosts is 1, which means that attempting to set pipeline configuration in any way will populate it with 1 if it is not set, but the pipeline manager was rejecting as different a missing old hosts and a new hosts of 1, which meant that users effectively couldn't change any configuration at all without clearing storage. This fixes the problem.

The default value of `hosts` is 1, which means that attempting to set
pipeline configuration in any way will populate it with 1 if it is not
set, but the pipeline manager was rejecting as different a missing old
`hosts` and a new `hosts` of 1, which meant that users effectively
couldn't change any configuration at all without clearing storage.  This
fixes the problem.

Signed-off-by: Ben Pfaff <[email protected]>
@blp blp requested a review from snkas January 30, 2026 23:49
@blp blp self-assigned this Jan 30, 2026
Copilot AI review requested due to automatic review settings January 30, 2026 23:49
@blp blp added bug Something isn't working Pipeline manager Pipeline manager (API, API server, runner, compiler server) rust Pull requests that update Rust code user-reported Reported by a user or customer multihost Related to multihost or distributed pipelines labels Jan 30, 2026
Copy link
Contributor

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 an issue where the pipeline manager incorrectly rejected configuration updates when the old configuration had a missing hosts field and the new configuration set it to 1 (the default value). This was preventing users from updating pipeline configurations without clearing storage.

Changes:

  • Modified the hosts comparison logic to treat missing values as 1 (the default)
  • Added serde_json::json import to support the comparison

Comment on lines +701 to +703
let one = json!(1);
if runtime_config.get("hosts").unwrap_or(&one)
!= current.runtime_config.get("hosts").unwrap_or(&one)
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

The json!(1) value is created on every invocation but never changes. Consider defining this as a constant outside the function (e.g., lazy_static or const) to avoid repeated allocations.

Copilot uses AI. Check for mistakes.
@blp blp added this pull request to the merge queue Jan 31, 2026
Merged via the queue into main with commit 8a83536 Jan 31, 2026
6 of 7 checks passed
@blp blp deleted the hosts branch January 31, 2026 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working multihost Related to multihost or distributed pipelines Pipeline manager Pipeline manager (API, API server, runner, compiler server) rust Pull requests that update Rust code user-reported Reported by a user or customer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants