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

DAOS-16678 ci: fetch in gen_commit_pragmas.py #15493

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
15 changes: 15 additions & 0 deletions ci/gen_commit_pragmas.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,18 @@ def git_files_changed(target):
return [os.path.join(git_root, path) for path in result.stdout.decode().split('\n') if path]


def git_fetch():
"""Run git fetch.

Returns:
str: the fetch result
"""
result = subprocess.run(
['git', 'fetch'],
stdout=subprocess.PIPE, check=True, cwd=PARENT_DIR)
return result.stdout.decode().rstrip('\n')


def git_merge_base(*commits):
"""Run git merge-base.

Expand Down Expand Up @@ -104,6 +116,9 @@ def main():
help="git target to as reference diff")
args = parser.parse_args()

# Fetch latest repo
git_fetch()

commit_pragmas = gen_commit_pragmas(git_merge_base('HEAD', args.target))
for pragma, value in commit_pragmas.items():
print(f'{pragma}: {value}')
Expand Down
Loading