CFE-3988: Fixed insert_lines ignoring include_end_delimiter when locating the region - #6265
Open
nickanderson wants to merge 1 commit into
Open
CFE-3988: Fixed insert_lines ignoring include_end_delimiter when locating the region#6265nickanderson wants to merge 1 commit into
nickanderson wants to merge 1 commit into
Conversation
…egion The insertion path treats the selected region as the half-open range [begin_ptr, end_ptr), so the end delimiter was never inside it. Inserting after the last line of a region built with include_end_delimiter => "true" landed above the end delimiter instead of below it. Insertion now moves the bound the way DeletePromisedLinesMatching() already does. That attribute previously had no effect at all on insert_lines, so the default of inserting before an excluded end delimiter is unchanged. Acceptance test 31_tickets/CFE-3988/2 covers that default and 31_tickets/CFE-3988/1 is no longer a soft failure. Ticket: CFE-3988 Changelog: Title Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
nickanderson
force-pushed
the
CFE-3988/master
branch
from
August 5, 2026 02:55
b6358d3 to
7313aa2
Compare
larsewi
approved these changes
Aug 5, 2026
Member
Author
|
@cf-bottom jenkins please |
|
Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/14395/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-14395/ |
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.
The insertion path treats the selected region as the half-open range
[begin_ptr, end_ptr), so the end delimiter was never inside it. Inserting after the last line of a region built withinclude_end_delimiter => "true"landed above the delimiter instead of below it. Insertion now moves the bound the wayDeletePromisedLinesMatching()already does.Nothing could have depended on the old behavior:
include_end_delimiterhad no effect at all oninsert_lines, and all ~90 existing tests using it are under07_delete_lines.Tests
31_tickets/CFE-3988/1— the ticket's reproducer, no longertest_soft_fail31_tickets/CFE-3988/2— new, pins the unchangedinclude_end_delimiter => "false"defaultVerified in a local starter_pack VM: acceptance 1648 passed / 0 regressions / soft failures 44 → 43, unsafe
10_files24/24, unit 70/70. With the fix reverted, case 1 fails and case 2 still passes.Ticket: https://northerntech.atlassian.net/browse/CFE-3988
Backports to 3.27.x and 3.24.x to follow, matching CFE-3987.