mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-11 17:14:08 +01:00
github.com/kuhyx/mtk-root
Unlike the app extractions, mtk_root could not travel alone: its four
libraries and three of its four test suites sat in scripts/lib/, one
directory up from the stages that source them. Taking only the directory
would have orphaned eight files here and left the new repo unable to
source anything, so all twelve moved in one filter-repo pass. The
mtk_root/ + lib/ sibling layout is preserved, so every
`source "$SCRIPT_DIR/../lib/..."` resolves with no call site edited.
Two things the new repo needed that the monorepo provided implicitly:
lib/tests/run_all.sh -- the copy here is shared with the non-mtk suite
and stays. Without a new one, shell-tests.yml's
glob over */lib/tests/run_all.sh would have
stopped covering these suites on a green build.
.shellcheckrc -- external-sources + source-path=SCRIPTDIR, which
is what lets shellcheck run with no severity
filter and still pass on the ../lib/ sources.
mtk_harness.sh stays here despite the name: test_common_datetime.sh
sources it. Removing it broke that suite outright, which running the
suite caught immediately. Its header now describes what it actually
serves; the misleading name is kept on purpose, since renaming would
churn its one consumer for nothing.
Verified: 84 tests pass in the new repo with shellcheck clean, 55 still
pass here, and check_shell_coverage.sh --all exits 0 with the four
mtk_root allowlist entries gone.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PJrqKERAo5QUeEHWS5Asgp
54 lines
3.6 KiB
JSON
54 lines
3.6 KiB
JSON
{
|
|
"intent": "Extract the MediaTek rooting toolkit into its own public repo, taking the four mtk_* libraries and four test suites that lived outside mtk_root/ and would otherwise have been orphaned.",
|
|
"scope": [
|
|
"linux_configuration/scripts/mtk_root/ (24 files) -> github.com/kuhyx/mtk-root",
|
|
"linux_configuration/scripts/lib/mtk_{classify,common,device,partitions}.sh - moved with it",
|
|
"linux_configuration/scripts/lib/tests/test_mtk_{classify,device,partitions}.sh - moved with it",
|
|
"lib/tests/mtk_harness.sh - deliberately KEPT, it is shared with test_common_datetime.sh",
|
|
"meta/shell-coverage-allowlist.txt - four mtk_root entries removed",
|
|
"Non-goal: single_use/utils/lib/bl9000_*.sh, separate Android tooling that merely mentions mtkclient"
|
|
],
|
|
"changes": [
|
|
"Extracted mtk_root/ plus the eight external files in one filter-repo pass with --path-rename linux_configuration/scripts/:, preserving the mtk_root/ + lib/ sibling layout so every `source \"$SCRIPT_DIR/../lib/...\"` resolves unchanged.",
|
|
"Added lib/tests/run_all.sh to the new repo. The monorepo's copy is shared with the non-mtk suite and correctly stayed behind; without a new one, shell-tests.yml's glob over */lib/tests/run_all.sh would have silently stopped covering these suites.",
|
|
"Carried .shellcheckrc (external-sources, source-path=SCRIPTDIR) into the new repo, which is what lets its CI run shellcheck with no severity filter and still pass.",
|
|
"Restored mtk_harness.sh after the initial removal broke test_common_datetime.sh, and rewrote its header to describe what it actually serves now. The misleading name is kept deliberately, since renaming would churn its one consumer.",
|
|
"Removed the four mtk_root entries from meta/shell-coverage-allowlist.txt."
|
|
],
|
|
"verification": [
|
|
{
|
|
"command": "./lib/tests/run_all.sh (extracted repo)",
|
|
"result": "pass",
|
|
"evidence": "test_mtk_classify 22 passed, test_mtk_device 26 passed, test_mtk_partitions 36 passed - 84 total, 0 failed."
|
|
},
|
|
{
|
|
"command": "find . -name '*.sh' | xargs shellcheck (extracted repo)",
|
|
"result": "pass",
|
|
"evidence": "Exit 0 after adding .shellcheckrc. Before it, the ../lib/ sources reported SC1091 info findings, which CI treats as failures."
|
|
},
|
|
{
|
|
"command": "./linux_configuration/scripts/lib/tests/run_all.sh (monorepo, after removal)",
|
|
"result": "fail then pass",
|
|
"evidence": "First run: 'mtk_harness.sh: No such file or directory'. Removing the harness broke test_common_datetime.sh, which sources it. Restored; the suite reports 55 passed, 0 failed. This is the silent CI-coverage loss the plan warned about, caught by running the suite."
|
|
},
|
|
{
|
|
"command": "bash meta/scripts/check_shell_coverage.sh --all",
|
|
"result": "pass",
|
|
"evidence": "Exit 0 with the four mtk_root allowlist entries removed."
|
|
},
|
|
{
|
|
"command": "gh repo create + push",
|
|
"result": "pass",
|
|
"evidence": "github.com/kuhyx/mtk-root public on main, 6 commits of preserved history plus the standalone-setup commit."
|
|
}
|
|
],
|
|
"risks": [
|
|
"mtk_harness.sh keeps a name that no longer matches its contents; the header now says so explicitly rather than leaving a future reader to discover it.",
|
|
"The toolkit targets hardware not currently in hand (per READY.md the Ulefone props are unverified), so the extracted repo's tests exercise decision logic only - the same limitation it had here."
|
|
],
|
|
"rollback": [
|
|
"git revert the removal commit to restore mtk_root/ and the eight lib files.",
|
|
"Re-run ./linux_configuration/scripts/lib/tests/run_all.sh and check_shell_coverage.sh --all to confirm the restored state is coherent."
|
|
]
|
|
}
|