1. 10 Oct, 2021 3 commits
  2. 08 Oct, 2021 14 commits
  3. 07 Oct, 2021 10 commits
  4. 05 Oct, 2021 5 commits
  5. 04 Oct, 2021 4 commits
  6. 03 Oct, 2021 4 commits
    • Kevin Morris's avatar
      fix(FastAPI): Improve sqlite testing speed · 7bfc2bf9
      Kevin Morris authored
      This commit adds a new Arch dependency: `libeatmydata`, which
      provides the `eatmydata` executable that stubs out fsync() operations.
      We use `eatmydata` to run our sharness and pytests in Docker now.
      
      With `autocommit=True`, required by SQLAlchemy to keep the
      session up to date with external DB modifications, many fsync
      calls are used in the SQLite backend; especially because we're wiping
      and creating records in every DB-bound test.
      
      **Before:**
      
      - mysql: 1m42s (elapsed during pytest run)
      - sqlite: 3m06s (elapsed during pytest run)
      
      **After:**
      
      - mysql: 1m40s (elapsed during pytest run)
      - sqlite: 1m50s (elapsed during pytest run)
      
      Shout out to @klausenbusk, who suggested this as a possible fix,
      and it was. Thanks, Kristian!
      
      Closes #120
      
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      7bfc2bf9
    • Kevin Morris's avatar
      feat(FastAPI): use SQLAlchemy's scoped_session · b5f8e69b
      Kevin Morris authored
      Closes #113
      
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      b5f8e69b
    • Kevin Morris's avatar
      feat(FastAPI): add /requests/{id}/close (get, post) · f6141ff1
      Kevin Morris authored
      Changes from PHP:
      
      - If a user submits a POST request with an invalid reason,
        they are returned back to the closure form with a BAD_REQUEST status.
      - Now, users which created a PackageRequest have the ability to close
        their own.
      - Form action has been changed to `/requests/{id}/close`.
      
      Closes #20
      
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      f6141ff1
    • Kevin Morris's avatar
      feat(FastAPI): add /pkgbase/{name}/request (post) · 1c031638
      Kevin Morris authored
      
      
      This change implements the FastAPI version of the
      /pkgbase/{name}/request form's action.
      
      Changes from PHP:
      
      - Additional errors are now displayed for the **merge_into** field,
        which are only displayed when the Merge type is selected.
          - If the **merge_into** field is empty, a new error is displayed:
            'The "Merge into" field must not be empty.'
          - If the **merge_into** field is given the name of a package base
            which does not exist, a new error is displayed:
            "The package base you want to merge into does not exist."
          - If the **merge_into** field is given the name of the package
            base that a request is being created for, a new error is
            displayed: "You cannot merge a package base into itself."
      - When an error is encountered, users are now brought back to
        the request form which they submitted and an error is displayed
        at the top of the page.
      - If an invalid type is provided, users are returned to a BAD_REQUEST
        status rendering of the request form.
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      1c031638