Commit Graph
3 Commits
Author SHA1 Message Date
Hector Ventura 85813108c1 chore(rename): add a script that moves an open branch across the rename (#6790)
* chore(rename): add a script that moves an open branch across the rename

Part of #6589. After the cut, a branch that forked before it conflicts on
every Java file it touches. tools/rename/rebase_across_rename.sh runs
rename_package.py apply on the branch's merge-base and on its tip, and
cherry-picks the renamed tip onto the target with the renamed merge-base as
the merge base, so only real conflicts remain. The branch becomes one commit
carrying every original message in order, sign-offs included, and the first
commit's author; the old tip is kept as <branch>-before-rename and nothing
is pushed.

rename_package.py now imports the partition lexer only for report, so apply
runs on a bare python3 without PyYAML.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

* fix(rename): run the rebase script from any directory of the checkout

git rev-list pathspecs and git archive paths are relative to the current directory, so a run from a subdirectory found no cut and reported that the rename had not landed. The script now changes to the top level first.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-29 12:52:49 -04:00
Hector Ventura 02cc40bb40 chore(rename): rewrite the Quarkus env-var form of the package (#6773)
Quarkus spells a log category in an environment variable upper-cased with underscores (QUARKUS_LOG_CATEGORY__IO_GITHUB_HECTORVENT_FLOCI_...). The rename tool matched only the dotted and path forms, so apply left those references on the old package and report did not count them. Both now handle the env-var form, and the leftover check in the test is case-insensitive so a missed uppercase form fails it.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-27 19:16:53 -04:00
Hector Ventura 383315194a chore: add the package rename tool (report and apply) (#6556)
Floci's Java package moves from io.github.hectorvent.floci to io.floci.aws,
the convention the other emulators already use. The rename lands as one
mechanical cut, prepared by smaller PRs, and this is the tool for both.

tools/rename/rename_package.py report counts every reference to the old
package by where it sits: package and import lines, inline names in
code, strings, comments, non-Java files, and anything the cut would not
rewrite. Each prep PR can show its count going down. apply performs the
cut in the two commits it lands as: --moves-only renames the trees with
git mv so every file is a 100% rename, and --rewrite-only rewrites the
references, including the Maven groupId and the native-image directory.
The artifactId stays floci. CHANGELOG.md and the tool itself are left
alone.

It reuses code_text from tools/partition/partition_literals.py, so
comments and strings are read the way the partition gate reads them.
make rename-test runs its tests in the Partition Literals workflow, so a
change to that shared lexer cannot break the tool silently.

A dry run on main moved 5,966 files and rewrote 26,016 lines with no old
name left outside CHANGELOG.md; main and tests compile, and 245 focused
tests pass. Checkstyle then fails only in the 357 files whose
suppression paths start with /floci/, which a follow-up makes
package-independent.

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
2026-10-25 23:10:14 -04:00