Skip to content

Fix nested config updates across non-option lines#10357

Open
kiwigitops wants to merge 1 commit into
aws:developfrom
kiwigitops:fix-configure-nested-blocks
Open

Fix nested config updates across non-option lines#10357
kiwigitops wants to merge 1 commit into
aws:developfrom
kiwigitops:fix-configure-nested-blocks

Conversation

@kiwigitops
Copy link
Copy Markdown

Fixes #10348.

ConfigFileWriter._update_subattributes() assumed every line inside a nested config block matched OPTION_REGEX, so current_indent could be read before assignment when the block was empty or when a comment/section header followed the parent key.

This makes the loop handle section headers before option parsing, skip non-option lines safely, and keep the insertion point at the last line that still belongs to the nested block. The regressions cover empty nested blocks, comments between the parent key and child option, and a next section immediately after the parent key.

Validation:

  • python -m pytest tests/unit/customizations/configure/test_writer.py -q
  • git diff --check

Signed-off-by: kiwigitops <kiwisclubco@gmail.com>
@kiwigitops kiwigitops requested a review from a team as a code owner May 28, 2026 18:26
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.

aws configure set s3.* can raise UnboundLocalError when updating nested config blocks

1 participant