Skip to content

ci: speed up PR-tests and add linpeas fixture typo#603

Closed
carlospolop wants to merge 3 commits intomasterfrom
demo/pr-tests-speedup-fixer-check
Closed

ci: speed up PR-tests and add linpeas fixture typo#603
carlospolop wants to merge 3 commits intomasterfrom
demo/pr-tests-speedup-fixer-check

Conversation

@carlospolop
Copy link
Copy Markdown
Collaborator

Summary

  • comment PR-tests to keep only build steps for linpeas/macpeas and first winpeas test
  • add one small README improvement in linPEAS docs
  • add a deliberate typo in linPEAS builder entrypoint to trigger fixer workflow

This should be auto-fixed by Chack Agent after PR-tests failure, with PR auto-merge if checks pass.

@github-actions
Copy link
Copy Markdown
Contributor

PR #603 had a failing workflow "PR-tests".

Run: https://github.com/peass-ng/PEASS-ng/actions/runs/22369031738

Launching Chack Agent to attempt a fix.

@github-actions
Copy link
Copy Markdown
Contributor

Summary

  • I diagnosed the failing PR CI jobs Build_and_test_linpeas_pr and Build_and_test_macpeas_pr.
  • Root cause: a syntax error in the linPEAS builder script prevented python3 -m builder.linpeas_builder from running.
  • I applied a minimal fix and ran quick local checks. Repo is ready to be picked up by CI.

Cause

  • File: linPEAS/builder/linpeas_builder.py had a Python syntax bug:
    • Wrong guard: if __name__ = "__main__": (assignment, invalid syntax)
    • This causes the module import / -m invocation to fail during the CI build step that runs python3 -m builder.linpeas_builder ....

Fix Applied

  • Replaced the incorrect assignment with a proper equality check:
    • Changed if __name__ = "__main__": to if __name__ == "__main__":
  • File reference: linPEAS/builder/linpeas_builder.py:28 (the __main__ guard).
  • Commit created: Fix syntax: use '==' in __main__ guard in linpeas_builder.py (local commit made).

What I ran (representative)

  • Inspected workflows and build steps:
    • rg "Build_and_test_linpeas_pr|Build macpeas" .github -S
    • Opened .github/workflows/PR-tests.yml
  • Inspected builder module:
    • nl -ba linPEAS/builder/linpeas_builder.py
  • Applied the minimal edit:
    • small Python edit (replacement) and git commit
  • Quick checks:
    • python3 -m py_compile linPEAS/builder/linpeas_builder.py
    • python3 -m py_compile linPEAS/builder/src/*.py
    • (I also ran cd linPEAS && python3 -m builder.linpeas_builder --all --output /tmp/linpeas_test.sh locally to exercise the module; note this attempted to download regexes — that behavior is expected for the builder and occurs in CI as well.)

Notes / Observations

  • The syntax error is the explicit cause of the build step failures (the CI command is exactly python3 -m builder.linpeas_builder ...).
  • The builder script may attempt network actions (e.g., downloading regexes). That was observed when I executed it locally; CI runners will similarly trigger network activity as part of the builder run (this is normal for the project).
  • Change is intentionally minimal and safe.

Next steps (recommended)

  • CI should now succeed for the Build linpeas and Build macpeas steps on the PR branch demo/pr-tests-speedup-fixer-check. If the CI run still fails, please paste the new job log and I’ll continue diagnosing.
  • If you'd like, I can:
    • Run a broader static check across the repo or add a simple unit test for builder import.
    • Re-run the builder locally but avoid network calls by pre-populating build_lists/regexes.yaml if desired.

If you want, I can show the exact diff I applied or push any additional small hardening (for example, catching import-time side effects), otherwise the repo is ready.

@github-actions
Copy link
Copy Markdown
Contributor

Summary: This PR comments out many PR test steps in .github/workflows/PR-tests.yml to speed up CI, adds two helper files (chack_failure_summary.txt, chack_prompt.txt) used by the fixer workflow, and adds a small README note in linPEAS/README.md.

Concerns and questions before merging:

  • CI coverage reduction: The workflow now has many test steps commented out (dotnet unit tests, multiple winPEAS checks, linPEAS builder tests and many linPEAS/macPEAS runtime checks). Commenting these out reduces verification and increases the risk of regressions being merged. Please explain why these tests are being disabled here rather than using a conditional/opt-in mechanism (labels, separate fast workflow, or gating only for known-safe commits).
  • Deliberate typo: The PR description mentions a deliberate typo in the linPEAS builder entrypoint to trigger a fixer workflow. I do not see a lingering typo in the diff between the specified commits (and there is a follow-up commit titled "Fix syntax..."), so please confirm whether the typo still exists or has already been auto-fixed. If the typo was only temporary, note that in the PR description to avoid confusion.
  • Committed fixer artifacts: The two new files (chack_prompt.txt, chack_failure_summary.txt) look like helper/debug artifacts for the fixer. Confirm they are intended to be committed to the repo and acceptable to keep in history; otherwise consider removing them or placing them in a non-released location.

Recommendation: Do not merge as-is. Either restore the essential tests or provide a clear, documented justification and timeline for temporarily reducing PR test coverage, and confirm the deliberate-typo situation (or remove it). After tests are restored or a safe conditional skip is implemented and CI passes, I would be comfortable merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant