-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
bots: Distinguish context only when repo is different to PR target #12371
Conversation
This looks fine. It's another nice and required step towards making bots/ independent, and gets rid of more special cases. I just wonder why this is no-test but has all the cockpit tests, which apparently did not get run? How did you trigger these? I'll re-trigger one manually. |
Because I opened it and forgot to add [no-test] label. I've noticed it immediately hoping that I can make it before it is processed (now thinking that we are sending these data in json and it does not read it from github so there was no chance at all) |
Actually no: It immediately crashes:
You should be able to reproduce this locally, and then make it deal with this situation. |
This happens for this PR because tests-scan runs from master, while tests-invoke runs from this branch. |
Yeah, that make sense. Should I really check if it is set? Normally this won't happen |
@marusak: Alternatively, land the tests-scan change first in a separate PR. |
Blocked on #12380 |
Landed the other one, please rebase. |
545f45d
to
8dde5fe
Compare
Rebased |
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.
Thanks. This is now purely clean-up, and should not block anything any more, right?
Triggering one test, to make sure this works now. |
Indeed. |
Hold on -- it now appends @cockpit-project/cockpit to the test. We shouldn't do this if the project is equal to the PR target. |
It is due to #12380. Either that needs to pass this variable only when project is not equal to PR target and this PR is then obsoleted or this PR needs to do this check. (I am in favor of the second one) |
Yes, let's do that one. Always passing $TEST_PROJECT sounds cleaner IMHO. |
8dde5fe
to
567fbc8
Compare
I've triggered |
bots/tests-invoke
Outdated
@@ -114,7 +114,7 @@ class PullTask(object): | |||
|
|||
# build a unique file name for this test run | |||
id_context = self.context | |||
if self.test_project: # disambiguate when running several external projects | |||
if self.test_project != api.repo : # disambiguate when running several external projects |
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 is just for the log name, right? I think this special case could go, it doesn't matter if the log name contains the cockpit project.
bots/tests-invoke
Outdated
@@ -126,7 +126,7 @@ class PullTask(object): | |||
|
|||
# build a globally unique test context for GitHub statuses | |||
github_context = self.context | |||
if self.test_project: # disambiguate tests for external projects | |||
if self.test_project != api.repo : # disambiguate tests for external projects |
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.
The code change is right, but the comment is now misleading. How about "disambiguate test name for foreign project tests"?
567fbc8
to
63c36dd
Compare
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.
Thanks!
I am just waiting if |
I have question about this and I am opening this PR to discuss it.
The test project (for now) in the tests-invoke is used just for building up name for publishing. I am not sure what this all affects, I've changed it in this PR to always use project name. If this has unwanted effect then I am ready to change it to
if self.test_project != "cockpit-project/cockpit
.@Gundersanne @martinpitt