Skip to content

Commit 630f97a

Browse files
committed
[RRU] Ignore commits that are in new base and previous rolling release
This program find the common matching base `RESF` kernel tag to do the comparison against. Sometimes commits like github actions might be made a part of the base release rockyX_y and are technically after the tag in the repo. Because of this they are not ignored in the process so any commit that exists in both the OLD rolling release and the new base we're branching off of should be ignored / dropped from the new rolling release as they're technically already present. Also cleaned up some of the printing and added a verbose git show flag so as to not blow out the output.
1 parent 0e47054 commit 630f97a

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

rolling-release-update.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,12 @@ def check_for_fips_protected_changes(repo, branch, common_tag):
8383
parser = argparse.ArgumentParser(description='Rolling release update')
8484
parser.add_argument('--repo', help='Repository path', required=True)
8585
parser.add_argument('--new-base-branch', help='Branch name', required=True)
86-
parser.add_argument('--old-rolling-branch', help='Branch name for old rolling release: ex: sig-cloud-8/4.18.0-553.33.1.el8_10', required=True)
86+
parser.add_argument('--old-rolling-branch',
87+
help='Branch name for old rolling release: ex: sig-cloud-8/4.18.0-553.33.1.el8_10',
88+
required=True)
8789
parser.add_argument('--fips-override', help='Override FIPS check abort', action='store_true')
90+
parser.add_argument('--verbose-git-show', help='When SHAs are detected for removal do the full git show <sha>',
91+
action='store_true')
8892
args = parser.parse_args()
8993

9094
repo = git.Repo(args.repo)
@@ -207,15 +211,20 @@ def check_for_fips_protected_changes(repo, branch, common_tag):
207211
commits_to_remove = {}
208212
for ciq_commit, upstream_commit in rolling_commit_map.items():
209213
if upstream_commit in new_base_commit_map_rev:
210-
print(f"Commit {ciq_commit} already present in new base branch")
211-
print(repo.git.show(ciq_commit))
214+
print(f"- Commit {ciq_commit} already present in new base branch: {repo.git.show('--pretty=oneline', '-s', ciq_commit)}")
215+
commits_to_remove[ciq_commit] = upstream_commit
216+
if ciq_commit in new_base_commit_map:
217+
print(f"- CIQ Commit {ciq_commit} already present in new base branch: {repo.git.show('--pretty=oneline', '-s', ciq_commit)}")
212218
commits_to_remove[ciq_commit] = upstream_commit
213219

220+
214221
print('[rolling release update] Removing commits from the new branch')
215222
for ciq_commit, upstream_commit in commits_to_remove.items():
216223
del rolling_commit_map[ciq_commit]
217-
print("Removing commit: ", ciq_commit)
218-
repo.git.show(ciq_commit)
224+
if args.verbose_git_show:
225+
print(repo.git.show(ciq_commit))
226+
else:
227+
print(repo.git.show('--pretty=oneline', '-s', ciq_commit))
219228

220229
print('[rolling release update] Applying the remaining commits to the new branch')
221230
for ciq_commit, upstream_commit in reversed(rolling_commit_map.items()):

0 commit comments

Comments
 (0)