From: Ross Burton <ross.bur...@arm.com>

Do another git-pull in the metrics repository before updating the
metrics, in case other metrics jobs running in parallel have updated the
repositories since they were cloned.  There will always be possibility
of racing metrics jobs, but this should reduce the chance of it
happening.

An alternative would be to commit and then rebase before pushing, but I
fear that a git-merge could produce invalid JSON and we'd have to
manually fix up the repository.  In my opinion, a wasted metrics run is
preferable to potentially corrupted repositories.

Signed-off-by: Ross Burton <ross.bur...@arm.com>
---
 scripts/run-cvecheck     | 6 ++++++
 scripts/run-patchmetrics | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/scripts/run-cvecheck b/scripts/run-cvecheck
index 711bec2..e0d52df 100755
--- a/scripts/run-cvecheck
+++ b/scripts/run-cvecheck
@@ -71,6 +71,12 @@ if [ ! -d $RESULTSDIR ]; then
     mkdir $RESULTSDIR
 fi
 
+# Do another pull to make sure we're as up to date as possible.  This is
+# preferable to committing and rebasing before pushing as it would be better to
+# waste some time repeating work than commit potentially corrupted files from a
+# git merge gone wrong.
+git -C $METRICSDIR pull
+
 cd ..
 set +u
 . oe-init-build-env build
diff --git a/scripts/run-patchmetrics b/scripts/run-patchmetrics
index a75cf52..a3f6d8f 100755
--- a/scripts/run-patchmetrics
+++ b/scripts/run-patchmetrics
@@ -87,6 +87,12 @@ if [ "$BRANCH" != "master" ]; then
     exit 0
 fi
 
+# Do another pull to make sure we're as up to date as possible.  This is
+# preferable to committing and rebasing before pushing as it would be better to
+# waste some time repeating work than commit potentially corrupted files from a
+# git merge gone wrong.
+git -C $METRICSDIR pull
+
 #
 # Patch Metrics
 #
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#61595): https://lists.yoctoproject.org/g/yocto/message/61595
Mute This Topic: https://lists.yoctoproject.org/mt/102362849/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: 
https://lists.yoctoproject.org/g/yocto/leave/6691583/21656/737036229/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to