Commit graph

3450 commits

Author SHA1 Message Date
Kevin Morris
22093c5c38
fix(routers.packages): restrict /pkgbase/{name}/voters to those with creds
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-19 17:15:47 -08:00
Kevin Morris
0c07c14860
change(poetry): update Markdown to 3.3.6
Previous versions when encountered with an updated `importlib_metadata`
produce a deprecation warning. This update resolves that deprecation.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-19 15:54:31 -08:00
Kevin Morris
36bc9ae29b
fix(notify): gracefully fail notifications
Instead of allowing an exception to propogate through the framework
routes, catch it and log out an error about notifications not being
sent.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-17 18:08:36 -08:00
Kevin Morris
d6d41cdbad
fix(templates): add missing empty package results text
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-16 22:01:14 -08:00
Kevin Morris
94e8d34948
fix(routers.accounts): use target user's account type for autofill
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-16 16:10:01 -08:00
Kevin Morris
e17389485b
test(templates): add pager tests
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-15 17:50:53 -08:00
Kevin Morris
f273cfc87d
change(templates): omit page count in pager partial if pages <= 0
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-15 17:46:15 -08:00
Kevin Morris
e1543f2e91
fix(templates): import aurweb.auth.creds directly
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-15 16:06:37 -08:00
Kevin Morris
c86f71a4b4
fix(time): unquote timezone when producing it
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-15 14:01:20 -08:00
Kevin Morris
703d655a5e
fix(users.validate): fix type hints
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-14 17:11:52 -08:00
Kevin Morris
3b878da59a
fix(templates): a user can set Inactive on themselves
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-14 16:46:33 -08:00
Kevin Morris
f357615bfb
change(users.validate): users can't edit their own account types
This commit also decouples testing regarding this feature
into several test functions.

Signed-off-by: Kevin Morris <kevr@0cost.org>

bump

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-14 16:45:40 -08:00
Hunter Wittenborn
2e12417a6c
Added '-x proc' flag to 'crond' command 2021-12-14 17:02:36 -06:00
Hunter Wittenborn
48973fe036
Fixed incorrect syntax usage and missing environment variables in cron jobs 2021-12-14 16:56:29 -06:00
Kevin Morris
c7751d5d63
fix(util): fix account_url's base url generation
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-14 14:30:34 -08:00
Kevin Morris
02a62532da
fix(python): fix difference parsing of comaintainers
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-13 16:34:44 -08:00
Kevin Morris
918593c3e6
change(poetry): bump dependency versions
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-13 14:16:12 -08:00
Kevin Morris
95a215ec58
change(poetry): dep on python >= 3.9 < 3.11
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-13 14:16:02 -08:00
Kevin Morris
de671e9b9c
fix(time): fall through and prefer AURTZ for timezone
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 23:03:26 -08:00
Kevin Morris
c47578f158
fix(auth): refresh the user record on successful auth
This will ensure the state of `request.user` is good to go
for any other users which obtain it after the backend.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 23:01:45 -08:00
Kevin Morris
d0e183a738
Revert "fix(gitlab-ci): only run services we need for deployment"
We'll need to update the nginx config to do this; putting
this off into an MR.

This reverts commit 19bd3766d2.
2021-12-09 21:24:26 -08:00
Kevin Morris
19bd3766d2
fix(gitlab-ci): only run services we need for deployment
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 21:11:23 -08:00
Kevin Morris
3a43e2b98c
fix(docker): reduce health check interval to 2s
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 21:03:37 -08:00
Kevin Morris
1fede8d2a3
change(requests): closures are now handled by pkgbase actions
Workflow has changed and TUs should now depend on actions taken closing
requests which exist for the package base (deletion, merge, disown|orphan).

The `/requests/{id}/close` route is now purely used for rejecting
requests. The deletion, merge and orphan closures have been added
into their related action routes. See the lists below.

Disowning can only be done if an existing orphan request can be found
for the action by TUs. Maintainers can disown their own packages at
any time.

Actions which provide request closures:
--------------------------------------
- `/pkgbase/{name}/delete`: deletion request closure
- `/pkgbase/{name}/merge`: merge request closure
- `/pkgbase/{name}/disown`: orphan request closure

To close a request:
------------------
- `/requests/{id}/close`: close a request with rejected status

For deletion and merge actions, if no request yet exists, one
will be autogenerated and closed.

For orphan requests, a preexisting require is required and an
error is now returned in cases where one cannot be found.

For all closure actions, if the new comments field is left empty,
a closure comment will be autogenerated.

Note: This is a documentation commit summing up UX changes from
recent commits.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 20:27:40 -08:00
Kevin Morris
26b1674c9e
fix(requests): rework handling of requests
This commit changes several things about how we were handling
package requests.

Modifications (requests):
-------------
- `/requests/{id}/close` no longer provides an Accepted selection.
  All manual request closures will cause a rejection.
- Relevent `pkgbase` actions now trigger request closures:
  `/pkgbase/{name}/delete` (deletion), `/pkgbase/{name}/merge` (merge)
  and `/pkgbase/{name}/disown` (orphan).
- Comment fields have been added to
  `/pkgbase/{name}/{delete,merge,disown}`, which is used to set the
  `PackageRequest.ClosureComment` on pending requests. If the comment
  field is left blank, a closure comment is autogenerated.
- Autogenerated request notifications are only sent out once
  as a closure notification.
- Some markup has been fixed.

Modifications (disown/orphan):
-----------------------------
- Orphan requests are now handled through the same path as
  deletion/merge.
- We now check for due date when disowning as non-maintainer;
  previously, this was only done for display and not functionally.
  This check applies to Trusted Users' disowning of a package.

This style of notification flow does reduce our visibility, but
accounting can still be done via the close request; it includes
the action, pkgbase name and the user who accepted it.

Closes #204

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 19:09:51 -08:00
Kevin Morris
bad57ba502
feat(exceptions): add InvariantError
This exception is to be used when a known invariant is violated.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 15:10:06 -08:00
Kevin Morris
85e6ad03db
feat(testing.email): add Email.dump
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 15:10:04 -08:00
Kevin Morris
60b098a2f2
fix(git-cliff): define Housekeeping group + match all tags
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 14:57:31 -08:00
Kevin Morris
32660881f6
fix(docker): set notifications up in test config
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 11:06:29 -08:00
Kevin Morris
c3d962a0d0
fix(templates): add some comments
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-09 11:06:19 -08:00
Kevin Morris
061e828f16
fix(gitlab-ci): use logging.prod.conf for sharness
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-07 15:09:20 -08:00
Kevin Morris
7831503c19
fix(docker): use logging.prod.conf for sharness
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-07 15:09:20 -08:00
Kevin Morris
409229739e
feat(conftest): set default logging.conf to DEBUG
We now maintain a logging.prod.conf, which should contain sane
defaults for a production instance. Our main logging.conf is
a good default for both testing and debugging, but provides
too much logging for production.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-07 15:09:13 -08:00
Kevin Morris
50d6a9b5c8
Merge branch 'fix-unlinked-pkgname' into pu 2021-12-07 13:57:14 -08:00
Kevin Morris
73034c7998
Merge branch 'fix-unneeded-newline' into pu 2021-12-07 13:57:06 -08:00
Kevin Morris
1b203f0d30
fix(requests): show unlinked pkgname when PackageBase has been deleted
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-07 13:51:38 -08:00
Kevin Morris
452f5d160a
fix(python): remove unneeded newline
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-07 13:50:40 -08:00
Kevin Morris
31d82fb1af
fix(templates): correct Closed link display
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-07 13:49:57 -08:00
Kevin Morris
2df54bd7a0
Merge branch 'fix-package-link' into pu 2021-12-07 12:35:21 -08:00
Kevin Morris
de7e3ab607
fix(logging): restore aurweb logger; null out root logger
After actually digging into how the logger does things,
since the root logger is required and we have specific
level-changing loggers for our components, we must no-op
the root logger to avoid it duplicating logs from the others.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-07 07:45:59 -08:00
Kevin Morris
a9a0adaead
fix(python): fix package_link check
This was failing when it matched more than one record.
This fixes that issue by using an EXISTS query.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-07 07:44:56 -08:00
Kevin Morris
8b350066c1
Merge branch 'fix-package-vote' into pu 2021-12-06 23:45:35 -08:00
Kevin Morris
4667993dad
Merge branch 'fix-comaintainer' into pu 2021-12-06 23:45:20 -08:00
Kevin Morris
0447afa2e5
fix(PackageNotification): add missing backref cascade
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-06 23:02:53 -08:00
Kevin Morris
51b4709ea4
fix(PackageVote): include backref cascade definition
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-06 23:02:06 -08:00
Kevin Morris
57df6db609
fix(PackageComaintainer): populate backref cascade properly
Closes #205

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-06 23:01:04 -08:00
Kevin Morris
27f8603dc5
fix(python): fix ordering of fields in partials/account_form.html
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 17:56:02 -08:00
Kevin Morris
cf978e23aa
fix(python): use S argument to decide Suspended
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 17:56:02 -08:00
Kevin Morris
0ed752277c
Merge branch 'fix-account-show' into pu 2021-12-04 17:54:36 -08:00
Kevin Morris
8501bba0ac
change(python): rework session timing
Previously, we were just relying on the cookie expiration
for sessions to expire. We were not cleaning up Session
records either.

Rework timing to depend on an AURREMEMBER cookie which is
now emitted on login during BasicAuthBackend processing.

If the SID does still have a session but it's expired,
we now delete the session record before returning.

Otherwise, we update the session's LastUpdateTS to
the current time.

In addition, stored the unauthenticated result value
in a variable to reduce redundancy.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-12-04 02:16:22 -08:00