Shields: Add F-Droid version badge

Created on 23 Aug 2018  路  9Comments  路  Source: badges/shields

Context

The [F-Droid] app store publishes open-source Android apps. In https://gitlab.com/fdroid/fdroiddata/issues/1325, I asked, how to implement a badge which shows the latest published version.

Motivation

Since F-Droid allows continuous deployment, this could allow developers to fast-feedback and encourage contributions.

Evaluation

There are over 2600 apps in the app store. Some would use the badge.

Questions:

  • Where should new services be added? The tutorial suggests into the server.js file.
needs-upstream-help service-badge

Most helpful comment

I got the badge working. Now, I can focus on the nice things.

  • [x] add tests
  • [x] use new service model
  • [ ] document the new service model

All 9 comments

Where should new services be added? The tutorial suggests into the server.js file.

We're slowly migrating services away from the _server.js_ model, but have not yet updated the relevant parts of the documentation. You could have a go at using our new service model. You can refer to _/services/apm_ or _/services/wercker_ for examples of how this can be done. 馃槈

One question though: does F-Droid have an API? I haven't spotted anything related after a quick look at the website's documentation.

One question though: does F-Droid have an API?

I found it _slightly_ unclear but my reading was that it doesn't and the linked issue is a feature request for F-Droid to add a suitable API. If I've misunderstood that, feel free to remove the "needs upstream help" tag.

Thanks for the fast responses!

I do not know if f-droid has an API. But the page is built reliably using jekyll and such we know what it looks like. https://gitlab.com/fdroid/fdroid-website/blob/9ae61894a18889ed749d36d5afbd0db3d0b0cfdd/_layouts/package.html#L147

I got the badge working. Now, I can focus on the nice things.

  • [x] add tests
  • [x] use new service model
  • [ ] document the new service model

The new service model could be ok. I will try.
@PyvesB about the tests: https://github.com/badges/shields/blob/master/services/wercker/wercker.tester.js#L28 Where is the fake response located? Does it query the server during testing?

Our tests generally query the real service when run. For hard to reproduce error cases, we sometimes intercept requests and return fake responses, see _apm.tester.js_ for some examples.

I'm somewhat concerned that F-Droid does not have an API. Performing scraping on the website's pages directly is more brittle and CPU intensive. I'm inclined to make some noise on the F-Droid project so that they document their API if it exists or so that they create one otherwise. 馃槈

__snapshots__/make-badge.spec.js what is this for? I should not commit this, should I?

Nope; something's wrong with that. See #1925.

Tests are added. However, I think, one needs to give examples. I will do that shortly.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chadwhitacre picture chadwhitacre  路  4Comments

techtonik picture techtonik  路  3Comments

korenyoni picture korenyoni  路  3Comments

rominf picture rominf  路  3Comments

PyvesB picture PyvesB  路  3Comments