Skip to content

kt: content-release fixes and stale docs - #92

Open
shreeya-patel98 wants to merge 4 commits into
mainlinefrom
{shreeya}_kt_fixes
Open

shreeya-patel98 wants to merge 4 commits into
mainlinefrom
{shreeya}_kt_fixes

Conversation

@shreeya-patel98

@shreeya-patel98 shreeya-patel98 commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes and doc updates from setting up kt and running content releases
(lts-9.2, cbr-7.9).

  • kt: KT.md: fix stale setup, checkout and content-release docs
    The repos kt setup clones, the lts/cbr dist-git note, the checkout branch
    name ({user}_<branch>, -e/--extra), content-release prerequisites, and
    where its logs and RPMs end up no longer matched the code.

  • kt: KT.md: document the NFS export needed by CentOS 7 vms
    cbr-7.9 vms mount base_path over NFS, but kt doesn't set up the export and
    it isn't documented anywhere. Without it the mount fails silently and
    --test reports "No package ... available" for every RPM. The export is
    writable (kt vm --test builds and installs in the shared tree, partly under
    sudo) but uses all_squash to the user's uid/gid, so root in a vm never
    acts as root on the host.

  • kt content-release: start each build with an empty build_files
    --build takes the first *.src.rpm in build_files and --test installs
    every RPM in it, but build_files was reused across builds, so a previous
    build's RPMs could be built or installed instead of the new ones (and
    mock's logs got mixed). A non-empty build_files is now moved to
    build_files.prev.

  • kt content-release: refuse to prepare an already tagged HEAD
    Re-running --prepare found the tag it had just created, so the commit
    range was empty, yet a content release with no patches was committed and
    the version bumped again. It now fails and prints the git tag -d command.

Testing

  • Unit tests added for both code changes; full suite passes (127 tests),
    pre-commit (ruff check/format) passes.
  • build_files: real kt content-release lts-9.2 --build with this branch;
    the previous build moved to build_files.prev, the new build_files held only
    the fresh SRPM, and the binary RPM build started from it.
  • prepare check: run against real lts-9.2 (worktree) and cbr-7.9 (clone)
    workspaces whose HEAD carries the release tag; both refused with the
    correct git tag -d command. The check runs before mkdistgitdiff.py, so
    nothing is changed when it fails.
  • NFS export: the documented setup fixed content-release cbr-7.9 --test
    (NFSv4.1 mount, RPMs installed, new kernel booted). With the all_squash
    export, in the cbr-7.9 vm: root reads RPMs and yum reinstalls one from the
    share, user and root writes in the shared source tree work and land on the
    host owned by the user, and chown root from the vm is refused.

🤖 Generated with Claude Code

Coverage Report

Name Stmts Miss Branch BrPart Cover Missing
check_fips_changes.py 42 42 12 0 0% 8-67
check_kernel_commits.py 179 179 76 0 0% 3-371
ciq-cherry-pick.py 194 100 54 3 49% 48-50, 55-90, 130, 173, 179-180, 201-202, 224-225, 240-242, 262-271, 294-331, 335-434
ciq-tag.py 146 146 16 0 0% 3-378
ciq_tag.py 232 232 54 0 0% 1-464
jira_pr_check.py 180 180 80 0 0% 3-381
kt/commands/content_release/impl.py 251 209 54 0 16% 89-201, 211-254, 266-318, 359-528
kt/ktlib/ciq_helpers.py 328 223 152 6 29% 31-51, 74-106, 126->129, 136->151, 169-171, 242-243, 247, 252, 277-314, 327-333, 346-347, 351-353, 359, 380-382, 390-395, 404-406, 415-420, 431-444, 455-479, 489-503, 561-627, 636-646, 650-659, 669-684, 696-713
kt/ktlib/command_runner.py 33 20 6 0 33% 16, 20-33, 37-61, 65-66
kt/ktlib/config.py 59 0 16 0 100%
kt/ktlib/jira.py 148 119 32 0 16% 19-27, 39-55, 58-61, 64-68, 71-74, 77-80, 83-88, 91-98, 101-121, 124-131, 134-138, 142-157, 161-164, 171-184, 187-190, 193-209, 212-219, 222-224
kt/ktlib/kernel_workspace.py 146 49 26 2 63% 24, 100, 141-143, 148-150, 153-159, 172-183, 194-204, 221-224, 228-265
kt/ktlib/kernels.py 96 13 20 1 86% 77-85, 139, 155-162
kt/ktlib/local.py 5 1 0 0 80% 12
kt/ktlib/mock.py 100 75 16 0 22% 29-34, 49-67, 80-93, 115-168, 184-204, 223-241
kt/ktlib/repo.py 29 15 2 0 45% 30-31, 34-35, 43-55
kt/ktlib/ssh.py 12 5 2 0 50% 9-12, 16
kt/ktlib/util.py 17 0 0 0 100%
kt/ktlib/virt.py 80 39 10 0 46% 26, 34-37, 51-78, 82-88, 92-93, 97, 101, 105, 109, 119-127, 133-138, 142-147
kt/ktlib/vm.py 312 148 56 3 51% 126-143, 176-185, 193-204, 233-237, 252->263, 280->286, 291-301, 304-305, 318-322, 325, 328-344, 349-366, 369-376, 385-391, 436-447, 450-451, 454, 458-463, 475-488, 501-508, 517, 526-538, 541-548, 551-560, 563
release_config.py 2 2 0 0 0% 7-27
rolling-release-update.py 264 264 106 0 0% 1-412
run_interdiff.py 165 165 56 0 0% 3-244
update_lt_spec.py 211 211 46 0 0% 9-400
TOTAL 3231 2437 892 15 22%

