oeqa/gitarchive: Push tag before copying log files
cover oeqa/gitarchive: Push tag before copying log files
---
Mathieu Dubois-Briand (2):
oeqa/gitarchive: Fix git push URL parameter oeqa/gitarchive: Push tag before copying log files
meta/lib/oeqa/utils/gitarchive.py | 6 +++++- scripts/lib/resulttool/store.py | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-)
---
base-commit: 2e4c9b8dee3b1d545aee354ac1f8c6a5c0bad433
change-id: 20251230-mathieu-fix-15696-32be41851aca
Best regards,
Signature · 1 line
Mathieu Dubois-Briand <[email protected]>
PATCH 1/2 oeqa/gitarchive: Fix git push URL parameter
The gitarchive() function takes a push parameter than can be either a boolean or a string. But this parameter is then passed to expand_tag_strings(), which clearly expect it to be a string if it is
defined: make sure to pass either a string or None.
--- meta/lib/oeqa/utils/gitarchive.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
meta/lib/oeqa/utils/gitarchive.py +5 -1
@@ -175,11 +175,15 @@ def gitarchive(data_dir, git_dir, no_create, bare, commit_msg_subject, commit_ms commit_msg += '\n\n' + format_str(commit_msg_body, keywords) branch_name = format_str(branch_name, keywords) tag_name = None + + # push is either a boolean or a git remote URL string + push_url = push if isinstance(push, str) else None + if not no_tag and tagname: tag_name, tag_msg = expand_tag_strings(data_repo, tagname, tag_msg_subject, tag_msg_body, - push, log, keywords) + push_url, log, keywords) # Commit data commit = git_commit_data(data_repo, data_dir, branch_name,
Signature · 1 line
2.47.3
PATCH 2/2 oeqa/gitarchive: Push tag before copying log files
In reply to Mathieu Dubois-BriandResulttool creates a git tag in the yocto-testresults git and then copies log files to a newly created folder on the NFS share, whose name is controlled by the name of this git tag. As tags are unique, the folder name is also unique, preventing any clash between different builds.
Today, the tag is pushed after the folder is copied, which can lead to some issues if for any reason the tag is not pushed. This might also lead to some race condition. Push the tag before coying data, in order to prevent these issues.
Fixes [YOCTO #15696]
--- scripts/lib/resulttool/store.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/lib/resulttool/store.py +2 -1
@@ -78,11 +78,12 @@ def store(args, logger): if args.logfile_archive: excludes = ['*.log', "*.log.zst"] + push_tag = args.logfile_archive tagname = gitarchive.gitarchive(tempdir, args.git_dir, False, False, "Results of {branch}:{commit}", "branch: {branch}\ncommit: {commit}", "{branch}", False, "{branch}/{commit_count}-g{commit}/{tag_number}", 'Test run #{tag_number} of {branch}:{commit}', '', - excludes, [], False, keywords, logger) + excludes, [], push_tag, keywords, logger) if args.logfile_archive: logdir = args.logfile_archive + "/" + tagname
Signature · 1 line
2.47.3