Commit Graph

12 Commits

Author SHA1 Message Date
Alexis Lothoré
800665612a oeqa/utils/gitarchive: fix tag pattern searching
Whenever we ask gitarchive to search for tags, we can provide it with a
pattern (containing glob patterns). However, when searching for example for
tags matching branch master-next, it can find more tags which does not
correspond exactly to branch master-next (e.g. abelloni/master-next tags
will match).

Prevent those additional tags from being fetched by gitarchive by using a
more specific pattern: prefix user-provided pattern with "refs/tags"

(From OE-Core rev: c24b7ea28021da48aa8f3498a9b899f595efde56)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-10-11 09:43:45 +01:00
Richard Purdie
fc5a15cc64 oeqa/utils/gitarchive: Handle broken commit counts in results repo
The test results repository contains tags like:

master/64501-g65c94ca3196e5ef3344a469fea8e30444f2e967a/0
master/1-g65c94ca3196e5ef3344a469fea8e30444f2e967a/3
master/1-g65c94ca3196e5ef3344a469fea8e30444f2e967a/2
master/1-g65c94ca3196e5ef3344a469fea8e30444f2e967a/1
master/1-g65c94ca3196e5ef3344a469fea8e30444f2e967a/0

where the commit count is correct in one case and not in the others. This causes
assertion errors in the current code.

Add in some code to work around these historical issues where the commit counts are low.

(From OE-Core rev: d51fc5c8c469730885af7bbde7122032de411d89)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-09-28 12:37:47 +01:00
Alexis Lothoré
359a105de6 oeqa/utils/gitarchive: replace warning with info when reading local tags
Whenever a script needs to list tags, if it falls back to the third method
(reading local tags only), it emits a warning. While this warning is useful
for future diagnostic if some tagging issues re-appear, it makes buildperf
autobuilds status as "Passed with warnings", which is not desirable

(From OE-Core rev: b2c1d8a83a3b2134a8f9a445cbf00103e63ed0b3)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-24 13:34:34 +01:00
Alexis Lothoré
db6ace80a0 oeqa/utils/gitarchive: fall back to local tags when listing existing tags
e9cff55e73 has switched tag listing from bare "git tag" to "git
ls-remote" to make sure not to miss remote tags which are not fetched
locally. This mechanism first checks for configured remote repository, next
for possibly passed url, and then fails if none worked.

However there are still cases where no remote repository is
configured and no url is provided (for instance: buildperf tests use an
empty git directory to store tests). Fix those cases by putting back the
old behavior (local tags check) as last resort, with at least a warning for
future diagnostics if we still encounter tagging issues

Fixes: e9cff55e73 ("oeqa/utils/gitarchive: fix tag computation when creating archive")
(From OE-Core rev: 34e1f845687d2f7169f5d6c1bb54e1a7ab5412c4)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-23 22:33:39 +01:00
Alexis Lothoré
3c1ee6d8b0 oeqa/utils/gitarchive: allow to pass a logger to get_tags
Propagate a "log" parameter to get_tags in order to know what method is
used to retrieve existing tags

(From OE-Core rev: f8212eda45444dfb330e4d930eeceefde936adeb)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-23 22:33:39 +01:00
Alexis Lothoré
e9cff55e73 oeqa/utils/gitarchive: fix tag computation when creating archive
Sporadic errors have been observed in autobuilder when trying to store new
tests results:

error: failed to push some refs to 'push.yoctoproject.org:yocto-testresults'
hint: Updates were rejected because the tag already exists in the remote.

The new tag name is generated by gitarchive based on known tags from the
repository (learnt with git tag). In autobuilder case, this repository is a
shallow clone, so git tag only returns most recent tags, which mean we
could miss some older tags which exist in remote but not locally. In this
case, gitarchive will likely create a tag which already exists in remote,
and so will fail to push

Fix this tag duplication by using git ls-remote to learn about existing
tags instead of git tag. To do so, create a helper ("get_tags") which
manages both nominal case (target directory is a git repository with a
proper remote) and fallback case (target directory is not from a clone, no
remote has been configured)

Fixes [YOCTO #15140]

(From OE-Core rev: 9cbbe9689866158825a7ae774b7965b41ff5c461)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-21 11:34:12 +01:00
Richard Purdie
f9dff104bd Revert "oeqa/utils/gitarchive: fix tag computation when creating archive"
This reverts commit 5a0a7da85a3acfd4a20a07478eabefdab60f313a.

This caused failres on the build performance tests on the autobuilder.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-16 07:56:15 +01:00
Alexis Lothoré
788f6a0e16 oeqa/utils/gitarchive: fix tag computation when creating archive
Sporadic errors have been observed in autobuilder when trying to store new
tests results:

error: failed to push some refs to 'push.yoctoproject.org:yocto-testresults'
hint: Updates were rejected because the tag already exists in the remote.

The new tag name is generated by gitarchive based on known tags from the
repository (learnt with git tag). In autobuilder case, this repository is a
shallow clone, so git tag only returns most recent tags, which mean we
could miss some older tags which exist in remote but not locally. In this
case, gitarchive will likely create a tag which already exists in remote,
and so will fail to push

Fix this tag duplication by using git ls-remote to learn about existing
tags instead of git tag. Two places which wrongly read only local tags has
been identified in gitarchive:  expand_tag_strings and get_test_runs

Fixes [YOCTO #15140]

(From OE-Core rev: 5a0a7da85a3acfd4a20a07478eabefdab60f313a)

Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-08-15 08:15:25 +01:00
Richard Purdie
ffae400179 meta/lib+scripts: Convert to SPDX license headers
This adds SPDX license headers in place of the wide assortment of things
currently in our script headers. We default to GPL-2.0-only except for the
oeqa code where it was clearly submitted and marked as MIT on the most part
or some scripts which had the "or later" GPL versioning.

The patch also drops other obsolete bits of file headers where they were
encoountered such as editor modelines, obsolete maintainer information or
the phrase "All rights reserved" which is now obsolete and not required in
copyright headers (in this case its actually confusing for licensing as all
rights were not reserved).

More work is needed for OE-Core but this takes care of the bulk of the scripts
and meta/lib directories.

The top level LICENSE files are tweaked to match the new structure and the
SPDX naming.

(From OE-Core rev: f8c9c511b5f1b7dbd45b77f345cb6c048ae6763e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-05-09 16:31:55 +01:00
Richard Purdie
9fdd172fb0 oeqa/utils/gitarchive: Handle case where parent is only on origin
The parent code currently assumed that any parent branch is locally
checked out which may not be the case.

Use the local branch by default but fall back to the origin. This
also means removing the later saftey check as the branch may not exist
locally.

This fixes the autobuilder resulttool test pushing code.

(From OE-Core rev: 0ee636bc89d93282cb3d3cd747b3dd046f6e5a9c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-25 09:28:28 +00:00
Richard Purdie
95bd530b77 oe-build-perf-report/gitarchive: Move common useful functions to library
These functions can be reused by the resulttool code so move to the common
function library for this purpose.

(From OE-Core rev: c66f848938c04e133259c5b6903dc592866ab385)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-21 12:34:00 +00:00
Richard Purdie
18880a9f1c scripts/oe-git-archive: Separate out functionality to library function
This turns the core of the script into a library function. Ultimately this
will let us call that code with custom 'keywords' rather than relying
on the data parsed from bitbake metadata which can't be used when archiving
historical results.

(From OE-Core rev: 4820ca2b0850e29b04a4fd5659a6e9837d6714d0)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-02-18 10:33:13 +00:00