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

ARROW-18068: [Dev][Archery][Crossbow] Comment bot only waits for task if link is not available #14429

Merged
merged 3 commits into from
Oct 17, 2022

Conversation

raulcd
Copy link
Member

@raulcd raulcd commented Oct 16, 2022

This has been tested on my own fork. Previous to the PR if the comment for the bot contained multiple tasks we were waiting multiple times, see log for the comment bot and the new log I added here https://github.com/raulcd/arrow/actions/runs/3260111092/jobs/5353427827#step:6:99 , output:

Waiting for task
Waiting for task
Waiting for task
Waiting for task

Comment triggered on this PR on my own fork:
raulcd#10

Once the fix is applied the same comment bot only waits once (the first one because the task url is not available) log here https://github.com/raulcd/arrow/actions/runs/3260112211/jobs/5353429747#step:6:99, output:

Waiting for task

Comment bot triggered on this PR on my own fork:
raulcd#12

@github-actions
Copy link

@raulcd
Copy link
Member Author

raulcd commented Oct 16, 2022

@kou the fix I initially proposed yesterday was good, I was just too sleepy and I had to test it. Let me know what you think. Thanks

@kou
Copy link
Member

kou commented Oct 17, 2022

Thanks!
But this may not work because Task.status() caches its TaskStatus(): https://github.com/apache/arrow/blob/master/dev/archery/archery/crossbow/core.py#L866-L871
We may need to call task.status(force_query=True) after time.sleep():

    def task_url(self, task):
        # Only wait if the link to the actual build is not present.
        if not task.status().build_links and self._wait_for_task:
            time.sleep(self._wait_for_task)
            task.status(force_query=True)

FYI: I tested #14412 by the followings:

$ cat /tmp/a.json
{
    "sender": {
	"login": "kou"
    },
    "action": "created",
    "repository": {
	"id": "apache/arrow"
    },
    "issue": {
	"number": 14409
    },
    "comment": {
	"id": 1278350487,
	"body": "@github-actions crossbow submit r-binary-packages",
	"author_association": "OWNER"
    }
}
$ ARROW_GITHUB_TOKEN='...' CROSSBOW_GITHUB_TOKEN='...' GITHUB_SERVER_URL=https://github.com GITHUB_REPOSITORY=apache/arrow GITHUB_RUN_ID=3246777470 archery trigger-bot --event-name issue_comment --event-payload /tmp/a.json

The result will be commented to #14409 .

@raulcd
Copy link
Member Author

raulcd commented Oct 17, 2022

Revision: a7a9c98

Submitted crossbow builds: ursacomputing/crossbow @ actions-42c1da27e0

Task Status
example-cpp-minimal-build-static Github Actions
example-cpp-minimal-build-static-system-dependency Github Actions
example-python-minimal-build-fedora-conda Github Actions
example-python-minimal-build-ubuntu-venv Github Actions

@raulcd
Copy link
Member Author

raulcd commented Oct 17, 2022

Thanks @kou the snippet to test was super useful I was testing adding a commit to my master branch fork:
raulcd@f670e11
that allows me to trigger archery using my branch PR code instead of master's code and then creating temporary PRs to my own fork to trigger and test but your approach is less convoluted.
I have tested and debugged locally and you are correct we had to refresh the task status. Thanks for that.
I've found a different issue though. If I trigger a group of tasks that contain a lot of them, the GitHub action triggers might take much longer. As an example these two tasks:
https://github.com/ursacomputing/crossbow/actions/runs/3263866752
and
https://github.com/ursacomputing/crossbow/actions/runs/3263950113
were triggered by the same comment with the tests group but as you can see their start time is 12 minutes apart. I think this is a different issue and we should improve it as a follow up.

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants