mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-07-04 15:43:06 +02:00
Fix CI pipeline and clear the lint backlog it had been hiding
Root cause of the zero-runs-ever CI mystery: GitHub Actions was disabled at the repo level (actions/permissions enabled:false). Re-enabled it via the API, which immediately surfaced a backlog of pre-existing issues that local pre-commit runs (scoped to changed files only) never caught: - pylama is unused (grep confirms zero references outside requirements.txt) and its pytest plugin auto-loads via setuptools entry points, crashing the pytest-coverage hook with ModuleNotFoundError: pkg_resources on the CI runner. Removed it. - zsh-syntax hook had no zsh binary on the CI image; added an install step. - _load_trusted_device_values() in adb_common.sh had an unused optional arg (shellcheck SC2120); confirmed via grep it's never called with one, including in tests, and simplified it away. - claude-code-review.yml/claude.yml had a stray trailing blank line. None of this is related to the wake_alarm gatelock migration committed earlier; it's purely the CI/lint backlog that surfaced once Actions actually started running for the first time in the repo's history. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A7vbgtFfZmfxJtN5DdtJky
This commit is contained in:
parent
7f3beadcd0
commit
6478e5a7d9
1
.github/workflows/claude-code-review.yml
vendored
1
.github/workflows/claude-code-review.yml
vendored
@ -41,4 +41,3 @@ jobs:
|
|||||||
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
|
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
|
||||||
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
||||||
# or https://code.claude.com/docs/en/cli-reference for available options
|
# or https://code.claude.com/docs/en/cli-reference for available options
|
||||||
|
|
||||||
|
|||||||
1
.github/workflows/claude.yml
vendored
1
.github/workflows/claude.yml
vendored
@ -47,4 +47,3 @@ jobs:
|
|||||||
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
|
||||||
# or https://code.claude.com/docs/en/cli-reference for available options
|
# or https://code.claude.com/docs/en/cli-reference for available options
|
||||||
# claude_args: '--allowed-tools Bash(gh pr *)'
|
# claude_args: '--allowed-tools Bash(gh pr *)'
|
||||||
|
|
||||||
|
|||||||
3
.github/workflows/pre-commit.yml
vendored
3
.github/workflows/pre-commit.yml
vendored
@ -16,6 +16,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y zsh
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
|
|||||||
@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
"intent": "Fix the CI environment so it actually runs: re-enabled GitHub Actions repo-wide (was disabled, explaining why python-tests/pre-commit/Claude Code workflows had zero runs ever), then clear the pre-existing lint/test backlog the first real run surfaced.",
|
||||||
|
"scope": [
|
||||||
|
"meta/requirements.txt (drop unused, broken pylama dependency)",
|
||||||
|
".github/workflows/pre-commit.yml (install zsh for the zsh-syntax hook)",
|
||||||
|
".github/workflows/claude-code-review.yml, claude.yml (trailing blank line at EOF)",
|
||||||
|
"phone_focus_mode/lib/adb_common.sh (shellcheck SC2120 dead optional-arg)",
|
||||||
|
"Non-goal: anything related to the wake_alarm gatelock migration, already committed separately"
|
||||||
|
],
|
||||||
|
"changes": [
|
||||||
|
"Set actions/permissions enabled=true for kuhyx/testsAndMisc via the GitHub API (was enabled:false, the actual root cause of zero CI runs)",
|
||||||
|
"Removed pylama>=8.4.0 from meta/requirements.txt: grep confirmed it is referenced nowhere in the repo, and its pytest plugin auto-loads via setuptools entry points, crashing the entire pytest-coverage pre-commit hook with ModuleNotFoundError: pkg_resources on the CI runner's newer setuptools",
|
||||||
|
"Added an 'Install system dependencies' step (apt-get install zsh) to pre-commit.yml so the zsh-syntax hook's `zsh -n` check has a binary to run, instead of failing with 'zsh: command not found'",
|
||||||
|
"Simplified _load_trusted_device_values() in adb_common.sh to drop its unused optional ${1:-...} parameter (grep confirmed it is never called with an argument anywhere, including tests), resolving shellcheck SC2120",
|
||||||
|
"Stripped the extra trailing blank line from claude-code-review.yml and claude.yml that the trailing-whitespace/end-of-file-fixer hooks had been silently flagging since CI never ran to enforce them"
|
||||||
|
],
|
||||||
|
"verification": [
|
||||||
|
{
|
||||||
|
"command": "gh api repos/kuhyx/testsAndMisc/actions/permissions",
|
||||||
|
"result": "pass",
|
||||||
|
"evidence": "enabled:true, allowed_actions:all (was enabled:false before the fix); confirmed by pushing an empty commit and observing 'Pre-commit checks' run for the first time ever in the repo's history"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "shellcheck --severity=warning phone_focus_mode/lib/adb_common.sh",
|
||||||
|
"result": "pass",
|
||||||
|
"evidence": "clean, no SC2120 warning"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "bash phone_focus_mode/lib/tests/test_adb_common.sh",
|
||||||
|
"result": "pass",
|
||||||
|
"evidence": "13 passed, 0 failed -- the simplified function is unchanged in behavior"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "python -m pytest (full repo suite, after removing pylama and reinstalling requirements.txt)",
|
||||||
|
"result": "pass",
|
||||||
|
"evidence": "949 passed, TOTAL coverage 100.00%"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "pre-commit run --all-files",
|
||||||
|
"result": "pass",
|
||||||
|
"evidence": "every hook passed including shellcheck and pytest-coverage, which were previously broken in CI"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"risks": [
|
||||||
|
"Enabling Actions repo-wide is a GitHub account/repo setting change with broader effect than just this commit -- confirmed with the user before applying via the API",
|
||||||
|
"zsh installed via apt-get in CI adds a small amount of job time; acceptable tradeoff for the zsh-syntax hook to actually function"
|
||||||
|
],
|
||||||
|
"rollback": [
|
||||||
|
"git revert this commit for the code/workflow changes",
|
||||||
|
"Re-disable Actions via `gh api -X PUT repos/kuhyx/testsAndMisc/actions/permissions -F enabled=false` if re-disabling is ever desired (not expected)"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -56,7 +56,6 @@ pycodestyle>=2.11.0
|
|||||||
pydocstyle>=6.3.0
|
pydocstyle>=6.3.0
|
||||||
pyflakes>=3.2.0
|
pyflakes>=3.2.0
|
||||||
pygame>=2.0
|
pygame>=2.0
|
||||||
pylama>=8.4.0
|
|
||||||
pylint>=3.0.0
|
pylint>=3.0.0
|
||||||
pyright>=1.1.350
|
pyright>=1.1.350
|
||||||
pytest>=8.0.0
|
pytest>=8.0.0
|
||||||
|
|||||||
@ -44,7 +44,7 @@ adb_list_serials() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_load_trusted_device_values() {
|
_load_trusted_device_values() {
|
||||||
local file_path="${1:-${TRUSTED_DEVICE_FILE}}"
|
local file_path="${TRUSTED_DEVICE_FILE}"
|
||||||
local -a loaded_values=()
|
local -a loaded_values=()
|
||||||
|
|
||||||
[[ -f "${file_path}" ]] || return 1
|
[[ -f "${file_path}" ]] || return 1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user