Skip to content

Read a Held Package as Installed in Both Linux Host Scripts - #3650

Merged
ptr727 merged 3 commits into
developfrom
feature/auto-3511
Oct 30, 2026
Merged

ptr727 merged 3 commits into
developfrom
feature/auto-3511

Conversation

@ptr727

@ptr727 ptr727 commented Oct 30, 2026

Copy link
Copy Markdown
Owner

Summary

host-setup/linux/install-tools.sh's package_installed matched dpkg's whole ${Status} against install ok installed. A held package, whose status is hold ok installed, therefore read as missing and was planned for install again. setup-github.sh already read a hold as installed, so the two hub copies of the check disagreed.

  • One definition. Both scripts now carry the same package_installed, which compares ${db:Status-Status} to installed. Each Linux script stays independently fetchable, per host-setup/README.md "Three Rules This Directory Follows", so the definition is an identical copy rather than a sourced file. A new test in tests/test_setup_github.py holds the two copies equal, and the README's list of duplicated helpers now names it.
  • Held Docker conflicts. With a hold now counted, the Docker conflict removal would hand a held conflict to apt-get remove -y, which refuses it with exit 100, while a -s simulation passes. docker_install now reads ${db:Status-Want} first. Where any name on Docker's uninstall list is held, it warns with the apt-mark unhold remedy and returns before removing anything, so docker lands in the failed set. That covers every name on the list, docker-doc included, on purpose. A held runc or containerd beside an unheld docker.io would otherwise remove the distro engine and then fail the docker-ce install, leaving the host with no engine.

Verification

  • python3 -m unittest tests.test_install_tools tests.test_setup_github: 78 tests pass, with 1 skipped. The new tests fail against the base branch's install-tools.sh.
  • Run in a throwaway debian:13 container with less and runc installed and held. Both scripts read the held less as installed. apt_missing does not plan either held package. docker_install reports the held runc, returns 1, and leaves it installed. In the same container, apt-get remove -y on the held runc exits 100 and apt-get remove -s exits 0, which is why a dry run is not the evidence.
  • docker_lint.py passes shellcheck, shfmt, editorconfig-checker, markdownlint, and cspell. The pre-commit hook passes ruff, mypy, and the prose gate.
  • The local strict review ran three passes. The first raised a reuse finding, fixed by moving the equality test onto the existing function_body helper. The second found that leaving a held conflict installed while still removing the others could remove the engine, fixed by restoring refuse-before-removing. The third raised nothing.

Closes on promotion: #3511

🤖 Generated with Claude Code

ptr727 and others added 3 commits October 30, 2026 01:59
install-tools.sh matched dpkg's whole status against "install ok installed",
so a held package read as missing and was planned for install again, while
setup-github.sh already read a hold as installed. Both scripts now carry one
definition that reads the installed state alone, and a test holds the two
copies equal, since each script stays independently fetchable.

With a held package now counted, the Docker conflict removal would hand a
held conflict to apt-get remove -y, which refuses it with exit 100. It now
reads the hold first, reports a held conflict for manual action, and removes
nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A held conflict now warns and stays installed while the unheld ones are
still removed, the shape the issue cites from downstream, so a held
package Docker does not actually conflict with no longer fails the docker
install. The equality test moves beside TestPackageInstalled and reuses
its function_body helper rather than a second slicer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Leaving a held conflict installed while removing the others could remove
docker.io and then fail the docker-ce install on the held runc or
containerd, leaving the host with no engine at all. A held name on Docker's
uninstall list now stops the docker install before any removal, as the
issue asks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings October 30, 2026 09:07
@coderabbitai

coderabbitai Bot commented Oct 30, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ptr727

ptr727 commented Oct 30, 2026

Copy link
Copy Markdown
Owner Author

A recorded local strict-review pass covers head 43adbcff16df2def2ea9da188ba61e7894eaec8d, the content this pull request carries at that commit against develop, and it recorded 0 findings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain, and the changes include regression coverage for held-package detection, Docker conflict handling, and helper-definition parity.

