dify icon indicating copy to clipboard operation
dify copied to clipboard

autofix fails on PRs touching api/ because a .github test file on main is not Ruff-formatted

Open alterxyz opened this issue 2 weeks ago • 1 comments

Self Checks

  • [x] I have read the Contributing Guide and Language Policy.
  • [x] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [x] I have searched for existing issues search for existing issues, including closed ones.
  • [x] I confirm that I am using English to submit this report, otherwise it will be closed.
  • [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • [x] Please do not modify this template :) and fill in all the required fields.

Dify version

main (after #39238)

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. Open any PR against main that changes a file under api/ and does not touch .github/.
  2. The autofix workflow runs cd api && uv run ruff format ...
  3. Ruff reformats .github/scripts/tests/test_check_hotfix_cherry_picks.py, which was added in #39238 without the repo's Ruff formatting (api/.ruff.toml). One self.commit(...) call in test_unavailable_source is split over three lines; Ruff joins it into one.

Local check on current main: cd api && uvx [email protected] format --diff .. reports "1 file would be reformatted" for that file.

✔️ Expected Behavior

main is already formatted, so autofix makes no change outside the PR's own files, and the required check passes.

❌ Actual Behavior

autofix.ci stops with: "The autofix.ci action is not allowed to modify the .github directory." The required autofix check fails on every PR that touches api/.

alterxyz avatar Nov 19 '26 22:11 alterxyz

Spot on. autofix.ci hard-blocks changes inside .github/ by design to prevent unauthorized workflow modifications.

grinem avatar Nov 20 '26 00:11 grinem