Skip to content
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

RFE: allow repoRequires to fetch from a different git repo #140

Open
jbastian opened this issue Aug 7, 2020 · 3 comments
Open

RFE: allow repoRequires to fetch from a different git repo #140

jbastian opened this issue Aug 7, 2020 · 3 comments

Comments

@jbastian
Copy link
Contributor

jbastian commented Aug 7, 2020

The repoRequires field in the metadata file allows a task to fetch other tasks as dependencies from the same git repo. Please extend this to allow fetching dependencies from other git repos. Some examples:

repoRequires=git://git.example.com/users/jbastian/kernel-include.git#include
repoRequires=https://github.com/jbastian/jbastian-test-include/archive/master.zip#include

The second example is a test case which can be used for this RFE. The main task and the include dependency:

https://github.com/jbastian/jbastian-test/blob/master/misc/external-include/metadata

https://github.com/jbastian/jbastian-test-include/blob/master/include/include.sh

restraint-0.2.3 reports this error in harness.log when trying to run the task:

** Installing dependencies
** ERROR: Nothing was extracted from archive

If using the first style git:// URL, the harness.log reports this error instead:

** Installing dependencies
** ERROR: archive_read_open failed: Error from remote service: fatal: Not a valid object name
@danrodrig danrodrig self-assigned this Aug 11, 2020
@danrodrig
Copy link
Contributor

danrodrig commented Nov 12, 2020

In case of implementing this, I would suggest to make the dependency task available in a way that avoids the need of absolute imports like this one,

. /mnt/tests/git.engineering.redhat.com/users/jbastian/kernel-include.git/include/include.sh

There was some work done do move task location away from /mnt/tests, and overall, we don't want tasks to relay on any specific location.

Either the task is placed in a way that can be imported through a relative import,

. ../include/include.sh

Or the task location is exposed through an environment variable,

. ${TASK_LOCATION}/git.engineering.redhat.com/users/jbastian/kernel-include.git/include/include.sh

@danrodrig danrodrig removed their assignment Nov 12, 2020
@tcler
Copy link

tcler commented Jul 13, 2023

We really need this feature, many of our user-space test cases dependent one or more kernel/Library/lib case.
If the original beaker-task rpm repo is disabled and Restraint->repoRequires does not support fetch test-case from different repos { these test cases will all run fail }

@tcler
Copy link

tcler commented Jul 24, 2023

Hello folks. JFYI: Just implemented this feature in the Restraint plugin, if there are formats like:
library(pkg/libname), test(/task/name), kernel-kernel-* or just /task/name after Makefile->RthsRequires:
or
/task/name after metadata->orepoRequires=
the plugin will get the url of these tasks and extract to /mnt/tests/ and will add symlink to current task's repo dir if they are in same repo.

source code of 27_task_require

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

No branches or pull requests

3 participants