No open issues 🎉

What changed in this PR

This pull request updates Linux host setup to recognize held Debian packages as installed and prevents Docker installation from removing held conflicting packages.

Changes:

  • Aligns package_installed with dpkg’s normalized installed-status field in both Linux scripts.
  • Refuses Docker conflict removal when any conflicting package is held, with an apt-mark unhold remedy.
  • Adds regression tests for held packages, Docker conflicts, and helper-definition parity.
File Summary Review notes
tests/​test_setup_github.py Tests held-package detection and parity between both Linux helper definitions. —
tests/​test_install_tools.py Tests held package handling and Docker conflict refusal. Nit (P2; 1 vote): correct “a format names” to “the format names” in the new docstring.
host-setup/​README.md Documents the duplicated installed-package helper. Nit (P2; 1 vote): clarify that the helper is duplicated between the Linux scripts only.
host-setup/​linux/​setup-github.sh Uses the normalized dpkg status field to detect installed packages. —
host-setup/​linux/​install-tools.sh Recognizes held packages and blocks removal of held Docker conflicts. Nit (P2; 1 vote): document held-conflict refusal and the apt-mark unhold remedy in the operator-facing Docker setup documentation.

Review effort: Lite

@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.70%. Comparing base (b38e084) to head (43adbcf).
⚠️ Report is 24 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3650      +/-   ##
===========================================
+ Coverage    81.60%   81.70%   +0.09%     
===========================================
  Files           26       26              
  Lines         9070     9119      +49     
===========================================
+ Hits          7402     7451      +49     
  Misses        1668     1668              
Flag Coverage Δ
python-3.13 81.70% <ø> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ptr727
ptr727 merged commit 75ba77d into develop Oct 30, 2026
14 checks passed
@ptr727
ptr727 deleted the feature/auto-3511 branch October 30, 2026 09:19
ptr727 added a commit that referenced this pull request Oct 30, 2026
…Session Prompt Rules (#3667)

Promotes the changes merged into `develop` since promotion #3636 to
`main`.

- [#3640](#3640) Pins the
validator's `uvx ruff` to a Dependabot-managed manifest.
- [#3642](#3642) Counts
Copilot findings under the unresolved bullet and the file table.
- [#3644](#3644) Aligns
the split comment copies and drops the stale counts.
- [#3646](#3646) Sends a
command meant for the session's input line in a plain message, never in
a blocking prompt.
- [#3648](#3648) Opens the
attended session by cloning a hub checkout of the session's own.
- [#3650](#3650) Reads a
held package as installed in both Linux host scripts.
- [#3652](#3652) States
the PowerShell `-Help` and `-h` form in the command-line argument rules.
- [#3654](#3654) Counts
sentences in Markdown table cells for the sentence-length check.
- [#3658](#3658) Splits a
table row only at an unescaped pipe in the semicolon rule.
- [#3660](#3660) Finds
table cell boundaries before blanking code spans and quotations.
- [#3662](#3662) Names a
stale job record on a completed run in `pr_review.py`.
- [#3665](#3665) Keeps a
line holding code after a block comment's closer out of `comment-added`.
Its squash commit on `develop` carries the pull request's original
title, which names a heredoc reading. That reading was withdrawn before
the merge on decision #3666, so a workflow `run:` heredoc body still
reads as code.
- [#3669](#3669) Counts
each `[Pn]` marker in a Copilot Findings cell, so a second finding in
one cell is no longer dropped from triage. It answers one of the two
findings Copilot raised on this promotion. The other is declined with a
parser probe in its thread.

Closes #3616
Closes #3610
Closes #3622
Closes #3638
Closes #3604
Closes #3511
Closes #3602
Closes #3456
Closes #3655
Closes #3657
Closes #3362
Closes #1664

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

2 participants