-
Notifications
You must be signed in to change notification settings - Fork 63
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
Make coprdirs have their repo available in the buildroot #3369
base: main
Are you sure you want to change the base?
Conversation
This would bring security issue into the We need to solve the s.f.o integration first, somehow. |
Pull Request validationFailed🔴 Review - Missing review from a member (2 required) Success🟢 CI - All checks have passed |
ff65588
to
df12563
Compare
df12563
to
764cf2d
Compare
Alternatively, we could separate then through `event_info.user` which would produce CoprDir names like `foocopr:pr:jdoe-1`. This wouldn't separate the different packages but it would be good enough to fix the security issue. And it would produce shorter names than the project URL paths.
This is useful in general but especially for pull requests that build multiple packages which depend on each other (e.g. `python-copr` and `copr-cli`). Up until now, it had to be workarounded by building the dependency into the main copr repository.
764cf2d
to
a14af3f
Compare
Took me only half a year but updated, PTAL. |
# And this is the package that builds on top of it (e.g. copr-cli) | ||
rlRun "curl https://src.fedoraproject.org/rpms/hello/raw/rawhide/f/hello.spec > $tmp/hello-2.spec" | ||
rlRun "sed -i '1s/^/BuildRequires: hello >= 6:\n/' $tmp/hello-2.spec" | ||
rlRun "copr-cli build $PROJECT:custom:foo $tmp/hello-2.spec" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs update; you can use --after-build-id to order properly, and then we need to wait for the build result
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote this test a long time ago, so I don't remember my thought process. But there is no --nowait
for the first build, so the second one should be submitted only after the first one is finished. Using build batches should make no difference, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting is necessary IMVHO, otherwise we are not testing anything :-/
And then, batches allow you to wait for just one of them (because the second one doesn't start untill the first one is finished).
@@ -692,8 +694,7 @@ def validate(cls, copr, dirname): | |||
f"Please use directory format {copr.name}:custom:<SUFFIX_OF_CHOICE> " | |||
f"or {copr.name}:pr:<ID> (for automatically removed directories)" | |||
) | |||
|
|||
if not all(x.isalnum() for x in dirname.split(":")[1:]): | |||
if not all(x.isalnum() for x in re.split(r"[:-]+", dirname)[1:]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this deserves an in-line note :-) I'm not sure this is correct
We basically only want to allow one more :
-separated field, right? I'd wish we had a test-case for the validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then, I'm a bit scare of creating custom dirnames, because we don't have a method for deleting them.
Then, note #820 -> will that still work & remove PR dirs after certain period of time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I overall like where this PR goes, thank you for working on this!
This is useful in general but especially for pull requests that build multiple packages which depend on each other (e.g.
python-copr
andcopr-cli
). Up until now, it had to be workarounded by building the dependency into the main copr repository.