GSoC Week 8 : Debug, Code, Debug
With the new events coming up good, it was time to see how the two parts work together. Since I did not write any code in the 1st week of July, this week was more about getting things done quickly.
The new Listeners Component
My PR was finally merged after a few minor changes. Now the events server sends the entire message to the client instead of only message.payload
. This gives them additional information to work with like the exchange
and routes
of the message. I also opened another PR for slight changes while I worked on tc-tools
Getting the client ready
This involved making quite a few decisions, so I was quite active and talking to the guys on IRC. Conventionally, pulse-inspector
used tc-client-web
which exposed a WebListener
which in turn connected to events.taskcluster.net
.
Since the client was simple to do, we decided its best to put tc-tools
in direct contact with tc-events
.
Trouble with headers
The EventSource
in tc-tools
was setting the header Cache-Control
on its own while Access-Control-Allow-Headers
in the response did not include Cache-Control
. This led to an error Request header field Cache-Control is not allowed by Access-Control-Allow-Headers in preflight response
.
A preflight request is one made by browsers to make sure CORS protocol is respected. In other words it is asking the server if it allows certain operations to be performed. In my case the server did not allow Cache-Control
to be set by the origin.
After some discussion, hassan made changes to tc-lib-api
(v12.3) to add Cache-Contol
in ACAH in the preflight response. Everything was working fine..
All hell breaks loose
..until the listener.resume
call started giving timeout randomly. I spent a considerable part of my time figuring this out, finally today I figured out it was my institute network causing the problem. It used to work fine at most times except a few hours each day when I would use it. This was after I added debug
statements in node_modules
to see what was going on.
Meanwhile, tc-lib-api
v12.3 introduced a minor bug, which was later fixed.
Coming up
My PR will most probably be merged next week. Then the final part of the project would be to get these things running in production. On the sides I also started with taskcluster-cli
. It is written in go
and I am hoping to learn more about in the next week.