1. 13 Sep, 2021 6 commits
    • Edmund Smith's avatar
      Run cargo fmt on the codebase · 0f949a13
      Edmund Smith authored
      0f949a13
    • Edmund Smith's avatar
      Add some documentation for limit() · 31672b76
      Edmund Smith authored
      There are some caveats around the use of limit that show up practice,
      particularly the possibility of data loss at page boundaries.
      31672b76
    • Edmund Smith's avatar
      Use strum to provide deserialization for jobs · 3fd336a8
      Edmund Smith authored
      strum can automatically provide a derivation for std::str::FromStr.
      By default, serde wants to use an implementation of
      std::convert::TryFrom in its deserialize derivation, but the
      serde_with library adds a derive macro that will use FromStr instead.
      3fd336a8
    • Edmund Smith's avatar
      Use strum to provide display for jobs · 1d43fafd
      Edmund Smith authored
      Now that we're using strum anyway, we can take advantage of its
      ability to derive a display implementation for us (which,
      conveniently, produces the exact same output as our existing
      implementation).
      1d43fafd
    • Edmund Smith's avatar
      Extend the job API to allow more specific queries · ede5e8f7
      Edmund Smith authored
      This adds support for:
      - Obtaining all jobs after a given id
      - Obtaining all jobs started, submitted or ended after a given time.
      - Obtaining jobs in a set of states or healths.
      
      These queries make it easier to construct smart job caches, for
      example retrieving all unfinished jobs
      (`.state_not(State::Finished)`), all jobs added since we last queried
      (`.id_after(max_id)`), or all jobs that underwent some transition
      after our last query (`.ended_after(query_time)`).
      ede5e8f7
    • Edmund Smith's avatar
      Add a QuerySet type to make representing Django-style set queries easier · e78d6f7f
      Edmund Smith authored
      The QuerySet type that handles the desired semantics of `state()` and
      `state_not()` (similarly `health()` and `health_not()`). The standard
      REST pattern which this mimics is not entirely regular: if you do not
      specify any values, all values are included; once you specify a value,
      only that value is included, but specifying further values expands the
      accepted set. The routine `include()` is intended to back calls like
      `state()` on a JobsBuilder, and `exclude()` to back calls like
      `state_not()`.
      
      To be eligible for inclusion in a QuerySet, the item type must
      implement the QuerySetMember trait, which allows the queryset to find
      all possible values for the type. This only really makes sense for
      simple enums. The need for all values stems from the need to elide
      the field entirely from the query if no filtering has ended up being
      requested, and because `exclude()` needs to know positively which
      values are included.
      
      An default initialized QuerySet provides no filtering, so need not be
      wrapped in an Option.
      e78d6f7f
  2. 14 Jun, 2021 1 commit
  3. 17 May, 2021 1 commit
  4. 26 Apr, 2021 1 commit
  5. 14 Apr, 2021 3 commits
  6. 13 Apr, 2021 1 commit
  7. 06 Apr, 2021 3 commits
  8. 02 Apr, 2021 3 commits
  9. 13 Oct, 2020 2 commits
    • Sjoerd Simons's avatar
      Force a device ordering · a38becb3
      Sjoerd Simons authored
      
      
      When calling the device api point the device ordering seems
      non-deterministic; Which is not an issue apart from when getting the
      devices at an offset, which can cause missing/duplicated devices
      Signed-off-by: Sjoerd Simons's avatarSjoerd Simons <sjoerd@collabora.com>
      a38becb3
    • Sjoerd Simons's avatar
      Handle redirects directly · 92783bf6
      Sjoerd Simons authored
      
      
      Reqwest can handle redirections internally, however when redirect to
      another site it filters out all sensitive headers in particular
      authorization (e.g. when redirecting from collabora.com to collabora.co.uk).
      
      So handle it in the code instead; While also ensure it doesn't downgrade
      from https to http
      Signed-off-by: Sjoerd Simons's avatarSjoerd Simons <sjoerd@collabora.com>
      92783bf6
  10. 12 Oct, 2020 6 commits
  11. 08 Oct, 2020 1 commit
  12. 06 Oct, 2020 1 commit
  13. 07 Sep, 2020 1 commit