Open Bug 1367153 Opened 8 years ago Updated 2 years ago

[graphql] Ensure schema can return the data that the Job Details panel needs to make

Categories

(Tree Management :: Treeherder: API, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: camd, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug, Whiteboard: [lang=py])

This is for the server-side python code to extend the GraphQL schema. The UI currently makes these XHR requests on clicking a job: Step 1 ------ * https://treeherder.mozilla.org/api/project/mozilla-inbound/jobs/101259822/ * https://treeherder.mozilla.org/api/project/mozilla-inbound/jobs/101259822/text_log_errors/ * https://treeherder.mozilla.org/api/jobdetail/ Step 2 ------ * https://treeherder.mozilla.org/api/project/mozilla-inbound/job-log-url/ * https://treeherder.mozilla.org/api/project/mozilla-inbound/bug-job-map/ * https://treeherder.mozilla.org/api/project/mozilla-inbound/note/ Step 3 ------ * https://treeherder.mozilla.org/api/project/mozilla-inbound/performance/data/ * https://treeherder.mozilla.org/api/project/mozilla-inbound/performance/data/ We should be able to reduce this to one or perhaps two calls with GraphQL. Possibly the performance/data calls would be separate, but investigation will tell. Start with step 1, and expand to the other steps. NOTE: You'll need to inspect the UI to get the query string params that may be part of these calls.
Mentor: cdawson
Keywords: good-first-bug
Whiteboard: [lang=py]
Blocks: 1345914
Hi! I'm a new contributor, can I work on this bug?
Assignee: nobody → sebastinssanty
Hi Richard-- Thanks for your interest! Though Sebastin has already been working on this bug, we just forgot to have him set the "Assignee" field. Sorry to have lead you to a dead-end here. As I understand Sebastin already has a PR that's getting close to being ready for this. I encourage you to keep your eyes open for other bugs to work on, though! Your contributions will be greatly appreciated! If I have anything else GraphQL related, I'll ping you, ok?
Hi . If this bug not yet resolved then i would like to work on this.
Hey, I understand that there are some problems with select_related() and prefetch_related(). And from https://github.com/graphql-python/graphene-django/issues/197 I understand that we need to use DataLoader. I see that Seban has already made the basic configurations for integration of graphql and added some of the queries in the GraphQL schema. I have been able to test the schema using grphiql. I am comfortable with Django and in developing a schema of graphql. Can I work on this?
Flags: needinfo?(cdawson)
Sharan-- Absolutely! The select_related issue should be remedied now with regards to GraphQL. Though it may need tweaking as we implement more uses for it. Please let me know if you need any more guidance on this. Otherwise, go right ahead and start working! :)
Flags: needinfo?(cdawson)
Component: Treeherder → Treeherder: API
Assignee: sebastinssanty → nobody
Priority: -- → P3
Hi, can I be able to work on this bug?
Hi Cameron! Has this bug been assigned to someone or is it still open? Please let me know. Thanks.
Hi Cameron! Can I work on this?
Thanks for the n-i Wes. :) fqibymeksm: Yes, please go ahead and work on this. It may take some investigating to see which fields the details panel requires. So your first step, after getting your development environment setup, would be to load Treeherder and click a job to see what data is fetched. Then see if you'd be able to write a GraphQL query to fetch the same data. It doesn't have to come down in exactly the same form, of course. Just a form that could be examined to get the data that's needed. https://treeherder.readthedocs.io/installation.html#ui-development
Flags: needinfo?(cdawson)
Hi i wanted to work on this bug if no one has been assigned to it.
(In reply to Cameron Dawson [:camd] from comment #9) > Thanks for the n-i Wes. :) > > fqibymeksm: Yes, please go ahead and work on this. It may take some > investigating to see which fields the details panel requires. So your first > step, after getting your development environment setup, would be to load > Treeherder and click a job to see what data is fetched. Then see if you'd > be able to write a GraphQL query to fetch the same data. It doesn't have to > come down in exactly the same form, of course. Just a form that could be > examined to get the data that's needed. > > https://treeherder.readthedocs.io/installation.html#ui-development Hi I wanted to work on this bug if its still open.
Hi Pavan Hegde. I still work on this.

I would love to take this up if this is still open.

Flags: needinfo?(cdawson)

Shubhank-- We are actually going to move away from GraphQL, I believe. But I wonder if we could refactor our REST APIs to make them a little more streamlined for getting this data. We could even create a specialized API in /jobdetails/ that gets us everything we want all at one time without having to make all these calls.

I think I'd rather take that approach. We could either create a new @action(detail=True) endpoint here: https://github.com/mozilla/treeherder/blob/aff331f3d31f8117284f117fe80ab70f85978f77/treeherder/webapp/api/jobs.py#L480
Or we could create a new class in the /api/ folder called SelectedJob and have a ViewSet in there. Why don't you add it to the JobDetailViewSet initially, and if we want to move it to a new file later, we can.

The /ui/ portion of this work to use the new API is here:
https://github.com/mozilla/treeherder/blob/e3e65b83a2c6a03bc2e661742979d3421713acc1/ui/job-view/details/DetailsPanel.jsx#L162

Looking at this, it is not really a "good first bug" per se. This will be pretty involved. But you have fixed many bugs for us already, so it may still feel like something you'd like to tackle.

Please let me know if this looks a little too big at this time and I will un-assign you. :)

Assignee: nobody → saxena.shubhank.19
Flags: needinfo?(cdawson)
Assignee: saxena.shubhank.19 → nobody
Mentor: cameron

Hi, Can I be able to work on this bug? I am a new contributor and excited to work my first contribution

You need to log in before you can comment on or make changes to this bug.