CFE-3725: fix double change detection with hash=>"best"#6241
Open
nickanderson wants to merge 1 commit into
Open
CFE-3725: fix double change detection with hash=>"best"#6241nickanderson wants to merge 1 commit into
nickanderson wants to merge 1 commit into
Conversation
nickanderson
force-pushed
the
CFE-3725/master
branch
2 times, most recently
from
July 21, 2026 23:40
ae5ec93 to
d5ecf4f
Compare
Member
Author
|
@cf-bottom jenkins please |
|
Alright, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/14257/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-14257/ |
In community builds hash => "best" hashed files with both MD5 and SHA1, combining them with a short-circuiting || that skipped updating the second hash once the first reported a change. The stale hash then re-reported the same change on the next run, so one change was detected on two consecutive runs. Resolve "best" to a single SHA-512 instead (matching enterprise, stronger than the MD5+SHA1 pair, and FIPS-friendly) and drop the dual-hash branch. Community files tracked with "best" are re-baselined under SHA-512 on the first run after upgrade. Adds an acceptance test. Changelog: Community 'files' promises using hash => "best" now use SHA-512 (previously MD5+SHA1) and no longer report a content change on two consecutive agent runs. Affected files are re-baselined on the first run after upgrade. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
nickanderson
force-pushed
the
CFE-3725/master
branch
from
July 22, 2026 03:16
d5ecf4f to
52d16c1
Compare
Member
Author
|
@cf-bottom jenkins, please |
|
Alright, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/14258/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-14258/ |
Member
Author
|
@olehermanse do you agree with this. I was on the fence between making Enterprise do 2 hashes vs changing best to pick the singular best. |
olehermanse
approved these changes
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
hash => "best"in achangesbody now uses SHA-512.In community builds,
besthashed files with both MD5 and SHA1. A bug in how the two were checked meant that after a file changed, only one of the two stored hashes was updated. The stale one then reported the same change again on the next run, so a single change showed up as "changed" on two runs in a row.Instead of fixing the two-hash bookkeeping,
bestnow uses one strong hash, SHA-512. That is what CFEngine Enterprise has always used forbest.On community, the first agent run after upgrading re-records
best-tracked files under SHA-512 and file changes would be realized.Documentation stats that
bestcross correlates the two best options available. That doesn't seem to have ever been true for Enterprise. Since community could explicitly already select sha512 I thought it made the most sense to align on Enterpise behavior rather than add additional hashing to enterprisebest.