Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Question: Latest Nightly Appbuildid? Hitting 504 gateway timeouts #431

Open
Osmose opened this issue Apr 26, 2018 · 7 comments
Open

Question: Latest Nightly Appbuildid? Hitting 504 gateway timeouts #431

Osmose opened this issue Apr 26, 2018 · 7 comments
Assignees

Comments

@Osmose
Copy link

Osmose commented Apr 26, 2018

I'm trying to use BuildHub to get the appBuildId of the latest Nightly build. I came up with this query:

https://buildhub.prod.mozaws.net/v1/buckets/build-hub/collections/releases/records?_limit=5&source.product=firefox&target.locale=en-US&target.channel=nightly

But whenever I try to hit it I get a 504 gateway timeout error. If I remove the &target.channel=nightly bit it returns in a few seconds with results from Beta. I also haven't figured out how to order the results to ensure I'm getting the latest appBuildId.

Any help is appreciated!

@leplatrem
Copy link
Collaborator

leplatrem commented Apr 26, 2018

The query looks correct though...

You can try with ElasticSearch, it's a lot faster. It would be something like that I guess:

echo '{
  "aggs": {
    "build_ids": {
      "terms": {
        "field": "build.id",
        "size": 5,
        "order": {
          "_term": "desc"
        }
      }
    }
  },
  "query": {
    "bool": {
      "filter": [{
        "term": {
          "target.channel": "nightly"
        }
      }, {
        "term": {
          "source.product": "firefox"
        }
      }, {
        "term": {
          "target.locale": "en-US"
        }
      }]
    }
  },
  "size": 0
}' | http POST https://buildhub.prod.mozaws.net/v1/buckets/build-hub/collections/releases/search | \
jq -r '.aggregations.build_ids.buckets[] | .key'

20180426100055
20180425220031
20180425100122
20180424220100
20180424100107

@peterbe
Copy link
Contributor

peterbe commented Apr 27, 2018

@leplatrem Yet another fancy ES trick we should add to the non-existent Cookbook :)

@leplatrem
Copy link
Collaborator

I don't entirely agree with non-existent :) http://buildhub.readthedocs.io/en/latest/api.html#example-queries

@peterbe
Copy link
Contributor

peterbe commented Apr 27, 2018

🤯 <-- mind blown

@peterbe
Copy link
Contributor

peterbe commented Apr 30, 2018

The 504 Gateway Timeouts are probably due to Kinto/kinto#1507 which gives me heart to really work on that PR.

@Osmose Are you "satisfied" with that fancy ES query to get the information you needed?

I don't think we should close this issue until we've confirmed that that ES query is awesome and it goes into the documentation for the next time a question like this comes up.

@Osmose
Copy link
Author

Osmose commented Apr 30, 2018

@Osmose Are you "satisfied" with that fancy ES query to get the information you needed?

It looks like it is; I was planning to close this after I had actually implemented it in my project. I'll let ya'll know soon, thank you!

@peterbe peterbe self-assigned this May 1, 2018
@Osmose
Copy link
Author

Osmose commented May 1, 2018

Got this implemented, can confirm it works as expected. Thanks again!

(I'll leave this open for peterbe's aforementioned doc changes)

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

No branches or pull requests

3 participants