Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
71f167e
Add authorship information to Druid 26.0.0 patches
nightkr Dec 12, 2024
a6be128
Add patchable checkout script
nightkr Dec 12, 2024
9e91e7e
Add patchable export script, convert Druid 26.0.0 patches to patchable
nightkr Dec 12, 2024
3796a62
Scrub commit IDs
nightkr Dec 12, 2024
570d0ff
Remove patch count from header
nightkr Dec 12, 2024
9b7e53f
Add test patches
nightkr Dec 12, 2024
55de303
Rebase in test patch
nightkr Dec 12, 2024
3be52d4
Add docs
nightkr Dec 12, 2024
a2bc01a
fix: patchable worktree initialization (#977)
dervoeti Jan 17, 2025
a091756
Start rewriting patchable in Rust
nightkr Feb 4, 2025
619852b
Logging
nightkr Feb 5, 2025
034b911
Fix broken initial checkout
nightkr Feb 5, 2025
a99104b
Fetch commits individually from upstream instead of cloning
nightkr Feb 5, 2025
d11241b
Make commit IDs deterministic
nightkr Feb 6, 2025
3320a06
Reimplement git-am for better determinism
nightkr Feb 6, 2025
710d640
Mailsplit each patch file separately
nightkr Feb 6, 2025
1228b7b
Simplify worktree checkout logic a bit
nightkr Feb 6, 2025
2dbf672
Forward logging from libgit2
nightkr Feb 6, 2025
11d80a2
Normalize commits before exporting
nightkr Feb 6, 2025
12f5df5
Factor out implementation details from main()
nightkr Feb 7, 2025
cdd4427
Modularize
nightkr Feb 7, 2025
6741b2b
Start handling errors
nightkr Feb 7, 2025
7d82e15
Factor out patch mail parsing
nightkr Feb 7, 2025
590ca01
More error handling
nightkr Feb 7, 2025
92696d2
Snafuize the remaining errors
nightkr Feb 10, 2025
58f3ef4
Shrink the error types a bit
nightkr Feb 10, 2025
25bda8d
Move patchable to rust/patchable for consistency
nightkr Feb 10, 2025
7908127
Docs
nightkr Feb 10, 2025
f21136d
Remove obsolete patchable.nu
nightkr Feb 10, 2025
3baa3e8
Add patchable init
nightkr Feb 10, 2025
e5b8282
Enforce that base must be a commit ID in patchable.toml
nightkr Feb 10, 2025
4dee9ec
Ensure that init always fetches base from upstream
nightkr Feb 10, 2025
2a75edd
Print worktree directory on checkout
nightkr Feb 13, 2025
ffae725
Document how to rebase patch series
nightkr Feb 13, 2025
5967795
Remove dummy patches
nightkr Feb 13, 2025
8a65c10
Documentation and cleanup
nightkr Feb 13, 2025
07d05de
Remove git version suffix from patches
nightkr Feb 13, 2025
d63f73d
Skip comments in series file
nightkr Feb 13, 2025
5dfb933
Document how to import invalid patch series into patchable
nightkr Feb 13, 2025
205d831
More documentation
nightkr Feb 14, 2025
7020369
Add openssl to shell.nix
nightkr Feb 14, 2025
1366a0c
Reword docs following @soenkeliebau's comments
nightkr Feb 14, 2025
9f719af
Merge branch 'main' into spike/patchable
nightkr Feb 14, 2025
9087744
Then begone
nightkr Feb 14, 2025
21b9df4
Merge branch 'spike/patchable' of github.com:stackabletech/docker-ima…
nightkr Feb 14, 2025
c0f93d1
Changelog
nightkr Feb 14, 2025
19af48c
Fix gitignore EOLs
nightkr Feb 14, 2025
c1e039c
Update README.md
nightkr Feb 17, 2025
b2998f5
Update README.md
nightkr Feb 17, 2025
675d332
Fix FMPP update patch metadata
nightkr Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 49 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,52 @@ When triggered manually it will _not_ push the images to the registry.

Many products apply Stackable-specific patches, managed by [Patchable](rust/patchable).

Patchable doesn't _edit_ anything by itself. Instead, it's a uniform way to apply a set of patches
to an upstream Git repository, and then export your local changes back into patch files.
You can then edit the branch created by patchable using any Git frontend, such as the git CLI or
[jj](https://jj-vcs.github.io/jj/latest/).

This way, the patch files are the global source of truth and track the history of our patch series,
while you can still use the same familiar Git tools to manipulate them.

### Check out patched sources locally

This is not required for building the images, but is useful when debugging or hacking on our patch sets.
> [!NOTE]
> This is not required for building images, but is used for when hacking on or debugging patch series.

```sh
cd $(cargo patchable checkout druid 26.0.0)
```
# Fetches the upstream repository (if required), and creates a git worktree to work with it
# It also creates two branches:
# - patchable/{version} (HEAD, has all patches applied)
# - patchable/base/{version} (the upstream)
pushd $(cargo patchable checkout druid 26.0.0)

### Save patched sources
# Commit to add new patches
git commit

```sh
# Rebase against the base commit to edit or remove patches
git rebase --interactive patchable/base/26.0.0
# jj edit also works, but make sure to go back to the tip before exporting

# When done, export your patches and commit them (to docker-images)
popd
cargo patchable export druid 26.0.0
git status
```

> ![IMPORTANT]
> `cargo patchable export` exports whatever is currently checked out (`HEAD`) in the worktree.
> If you use `jj edit` (or `git switch`) then you _must_ go back to the tip before exporting, or
> any patches after that point will be omitted from the export.

### Initialize a new patch series

Patchable stores metadata about each patch series in its `patchable.toml`, and will not be able to check out
a patch series that lacks one. It can be generated using `cargo patchable init`:

```sh
cargo patchable init druid 28.0.0 --upstream https://github.com/apache/druid.git --base druid-28.0.0
cargo patchable checkout druid 28.0.0
```

### Importing patch series into Patchable
Expand Down Expand Up @@ -116,17 +144,31 @@ cargo patchable init druid 28.0.0 --upstream https://github.com/apache/druid.git
# Create and go to the worktree for the new version
pushd $(cargo patchable checkout druid 28.0.0)

# Rebase the patch series
# Cherry pick the old patch series
git cherry-pick patchable/base/26.0.0..patchable/26.0.0
# Solve conflicts and `git cherry-pick --continue` until done
# You can also use `git cherry-pick --skip` to skip patches that are no longer required
# You can also use `git cherry-pick --skip` to skip resolving conflicts for patches that are no longer required

# If some patches are no longer required, use an interactive rebase to remove them (or do other cleanup)
git rebase --interactive patchable/base/28.0.0

# Leave and export the new patch series!
popd
cargo patchable export druid 28.0.0
git status
```

### Porting patches between versions

Individual patches can also be cherry-picked across versions.

For example, assuming we are in the Druid 28.0.0 workspace and want to port the last patch of the Druid 26.0.0 series:

```sh
# git cherry-pick <hash> is also fine for grabbing arbitrary patches
git cherry-pick patchable/26.0.0
```

## Verify Product Images

To verify if Apache Zookeeper validate against OpenShift preflight, run:
Expand Down