Skip to content

fix(tier3): stop passing apt-get a blank package in generated Dockerfiles - #471

Merged
rng1995 merged 5 commits into
mainfrom
naren/apt-packages-continuation
Nov 13, 2026
Merged

rng1995 merged 5 commits into
mainfrom
naren/apt-packages-continuation

Conversation

@rng1995

@rng1995 rng1995 commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

In each of the three generated apt-get blocks, the base package line already ends with a continuation backslash. When any staged skill declared packages in apt-packages.txt, the code appended a second \, which produced ripgrep \ \. Docker joins the final continuation, and the shell then reads the escaped space as an argument of one space. apt-get failed with Unable to locate package and the image did not build.

The blocks are in the shared eval base image, generated task Dockerfiles, and the default Dockerfile for native Harbor tasks. This PR drops the extra backslash in all three.

Not changed: an inline # comment in apt-packages.txt or requirements.txt still reaches the install line. This predates the PR and is out of scope here.

Verification

  • I am familiar with the Contributing Guidelines
  • Added or updated focused tests: tests/test_harbor_apt_install_lines.py joins Docker continuations, splits the RUN command the way sh does, and asserts the exact apt-get install arguments for each generator, with no extras, one extra, and two extras plus a comment line. On unfixed main, all 6 cases with extra packages fail on the ' ' package.
  • Updated documentation for user-visible changes (none needed)
  • Ran make lint
  • Ran make test: every test file that imports the adapter passed (3285 passed). The 2 test_harbor_secure_docker_environment sidecar tests that fail also fail on origin/main.
  • Ran make build (not run; no packaging change)
  • Did not add credentials, private datasets, or proprietary benchmark content

Docker check on python:3.12-slim:

  • Before: the generated line with apt-packages.txt = tree fails with E: Unable to locate package .
  • After: the fixed line with tree and zstd builds, and both tools run.

The OSS boundary scan passes.

Release Impact

  • No user-visible release note needed
  • Updated CHANGELOG.md

🤖 Generated with Claude Code

…iles

The three generated apt-get blocks end the base package line with a
continuation backslash. When any staged skill declared packages in
apt-packages.txt, the code appended a second " \", which gave
`ripgrep \ \`. Docker joins the final continuation, and the shell then
reads the escaped space as an argument of one space. apt-get failed with
"Unable to locate package  " and the image did not build.

The blocks are in the shared eval base image, generated task Dockerfiles
and the default Dockerfile for native Harbor tasks. Drop the extra
backslash in all three.

The new tests join Docker continuations, split the RUN command the way
sh does, and assert the exact apt-get install arguments for each
generator. On unfixed main the cases with extra packages fail.

Signed-off-by: Narendran Raghavan <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The fix is right: the base line already ends in a backslash, so the extra ' ' turned into an escaped space and apt-get got a package named ' '. Removing it in all three blocks (build_eval_base_image, _write_dockerfile, _write_default_environment_dockerfile) is the whole change, base-only output is identical, and there is no other generator that appends the same suffix. Blank and whitespace-only lines are already filtered by both collectors, so I could not produce a blank package from any path. The new tests are real: they fail on the old code, and the shlex-after-continuation approach mirrors what Docker and sh do.

Before merge: rebase (CHANGELOG conflict, keep both entries) and change _BASE_PACKAGES in the new test to adapter_module._BASE_APT_PACKAGES.split(), because main added procps to the base list and every case in the file fails with the hard-coded list. With that one-line change the file passes on a local merge with main.

Not blocking: a blank/whitespace/CRLF case in the test would pin the guarantee. And for the inline-comment follow-up you already noted: 'tree # for listing' makes the shell drop every later package and the apt-lists cleanup, silently.

Comment thread tests/test_harbor_apt_install_lines.py Resolved
chrisknvidia and others added 3 commits November 12, 2026 22:44
The apt install line tests hard-coded the base package list, so adding
procps to the base list made every case fail, including the ones that
declare no extra packages. Build the expected base packages from
_BASE_APT_PACKAGES instead. The assertions still compare the full package
list, so a blank or stray entry still fails them.

Signed-off-by: Christopher Kevin <[email protected]>

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Reviewed all three generator changes, both dependency collectors, shell continuation behavior, and the full new test file at 373c26e. The author’s main integration and dynamic base-package expectation are preserved. Added the suggested blank/whitespace/CRLF cases; all 15 generated/shared/native cases pass, with clean Ruff/format. No new actionable regression. The inline tree # comment parser issue remains an acknowledged pre-existing follow-up; this PR changes only the redundant continuation and its test coverage. The earlier Python3.13 failure occurred in the unrelated RAGAS deadline test when logging swallowed SIGALRM; its full evidence was preserved and a separate fix is being prepared. Monitoring this new head’s CI.

@rng1995
rng1995 enabled auto-merge (squash) November 13, 2026 08:41

@rng1995 rng1995 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Current-head adoption review: 1062908 is the exact clean automatic merge of reviewed/tested 373c26e and main 6eb7563. Adapter AST, the dynamic base-apt package split fix, and its blank/whitespace/CRLF regression cases are preserved. The 15 focused cases were run on 373c26e; no full rerun on this merge commit is claimed. Current-head CI has only Python 3.12 coverage still running; all other current checks are successful or skipped. No new actionable finding from this merge review.

@rng1995
rng1995 merged commit 38aac1f into main Nov 13, 2026
27 checks passed
@rng1995
rng1995 deleted the naren/apt-packages-continuation branch November 13, 2026 09:36
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