Skip to content

CXX-3099 use for-each-ref for Git 2.43 compatibility #1384

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

Merged
merged 2 commits into from
Apr 17, 2025

Conversation

eramongodb
Copy link
Contributor

Addresses rhel76 task failure in proposed changes to #1381 due to the available git version (2.43.6) not supporting the --format flag used by calc_release_version.py.

This PR proposes changing the git command from git tag --list to git for-each-ref "refs/tags/*", as for-each-ref is supported by 2.43 and also supports the required --format flag.

Note

This PR also includes the same update to self-test scripts in #1379. Either PR may be merged first.

@eramongodb eramongodb requested a review from kevinAlbs April 17, 2025 18:51
@eramongodb eramongodb self-assigned this Apr 17, 2025
@eramongodb eramongodb requested a review from a team as a code owner April 17, 2025 18:51
@eramongodb eramongodb merged commit d896795 into mongodb:master Apr 17, 2025
15 of 17 checks passed
@eramongodb eramongodb deleted the cxx-3099 branch April 17, 2025 20:05
@eramongodb
Copy link
Contributor Author

Continuing to fail for GitHub PR patch builds, this time with the following error:

fatal: unknown refname: format strip=2
Traceback (most recent call last):
  File "etc/calc_release_version.py", line 372, in <module>
    RELEASE_VER = main()
                  ^^^^^^
  File "etc/calc_release_version.py", line 346, in main
    branch_tags = get_branch_tags(active_branch_name)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "etc/calc_release_version.py", line 236, in get_branch_tags
    tags_by_obj = get_object_tags()
                  ^^^^^^^^^^^^^^^^^
  File "etc/calc_release_version.py", line 269, in get_object_tags
    for obj, tagobj, tag in iter_tag_lines():
  File "etc/calc_release_version.py", line 253, in iter_tag_lines
    output = check_output(['git', 'for-each-ref', '--format=%(*objectname)|%(objectname)|%(refname:strip=2)', 'refs/tags/*'])
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "etc/calc_release_version.py", line 131, in check_output
    raise subprocess.CalledProcessError(ret, args[0])
subprocess.CalledProcessError: Command 'git' returned non-zero exit status 128.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants