Closed
Bug 1129574
Opened 11 years ago
Closed 10 years ago
Project endpoint should be merged with repository
Categories
(Tree Management :: Treeherder: API, defect, P4)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: wlach, Assigned: goma, Mentored)
References
Details
(Whiteboard: [good next bug][lang=python])
User Story
Thank you for helping out with Treeherder! You can find us on IRC at irc://irc.mozilla.org/treeherder Here's some links to help get you started. Project page: https://wiki.mozilla.org/Auto-tools/Projects/Treeherder Interacting with us, repo locations and links to set up a development version of the software: https://wiki.mozilla.org/Auto-tools/Projects/Treeherder#Contributing https://wiki.mozilla.org/Auto-tools/Projects/Treeherder#Source_and_Docs A-Team general reference, coding style guides: http://ateam-bootcamp.readthedocs.org
Attachments
(1 file)
A few months ago I implemented a project endpoint which lets you get certain metadata about a project. For example:
https://treeherder.mozilla.org/api/project/mozilla-central/
This pretty much overlaps the repository API (project is just another name for repository):
https://treeherder.mozilla.org/api/repository/1
We should probably just merge these two together. Steps to solving this bug:
1. Remove the project urls from the api: https://github.com/mozilla/treeherder-service/blob/master/treeherder/webapp/api/urls.py#L111
2. Modify the RepositoryViewSet class (https://github.com/mozilla/treeherder-service/blob/master/treeherder/webapp/api/refdata.py#L42) with a custom get function to get the extra information from the jobs model (currently in https://github.com/mozilla/treeherder-service/blob/master/treeherder/webapp/api/projects.py). We'll restrict this to "GET" (retrieve in rest_framework parlance) as looking up this information for each project seperately every time the repository endpoint is called might get excessive. You'll probably want to call the default function to get the basic dictionary, then insert the extra information inside it. See http://www.django-rest-framework.org/api-guide/viewsets/ for information on overriding methods in viewsets.
Updated•10 years ago
|
Priority: -- → P4
Updated•10 years ago
|
User Story: (updated)
Updated•10 years ago
|
Whiteboard: [good next bug] → [good next bug][lang=python]
Updated•10 years ago
|
User Story: (updated)
Assignee | ||
Comment 1•10 years ago
|
||
I'd like to work on this bug. :)
Reporter | ||
Comment 2•10 years ago
|
||
(In reply to Gabriel Machado [:goma] from comment #1)
> I'd like to work on this bug. :)
It's yours! :)
Assignee: nobody → gbrmachado
Assignee | ||
Comment 3•10 years ago
|
||
Attachment #8656747 -
Flags: review?(wlachance)
Reporter | ||
Comment 4•10 years ago
|
||
Comment on attachment 8656747 [details] [review]
Link to Github Pull Request
Sorry for the delay on reviewing this. I *think* the idea is right, but the implementation needs some changes.
Attachment #8656747 -
Flags: review?(wlachance) → review-
Assignee | ||
Updated•10 years ago
|
Attachment #8656747 -
Flags: review- → review?(wlachance)
Comment 5•10 years ago
|
||
Commits pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/de90b45827ff2c5d4662757422e18ff385fa718e
Bug 1129574 - Project endpoint should be merged with repository
https://github.com/mozilla/treeherder/commit/0b39058267c18aacc11b7a818fb9f82f719db8f5
Merge pull request #938 from gbrmachado/Bug-1129574
Bug 1129574 - Project endpoint should be merged with repository
Reporter | ||
Comment 6•10 years ago
|
||
Comment on attachment 8656747 [details] [review]
Link to Github Pull Request
Thanks :goma, this looks great now!
Attachment #8656747 -
Flags: review?(wlachance) → review+
Reporter | ||
Updated•10 years ago
|
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Comment 7•10 years ago
|
||
Are we sure this isn't being used?
Could you check the logs to see?
If it is, we'll need to either identify and notify the users before we push to prod, or else increment the version of the API and EOL that way.
Flags: needinfo?(wlachance)
Reporter | ||
Comment 8•10 years ago
|
||
(In reply to Ed Morley [:emorley] from comment #7)
> Are we sure this isn't being used?
> Could you check the logs to see?
> If it is, we'll need to either identify and notify the users before we push
> to prod, or else increment the version of the API and EOL that way.
I'm 99% sure that this isn't used. I added this for :ekyle way back in the fall when he was trying to create an external alerts service using perfherder, but I don't think even he even used it.
My interpretation of new relic is that there are only a few instances of this endpoint being called, probably when we were testing this or other things:
https://rpm.newrelic.com/accounts/677903/applications/4180461/transactions?tw%5Bend%5D=1442335996&tw%5Bstart%5D=1441731196#id=5b225765625472616e73616374696f6e2f46756e6374696f6e2f747265656865726465722e7765626170702e6170692e70726f6a656374733a70726f6a6563745f696e666f222c22225d
Flags: needinfo?(wlachance)
You need to log in
before you can comment on or make changes to this bug.
Description
•