@ayufan As far as I know, this will require refactoring the job header, the job details block, and the job status list into Vue components, as they all display ci status information that needs updating.
We will probably need to refactor the build log somewhat as well, since the class that manages updating and rendering the log (Build) is contains logic for polling and refreshing the page when the status changes, which realtime components will depend on or need to replicate.
In my personal experience, https://gitlab.com/gitlab-org/gitlab-ce/issues/31701 seems to be a higher priority, and easier. Can we tackle that in 9.3 instead? Unless we can do both, along with cross-project pipelines? Or if we want to continue on with job details page for other momentum reasons.
As per today's CI meeting I believe @zj will work on the backend of this issue. In order for either parts to be blocked, can we start working on a API schema?
@filipa Looking at the page we'll need the following info to be updated with the Etag mechanism:
Current jobs status
retry_path
job_details
duration (only if finished)
finished_at
runner_id
pipeline_jobs or related builds
We have a BuildEntity already to provide some details:
id
name
build_path
retry_path
play_path
playable
created_at
updated_at
detailed_status
The same structure as all other statusses
So missing would be the
runner_id
finished_at (null if no datetime in the db yet)
finished_at - started_at == duration
related builds
In pseudo JSON my proposal, also the TLDR:
{"id":1,"name":"rspec","runner_id":1,"build_path":"/path/to/build/3","retry_path":"/path/to/build/3/retry","play_path":"path/to/build/3/play","playable":true"created_at":20170508// or whatever the type is"updated_at":29123281391283,"finished_at":324892340234,"duration":12312312// in seconds, let me know if this is not what you need"detailed_status":{// usual types for statusses},"related_jobs":[{// hashes of jobs/builds}]}
@filipa I wonder why the frontend needs all the paths all the time, it seems like a simple string concat each time and can be easily be feature spec'ed against? This increases both the response times and the payload size. Good example for is you asking for the issue path? Thats just /namespace/project/issues/new
I think we should provide all data in the API response. If we have half in haml and half in vue it won't be real-time and it will much harder to maintain the state across haml and vue.
I know it can mean a lot more work for both sides but I think this is worth it.
We currently have some open bugs for this view. If we could make it all in vue we could guarantee a better code.
@zj Frontend should not mess around with the paths:
Some of them are not relative to the window.location object
It can mean some security issues
~~All paths are provided from the backend~~~
FE does not have access to the namespace or the project, meaning we would have to query the url which would only work for instances deployed exactly like gitlab.com
@filipa It is better to keep it in the payload if we really need it. I just wonder if this information is maybe already there (like there is no cancel_path = cannot cancel).
@grzesiek@filipa I seriously think we are going about this the wrong way, and I wonder why we can't have multiple Etag requests. 1 for related jobs, and one for the current job.
Also, all static stuff needs to be passed in the HAML. Its a waste and really shitty to pass it in the BuildEntity. Now it makes our code less modular as in all honesty I now have to dig where we're using this entity and where I need to set which flags or not. The passing of data which is not directly related to the current job should be avoided IMO.
Today I wasted about a day to come up with an elegant solution which would make the entities as useable as they are in the public facing API. The BuildEntity is quite the mess already and we're not using the Serializers design pattern/structure that long.
Also, all static stuff needs to be passed in the HAML. Its a waste and really shitty to pass it in the BuildEntity. Now it makes our code less modular as in all honesty I now have to dig where we're using this entity and where I need to set which flags or not. The passing of data which is not directly related to the current job should be avoided IMO.
I disagree. HAML should be dropped in favor of using everything with API. Having to maintain two sources of truth makes it harder to maintain it later.
Today I wasted about a day to come up with an elegant solution which would make the entities as useable as they are in the public facing API. The BuildEntity is quite the mess already and we're not using the Serializers design pattern/structure that long.
Is there a reason why we try to put "everything" in BuildEntity?
Trace request that in the future should be replaced with streaming of raw text and client side rendering (so we are not touching it now),
Data for the sidebar: Stages and jobs for the specific stage.
The first request is covered by BuildEntity with small addition. Since BuildEntity is used in other requests we should have BuildEntityDetails that would expose detailed information used for that view.
The second is not touched at all.
The third request should be added or re-used. We need to render part of pipeline data, similar to what we do with Pipeline Graph. I would try to return only relevant data, not all data.
@zj We should have separate MR for each part of the backend story. I would start with having just job details first and merge that to master before @filipa's work.