fix(debian): preserve vector.yaml as a conffile + move examples to docs folder - #25884
koen-serry wants to merge 17 commits into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
This comment has been minimized.
This comment has been minimized.
|
I have no clue what that CLA Assistant is |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7bc4e400cc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
I have read the CLA Document and I hereby sign the CLA |
…file Since /etc/vector/vector.yaml was not a dpkg conffile before this change, a file already present at that path (created by a user, or by an older Vector package) is unknown to dpkg. Unpacking it as a new conffile makes dpkg treat it as "created by you" and stop at an interactive prompt, which breaks unattended upgrades without --force-confold/confnew. Add a preinst/postinst transition: preinst moves aside any untracked pre-existing file so dpkg can install the conffile without prompting, and postinst restores it afterwards so the content is preserved byte-for-byte. Once installed this way the path is a normal tracked conffile and standard dpkg conffile handling applies on later upgrades. Extend verify-install.sh to seed such an untracked file before the first install and assert it survives, since the existing verify path only reinstalled the same package and never exercised this transition.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a1bc7cbd4b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbd27f3a80
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…n ownership Add the postrm half of the rm_conffile transition for the old /etc/vector/examples/*.yaml conffiles, as dpkg-maintscript-helper requires, so an aborted upgrade restores them and a purge cleans up its backups. Also restore a preserved /etc/vector/vector.yaml from postrm on abort-install/abort-upgrade, so a failure between preinst and postinst never leaves Vector without the config it was running with, and skip the preserve move entirely when another package owns the file so dpkg's own file-conflict check still reports the conflict. The conffile lookup now ignores entries dpkg marks obsolete.
…fix-debian-conffiles
|
@codex review |
…fix-debian-conffiles
|
@pront friendly ping on this one. Since your last look:
CI has not run since Happy to address anything else here. |
Summary
Two Debian packaging fixes.
1.
/etc/vector/vector.yamlis now a proper dpkg conffile. Previously the Debian package shipped no file at this path, so an administrator's config there was unknown to dpkg. This PR adds a stub config (no active sources/sinks) as aconf-filesentry, so local modifications are preserved across upgrades the way dpkg handles conffiles.Because the path was not previously a conffile, a file already sitting there — user-created, or left by an earlier Vector version — would make dpkg stop at the interactive "file created by you" conffile prompt, which breaks unattended
apt/dpkgupgrades. The maintainer scripts handle that transition without ever prompting:preinstmoves an existing, dpkg-untracked/etc/vector/vector.yamlaside to.vector-preserve, so dpkg unpacks the new conffile onto a free path. It skips the move when the file is already a (non-obsolete) conffile of this package, and when another package owns the path, so dpkg's own file-conflict check still fires.postinstrestores the preserved file, keeping the user's content byte-for-byte.postrmrestores it again onabort-install/abort-upgrade, so a failure betweenpreinstandpostinstcannot leave Vector without the config it was running with, and removes the leftover onpurge.2. Example configs moved from
/etc/vector/examples/to/usr/share/doc/vector/examples/. They are documentation, not administrator-managed configuration, so/etcis the wrong home for them. Since cargo-deb treated the old/etcpaths as conffiles,preinst/postinst/postrmcarry the matchingdpkg-maintscript-helper rm_conffiletransitions (prior version0.57.0-1) so unmodified old copies are removed and modified ones are preserved as backups.Vector configuration
The shipped stub at
/etc/vector/vector.yamlis inert by design — seedistribution/debian/vector.yaml, no active sources or sinks.How did you test this PR?
scripts/verify-install.shis extended to cover the transition and runs in CI for the.deb: it seeds an unmanaged/etc/vector/vector.yamlbefore installing the package, then asserts the content survived. dpkg has no tty there, so a conffile prompt would hang or fail the job — the absence of a prompt is what the test actually proves. It also asserts the new file layout:/etc/vector/vector.yamlpresent, nothing under/etc/vector/examples, examples present under/usr/share/doc/vector/examples/. The.rpmpath keeps its previous expectations.All three maintainer scripts are syntax-checked, and the changelog fragment passes
vdev check changelog-fragments.Change Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.Fragment:
changelog.d/deb-conffile-examples-location.fix.md.References
N/A