Several sections no longer match the code:
- kt setup: list the repos it actually clones from kernels.yaml
  (dist-git-tree, not dist-git-tree-lts/-cbr), say that private_repos
  are cloned too and that re-running it updates existing repos
- the NOTE on lts/cbr dist-git: they use the public dist-git-tree
  unless overridden in .private_repos.yaml
- kt checkout: local branch is {<user>}_<branch>, or
  {<user>}_<extra>_<branch> with -e/--extra, not {<user>}/<branch>;
  fix the lts-9.2 example branch names
- content-release: list its prerequisites (<base_path>/kernel-tools and
  <base_path>/mock-configs), say that --prepare releases the local src
  branch, that cbr needs no depot credentials, and where the logs and
  RPMs end up

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings December 1, 2026 11:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The documented NFS export grants guest root users across the subnet root-level write access to host release repositories and tooling, requiring restricted, read-only, root-squashed access.

1 open issue
What changed in this PR

This PR improves kt content-release reliability by preventing stale build artifacts and repeated preparation of an already tagged source HEAD. It also updates setup and release documentation to match current behavior.

Changes:

  • Rotate previous build artifacts into build_files.prev before each build.
  • Reject preparation when HEAD already carries a release tag, with unit tests for both safeguards.
  • Refresh setup, checkout, release prerequisites, output paths, and CentOS 7 NFS instructions.
File Description
tests/​kt/​commands/​test_content_release_prepare.py Tests release-tag detection and rejection.
tests/​kt/​commands/​test_content_release_build.py Tests clean build directories and artifact rotation.
kt/​KT.md Updates workflow documentation and adds NFS setup instructions.
kt/​commands/​content_release/​impl.py Adds tagged-HEAD protection and build-directory rotation.

Review effort: Balanced

Comment thread kt/KT.md Resolved
shreeya-patel98 and others added 3 commits December 1, 2026 11:27
CentOS 7 vms (cbr-7.9) mount <base_path> from the host over NFS. kt
writes the mount into cloud-init but does not set up the export on the
host, and nothing documented it. Without the export the mount fails
silently and content-release --test fails with "No package ...
available" for every RPM in build_files.

Document the export, the nfs-server service and the libvirt firewall
zone services needed. The export has to be writable because kt vm --test
builds and installs the kernel and kselftests in the shared source tree,
partly under sudo; use all_squash to the user's uid/gid so root in a vm
writes as that user instead of as root on the host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--build picks the SRPM as the first *.src.rpm found in build_files and
--test installs every RPM in it, but build_files is reused across
builds. After a version bump or a redone release, RPMs of the previous
build are still there and may be built or installed instead of the new
ones. mock also appends to build.log/root.log in its resultdir, so the
logs of several builds end up mixed together.

Move a non-empty build_files to build_files.prev (replacing an older
one) before building, so only one previous build is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mkdistgitdiff.py releases the commits between the last tag (found with
git describe) and HEAD, and then tags HEAD. Running --prepare a second
time, e.g. to redo a release that was never pushed, finds the tag it
created itself, so the range is empty. A content release with no
patches is still committed and the version bumped again.

Check for a ciq_kernel-/fips_kernel- tag on the src HEAD before
running mkdistgitdiff.py and fail with the command to delete it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings December 1, 2026 11:27

Copilot AI left a comment

Copy link
Copy Markdown

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 are reported for the release-safety safeguards and documentation updates.

1 open issue

Review effort: Balanced

@PlaidCat PlaidCat 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.

:shipit:

@bmastbergen bmastbergen 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.

🥌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants