1. 24 Oct, 2021 2 commits
  2. 23 Oct, 2021 2 commits
  3. 22 Oct, 2021 1 commit
  4. 21 Oct, 2021 3 commits
  5. 19 Oct, 2021 2 commits
  6. 17 Oct, 2021 1 commit
  7. 15 Oct, 2021 2 commits
  8. 10 Oct, 2021 1 commit
  9. 08 Oct, 2021 6 commits
  10. 07 Oct, 2021 2 commits
  11. 03 Oct, 2021 6 commits
    • 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
    • Kevin Morris's avatar
      feat(FastAPI): add /pkgbase/{name}/request (get) · ad836939
      Kevin Morris authored
      
      
      This change brings in the package base request form
      for new submissions.
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      ad836939
    • Kevin Morris's avatar
      feat(FastAPI): allow reporters to cancel their own requests (1/2) · 1cf94209
      Kevin Morris authored
      This change required a slight modification of how we handle
      the Requests page. It is now available to all users.
      
      This commit provides 1/2 of the implementation which actually
      satisfies this feature. 2/2 will contain the actual implementation
      of closures of requests, which will also allow users who created
      the request to decide to close it.
      
      Issue: #20
      
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      1cf94209
    • Kevin Morris's avatar
      feat(FastAPI): added /requests (get) route · 99482f99
      Kevin Morris authored
      Introduces `aurweb.defaults` and `aurweb.filters`.
      
      `aurweb.filters` is a location developers can put their additional
      Jinja2 filters and/or functions. We should slowly move all of our
      filters over here, where it makes sense.
      
      `aurweb.defaults` is a new module which hosts some default constants
      and utility functions, starting with offsets (O) and per page values
      (PP).
      
      As far as the new GET /requests is concerned, we match up here to
      PHP's implementation, with some minor improvements:
      
      Improvements:
      
      * PP on this page is now configurable: 50 (default), 100, or 250.
          * Example: `https://localhost:8444/requests?PP=250`
      
      Modifications:
      
      * The pagination is a bit different, but serves the exact same purpose.
      * "Last" no longer goes to an empty page.
          * Closes: #14
      
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      99482f99
    • Kevin Morris's avatar
      feat(FastAPI): add /pkgbase/{name}/comaintainers (get, post) · 4d191b51
      Kevin Morris authored
      Changes from PHP:
      
      - Form action now points to `/pkgbase/{name}/comaintainers`.
      - When an error occurs, users are sent back to
        `/pkgbase/{name}/comaintainers` with an error at the top of the page.
        (PHP used to send people to /pkgbase/, which ended up at a blank
        search page).
      
      Closes: #51
      
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      4d191b51
  12. 02 Oct, 2021 7 commits
  13. 19 Sep, 2021 1 commit
    • Kevin Morris's avatar
      feat(FastAPI): add /packages (get) search · 5cf70620
      Kevin Morris authored
      In terms of performance, most queries on this page win over
      PHP in query times, with the exception of sorting by Voted or
      Notify (#102
      
      ).
      Otherwise, there are a few modifications: described below.
      
      * Pagination
          * The `paginate` Python module has been used in the FastAPI
            project
            here to implement paging on the packages search page. This
            changes how pagination is displayed, however it serves the
            same purpose. We'll take advantage of this module in other
            places as well.
      * Form action
          * The form action for actions now use `POST /packages` to
            perform. This is currently implemented and will be
            addressed in a follow-up commit.
      * Input names and values
          * Input names and values have been modified to satisfy the
            snake_case naming convention we'd like to use as much as
            possible.
          * Some input names and values were modified to comply with
            FastAPI Forms: (IDs[<id>]) -> (IDs, <id>).
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      5cf70620
  14. 03 Sep, 2021 1 commit
    • Kevin Morris's avatar
      [FastAPI] Refactor db modifications · a5943bf2
      Kevin Morris authored
      
      
      For SQLAlchemy to automatically understand updates from the
      external world, it must use an `autocommit=True` in its session.
      
      This change breaks how we were using commit previously, as
      `autocommit=True` causes SQLAlchemy to commit when a
      SessionTransaction context hits __exit__.
      
      So, a refactoring was required of our tests: All usage of
      any `db.{create,delete}` must be called **within** a
      SessionTransaction context, created via new `db.begin()`.
      
      From this point forward, we're going to require:
      
      ```
      with db.begin():
          db.create(...)
          db.delete(...)
          db.session.delete(object)
      ```
      
      With this, we now get external DB modifications automatically
      without reloading or restarting the FastAPI server, which we
      absolutely need for production.
      Signed-off-by: Kevin Morris's avatarKevin Morris <kevr@0cost.org>
      a5943bf2
  15. 31 Aug, 2021 2 commits
  16. 28 Jul, 2021 1 commit