check the commit is remotely available#696
Merged
Conversation
ydirson
requested changes
Apr 24, 2025
Contributor
ydirson
left a comment
There was a problem hiding this comment.
-
this is only when not pushing a temporary commit, where we assumed it was already pushed; this might be worth to explain in the commit message
-
there is a "remotly" typo in the commit message (and PR)
-
the random
-tlpzsuffix is puzzling :)
scripts/koji/koji_build.py
Outdated
Comment on lines
+39
to
+40
| def check_commit_is_available(hash): | ||
| subprocess.check_output(['git', 'branch', '-r', '--contains', hash]) |
Contributor
There was a problem hiding this comment.
- I read "is_available" as "commit is locally present", but the commit messages adds "remote" (better function naming, and docstring, would help)
- the command used would in fact only fail if the commit is not locally present:
user@work-vates:xcp (master =)$ git branch -r --contains f7f53d8163b820d4f133840b93c149ac43a3206c user@work-vates:xcp (master =)$ echo $? 0 user@work-vates:xcp (master =)$ git branch -r --contains deccfa331b78491d565f6daf1a1cc89f9b76984d error: no such commit deccfa331b78491d565f6daf1a1cc89f9b76984d user@work-vates:xcp (master =)$
384cd2b to
4e45ef2
Compare
Member
Author
maybe it's not random ;-) |
4e45ef2 to
2674d97
Compare
ydirson
requested changes
Apr 25, 2025
Comment on lines
+39
to
+43
| def check_commit_is_available_remotely(dirpath, hash): | ||
| with cd(dirpath): | ||
| subprocess.check_output(['git', 'branch', '-r', '--contains', hash]) | ||
|
|
Contributor
There was a problem hiding this comment.
The function still does not work as advertised for the reason exposed in my second bullet point:
[builder@81dcb03d8599 samba]$ /data/src/xcpng/xcp/scripts/koji/koji_build.py --scratch v8.3-u-ydi1 .
koji build --scratch v8.3-u-ydi1 git+https://github.com/xcp-ng-rpms/samba?#ab8f57a8b8bf52a5b90b82f6383042cad59c2da4
Created task: 82908
Task info: http://koji.xcp-ng.org/taskinfo?taskID=82908
...
82908 build (v8.3-u-ydi1, /xcp-ng-rpms/samba:ab8f57a8b8bf52a5b90b82f6383042cad59c2da4): open (koji.xcp-ng.org) -> FAILED: BuildError: Error running GIT command "git reset --hard ab8f57a8b8bf52a5b90b82f6383042cad59c2da4", see checkout.log for details
checkout.log:
$ git reset --hard ab8f57a8b8bf52a5b90b82f6383042cad59c2da4
fatal: Could not parse object 'ab8f57a8b8bf52a5b90b82f6383042cad59c2da4'.
before asking koji to pull a commit it may not be able to retrieve. The check is only done when not using a pre/test build commit. In that case we are already assured that the commit is on the remote repository. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
2674d97 to
a24751c
Compare
ydirson
approved these changes
Apr 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
before asking koji to pull a commit it may not be able to retrieve