Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PortAddonPullRequest: skip diff on auto-generated files #44

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions oca_port/port_addon_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
"oca_dependencies.txt",
]

BOT_FILES_TO_SKIP = [
"README.rst",
"static/description/index.html",
]

# Fake PR for commits w/o any PR (used as fallback)
FAKE_PR = g.PullRequest(*[""] * 6)

Expand Down Expand Up @@ -290,6 +295,13 @@ def _skip_diff(commit, diff):
if diff.renamed:
return False, ""
diff_path = diff.b_path.split("/", maxsplit=1)[0]
# Skip diff updating auto-generated files (pre-commit, bot...)
if any(file_path in diff_path for file_path in BOT_FILES_TO_SKIP):
return (
True,
f"SKIP: '{diff.change_type} {diff.b_path}' diff relates "
"to an auto-generated file, skip to avoid conflict",
)
# Do not accept diff on unported addons
if (
not misc.get_manifest_path(diff_path)
Expand Down
Loading