-
Notifications
You must be signed in to change notification settings - Fork 246
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
[draft] Mark all new commits as having no files on clean squash #2163
[draft] Mark all new commits as having no files on clean squash #2163
Conversation
A new Pull Request was created by @iarspider for branch preserve-signatures-on-squash. @iarspider, @cmsbuild, @aandvalenzuela, @smuzaffar can you please review it and eventually sign? Thanks. |
cms-bot internal usage |
@@ -1517,7 +1517,7 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F | |||
missing_commits = set( | |||
k for k in bot_cache["commits"] if not bot_cache["commits"][k].get("squashed", False) | |||
).difference(all_commit_shas) | |||
last_seen_commit_time = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove this?
process_pr.py
Outdated
@@ -1517,7 +1517,7 @@ def process_pr(repo_config, gh, repo, issue, dryRun, cmsbuild_user=None, force=F | |||
missing_commits = set( | |||
k for k in bot_cache["commits"] if not bot_cache["commits"][k].get("squashed", False) | |||
).difference(all_commit_shas) | |||
last_seen_commit_time = None | |||
new_commits = all_commit_shas.difference(k for k in bot_cache["commits"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not move it under the condition when there are no differences between last seen and new commits i.e under https://github.com/cms-sw/cms-bot/pull/2144/files#diff-f37d46a488510bd0b96fd201ff189f8a704b756502df6a1cd46b117986e608a4R1550 ?
process_pr.py
Outdated
last_seen_commit_time | ||
and commit.commit.committer.date.timestamp() > last_seen_commit_time | ||
): | ||
if last_seen_commit_time is not None and commit.sha in new_commits: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
once calculation of new_commits
is moved at the right place then no need to check for last_seen_commit_time is not None
(just commit.sha in new_commits
should be enough)
Pull request #2163 was updated. |
looks good |
* Detect commit squashing and preserve signatures * Remove wrapper function for getting reactions * Cleanup * Do not remove squashed commits, inject them after looping over existing commits * [WIP] Fix errors after rebasing * Fix logic * Restore pre-checks * Add detection of back-dated commits * Do not warn about back-dated commits in new PRs * Revert accidental change * Changes from review * Fix from review * Use different way of detecting back-dated commits * Use last-seen-commit sha * Changes from review * Let bot re-do code-checks and tests on clean squash * Do not overwrite signed_commit_sha * Changes from review * Fix for missing dictionary key * Move commits under dedicated key in bot_cache * Sign any commit * Fix logic for populating bot_cache * Fix collect_commit_cache * Change logic to detect squashes * Further simplify squash detection * Improve logic restricting the commit count limit; make all new commits contain no files if there was a clean squash * Only set last_seen_commit_time if the squash was clean * Improve limit-checking further * Move check for commit-limit message * Change timestamp of new commits to one of last commit seen if clean squash is detected * Remove unnecessary line * Changes from review * Change from review * [draft] Mark all new commits as having no files on clean squash (#2163) * [draft] Mark all new commits as having no files on clean squash * Changes from review * Fix injection of squashed commits * bug fixes; comment id string ; correct key for bot_cache * formatting * use signed event to trigger test * formatting * improve auto test start on sign * handle the case where a squashed commit is added back * reset squashed only for added back commits * save last seen sha in bot cache * use file checksum instead of patch for comparing --------- Co-authored-by: Malik Shahzad Muzaffar <shahzad.malik.muzaffar@cern.ch>
To be tested