Skip to content

fix: config_section() returns a leaf; 3.6.0 changelog - #814

Merged
tobixen merged 6 commits into
masterfrom
fix/config-section-inherits
Oct 22, 2026
Merged

tobixen merged 6 commits into
masterfrom
fix/config-section-inherits

Conversation

@tobixen

@tobixen tobixen commented Oct 22, 2026

Copy link
Copy Markdown
Member

Disclaimer: the code and the text below the line are AI-generated, by Claude Opus 5.5, from the prompts below (each commit message carries its own prompts in full):

We should make a new release today. Check up the file tmp-handover.md [an untracked note with changelog decisions agreed in an earlier session]
A plann command for adding a task to my calendar, not giving any config options, now returns [some error message]
It should be fixed cleanly and properly. (...) The caldav library should not call on any private methods in calendaring-config. How much config processing is still in the caldav library - config_section sounds like something belonging in calendaring-config? (...)
(after many rounds back and forth, involving changes in three different libraries, I decided to make a hybrid approach - do a lightweight cleanup of the configuration code and procrastinate a proper cleanup - see also PyCalendar/plann#84)
I've done some work on the CHANGELOG, do a review. (...) Can we have links to the pull requests? (...)
Add the yaml.safe_load to the security, but also add information about the new password command thing under security. (...)


config_section() merged inherits itself and left the inherits key in the result, which calendaring-config's section_connection() refuses. As a result plann skipped any config section using inherits ("pass it merged, as a leaf"), and get_all_test_servers() failed on it. config_section() now delegates to calendaring_config.merged_section(), so caldav no longer duplicates the merge logic. A parent's contains and disable are no longer inherited, and inheriting from a section of another kind is an error; docs/source/configfile.rst documents both.

This needs calendaring-config 0.5, so CI stays red until that release is on PyPI.

The branch also carries the 3.6.0 CHANGELOG: fragments collected and hand-tuned, a new Security section (safe_load, and the guarded password_command), a Changed section (wildcard preconditions, UidConflictConsistencyError, the calendar-color hex/name split), and PR links on every entry.

🤖 Generated with Claude Code

One entry each for the wildcard preconditions and for the server
profile updates; calendaring-config names the new dependency, and the
files it reads differently move to the breaking list.  The safe YAML
loader is a fix, not a security issue: the attacker would need write
access to the config file.

Prompt: We should make a new release today.  Check up the file tmp-handover.md [an untracked note with changelog decisions agreed in an earlier session]

Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
The output of towncrier build, unedited, so the hand-tuning that
follows is a diff of its own.

Prompt: We should make a new release today.  Check up the file tmp-handover.md [an untracked note with changelog decisions agreed in an earlier session]

Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
An intro paragraph like the one for 3.5.0, and the sections laid out
like 3.5.0's: potentially breaking changes, then Added split into
library API, configuration and server compatibility.  The
DAVClient.password/multiget entry moves to potentially breaking
changes, and the "Notable changes" note no longer points at a 3.4
regression.

Prompt: We should make a new release today.  Check up the file tmp-handover.md [an untracked note with changelog decisions agreed in an earlier session]

Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
config_section() merged inherits itself and left the inherits key
in, which calendaring-config's section_connection() refuses, so
plann skipped, and get_all_test_servers() failed on, any section that
inherits; a broken section that is not a test server no longer
hides the test servers.  It now delegates to
calendaring_config.merged_section() (needs calendaring-config 0.5), so
caldav no longer duplicates the merge.  With it, a parent's contains
and disable are no longer inherited, and inheriting from a section of
another kind is an error; docs/source/configfile.rst says so.  TODO
comments mark the shims and the test tooling to move out of config.py.

Prompt: A plann command for adding a task to my calendar, not giving and (sic) config options, now returns with `ERROR:root:Skipping a config section: section default has inherits: pass it merged, as a leaf
Giving up: No calendars given
Aborted!`.  The config file is at ~/.config/calendar.conf but it contains secrets, so don't look into it directly
Followup-Prompt: It should be fixed cleanly and properly.  It seems to me that the caldav/config.py file needs some serious refactoring - I do understand that there is some special logic with handling the server features, etc, but it still surprises me that the file is still that big.  The caldav library should not call on any private methods in calendaring-config.  How much config processing is still in the caldav library - `config_section` sounds like something belonging in calendaring-config?  calendaring-config releases are still cheap to do.  Changes in the caldav library will delay the 3.6.0-release, but better to get it done properly now than later.
Prompts (comments made inline in the document while reviewing it):
> Leave [things that may be procrastinated] to 3.6.1
> Procrastinate the noisy deprecation-warnings to a later release, otherwise we'd need to change plann too.
> Add /calendar-todo items for the procrastinated work, perhaps combined with ## TODO-comments inline in the code.  No point with a public github issue on internal refactoring stuff.

Followup-Prompt: I made a small edit in caldav [cleaning up some TODO-comments], please commit
Followup-Prompt: please fix [the typos in that edit]

Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
tobixen reworded the config and wildcard-precondition entries under
"Potentially breaking changes"; the details that dropped out (which
header each server fails, UidConflictConsistencyError, the new wildcard
parameter) move to a new "Changed" section, together with the
calendar-color hex/name split.  Every entry now links its PR, and the
wildcard entry no longer cites issue 806, which is about UID conflicts.
A Security section takes the safe_load entry and a note that
password_command runs a program from the config file, guarded by an
owner and permission check that the YAML tags never had, which is why
safe_load is kept.  The config entries now name the kind-mismatch
error, that a parent's contains and disable are not inherited, and
the keyring extra.

Prompt: I've done some work on the CHANGELOG, do a review.  If I deleted too many details about the if-(none)-match, then add another point about it under CHANGED and add a reference.  Can we have links to the pull requests?  Particularly for the bullet points that are missing links ot (sic) the issues.
Followup-Prompt: Add the yaml.safe_load to the security, but also add information about the new password command thing under security.  Due to the latter there is no security benefit from the safe_load.  Perhaps we shouldn't use safe_load?  Or is it still safer with safe_load than without?

Prompts (comments made inline in the document while reviewing it):
> (on the vague "no guarantees that things will work out 100% as expected" in the wildcard entry) do the needful, but keep it short in the "breaking changes"-section
> (on the calendar-color hex/name split being filed under Added) Not breaking.

Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
Add a note on why 3.6.0 follows 3.5.0 so closely, linking the projects
that drove it.  Restore the advice lost when the fragments were
collected: a hand-written feature list should mark save.if-none-match
and save-load.mutable.if-match-wildcard.

Prompt: If we're anyway going to change something, then I'd like to do an edit to the CHANGELOG too before pushing
Followup-Prompt: I've done my fix in the CHANGELOG, so please push

Prompts (comments made inline in the document while reviewing it):
> (on "the new CHANGELOG intro is long and chatty") I've shortened down the intro a bit
> (on "grammar in the new CHANGELOG intro") The text has been changed, so the old grammar errors are gone, but fix the new grammar errors and add links.

Assisted-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Reviewed-by: Tobias Brox <tobias@redpill-linpro.com>
@tobixen
tobixen merged commit aa81337 into master Oct 22, 2026
19 checks passed
@tobixen
tobixen deleted the fix/config-section-inherits branch October 22, 2026 18:19
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.

1 participant