Skip to content

tools: add blip-alpine to bump the Alpine packages - #7199

Draft
christoph-zededa wants to merge 1 commit into
lf-edge:masterfrom
christoph-zededa:alpine-blipper
Draft

christoph-zededa wants to merge 1 commit into
lf-edge:masterfrom
christoph-zededa:alpine-blipper

Conversation

@christoph-zededa

Copy link
Copy Markdown
Contributor

Description

Add tools/blip-alpine, a Go tool that bumps the Alpine packages of EVE and
opens a pull request for it. It does in one program what
tools/bump-and-commit.sh does with bump_dockerfiles.pl, and then pushes
the result and opens the pull request. The scripts stay as they are.

The tool makes pkg/alpine build on top of the current eve-alpine image and
gives every Dockerfile the tags of the packages as they are now, commits
that, and repeats it until no hash changes any more. The outcome is one
commit that touches nothing but lfedge/eve-* image tags.

How it differs from the scripts:

  • A Dockerfile is changed on the syntax tree of openshift/imagebuilder: a tag
    is replaced where that changes the image that a FROM, an ARG default or
    a --from resolves to, and nowhere else. The text of the file is patched
    in place, so comments and layout stay.
  • The package hashes are computed the way linuxkit does it, and the git work
    (fetch, branch, reset, commit, push) is done with go-git. No make, no
    linuxkit and no git binary are involved.
  • The branch is pushed over https to the eve fork of the GitHub user that
    the token belongs to, and a draft pull request is opened on lf-edge/eve
    unless there is one already.

With -d the tool only bumps and commits on the current branch: no branch
switch, no reset, no push and no pull request.

tools/blip-alpine/README.md describes the usage, where the GitHub token
goes and which scopes it needs.

How to test and validate this PR

Unit tests, which need no network and no token:

cd tools/blip-alpine
go test ./...

A dry run, which needs a GitHub token (see the README) because the e-mail
address for the sign-off is read from GitHub. Use a scratch clone: the bump
commit lands on the branch that is checked out.

cd tools/blip-alpine
go build
./blip-alpine -d
git show --stat HEAD
make -C ../.. check-docker-hashes-consistency

Expected: one commit pkgs: bump pkg/alpine and all dependent pkgs that
changes only image tags in Dockerfiles, a clean worktree, and a passing
check-docker-hashes-consistency. On the base of this branch that commit
changes 47 files, and the check passes on it.

A run without -d switches to the branch blip-alpine, resets it to
origin/master, force-pushes it to the fork of the token's user and opens a
draft pull request on lf-edge/eve.

Changelog notes

No user-facing changes.

PR Backports

  • 17.0-stable: No, tooling for master only.
  • 16.0-stable: No, tooling for master only.
  • 14.5-stable: No, tooling for master only.
  • 13.4-stable: No, tooling for master only.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR

And the last but not least:

  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

Not checked: the tool runs on a developer machine and nothing of it ends up
on a device, so there is nothing to test on amd64 or arm64 devices. Labels
are not set yet.

🤖 Generated with Claude Code

blip-alpine does in one program what tools/bump-and-commit.sh does with
bump_dockerfiles.pl, and then pushes the result and opens a pull request
for it.

It makes pkg/alpine build on top of the current eve-alpine image and
gives every Dockerfile the tags of the packages as they are now, commits
that, and repeats it until no hash changes any more. The outcome is one
commit that touches nothing but lfedge/eve-* image tags.

How it differs from the scripts:

- A Dockerfile is changed on the syntax tree of openshift/imagebuilder:
  a tag is replaced where that changes the image that a FROM, an ARG
  default or a --from resolves to, and nowhere else. The text of the
  file is patched in place, so comments and layout stay.
- The package hashes are computed the way linuxkit does it, and the git
  work (fetch, branch, reset, commit, push) is done with go-git. No
  make, no linuxkit and no git binary are involved.
- The branch is pushed over https to the eve fork of the GitHub user
  that the token belongs to, and a draft pull request is opened on
  lf-edge/eve unless there is one already.

With -d the tool only bumps and commits on the current branch: no
branch switch, no reset, no push and no pull request.

The README says where the GitHub token goes and which scopes it needs.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Christoph Ostarek <christoph@zededa.com>
@christoph-zededa

Copy link
Copy Markdown
Contributor Author

the result can be seen here: #7200

@christoph-zededa

Copy link
Copy Markdown
Contributor Author

TODO before this can become "Ready for review": only bump if there are actually changes

@codecov

codecov Bot commented Nov 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 31.43%. Comparing base (9267176) to head (b9025ff).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7199      +/-   ##
==========================================
+ Coverage   30.99%   31.43%   +0.43%     
==========================================
  Files         562      573      +11     
  Lines      101231   102826    +1595     
==========================================
+ Hits        31380    32321     +941     
- Misses      67412    68109     +697     
+ Partials     2439     2396      -43     

☔ 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.

This branch has not been deployed

No deployments
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