Commit graph

525 commits

Author SHA1 Message Date
moson-mo
d0b0e4d88b
fix: update repo information with aurblup script
Currently, the "Repo" column in "OfficialProviders" is not updated
when a package is moved from one repository to another.

Note that we only save a package/provides combination once,
hence if a package is available in core and testing at the same time,
it would only put just one record into the OfficialProviders table.

We iterate through the repos one by one and the last value
is kept for mapping a (package/provides) combination to a repo.
Due to that, the repos listed in the "sync-db" config setting
should be ordered such that the "testing" repos are listed first.

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-05-17 18:22:53 +02:00
moson-mo
8ca63075e9
housekeep: remove PHP implementation
removal of the PHP codebase

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-04-28 16:10:32 +02:00
Leonidas Spyropoulos
6ede837b4f
feat: allow users to hide deleted comments
Closes: #435

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2023-04-24 09:13:38 +01:00
moson-mo
b9df7541b3
fix: add comments in email for direct deletion/merge
TUs and Devs can delete and merge packages directly.
Currently the comments they enter, don't end up in the ML notification.

Include the comment in the notifications for direct deletion / merge

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-03-14 11:17:45 +01:00
moson-mo
7d1827ffc5
feat: cancel button for comment editing
Adds button that allows cancellation while editing a comment

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-03-09 21:48:58 +01:00
moson-mo
52c962a590
fix(deps): fastapi 0.92.0 upgrade
middleware must be added before startup:

fixes: "RuntimeError: Cannot add middleware after an application has started"

https://fastapi.tiangolo.com/release-notes/#0910
Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-03-04 10:29:54 +01:00
moson-mo
7d06c9ab97
fix: encode package name in URL for source files
Package(Base) names might include characters that require url-encoding

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-03-01 18:04:20 +01:00
moson-mo
8aac842307
fix(test): use single-quotes for strings in sql statements
Currently, in the sharness test suites, we use double-quotes
for string literals in SQL statements passed to sqlite3.

With sqlite version 3.41 the usage of double-quotes for string literals
is deactivated by default:
We'll need to switch to single-quotes in our tests.

Ref: Section 6.f. at https://www.sqlite.org/releaselog/3_41_0.html
Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-02-24 10:11:33 +01:00
moson-mo
0c5b4721d6
fix: include package data without "Last Packager"
Data for packages that do not have a "Last Packager"
(e.g. because the user account was deleted)
should still be available from the /rpc and metadata archives.

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-02-21 11:19:02 +01:00
moson-mo
8d2e176c2f
housekeep: stop "pkgmaint" script (cron job)
With the removal of the "setup-repo" command this script becomes obsolete,
because it is not possible to reserve a repo anymore.
Hence we don't need cleanup.

We've also seen issues in case the last packager's user account is removed,
leading to the deletion of a Package.

Let's deactivate this for now.

Issue report: #425

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-02-21 11:19:02 +01:00
moson-mo
b1a9efd552
housekeep(git): remove deprecated "setup-repo" command
Marked as deprecated about 6 years ago.
Time to bury it.

Issue report: #428

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-02-21 11:19:02 +01:00
Leonidas Spyropoulos
45218c4ce7
fix: per-page needs to be non zero
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2023-02-08 15:13:21 +00:00
Leonidas Spyropoulos
cb16f42a27
fix: validate timezone before use
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2023-02-06 16:40:43 +00:00
moson-mo
f9a5188fb7
chore(lint): reformatting after black update
Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-02-06 09:15:18 +01:00
Leonidas Spyropoulos
ef2baad7b3
feat: expand on update.py tests and show on Gitlab UI
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2023-01-27 17:16:25 +00:00
moson-mo
137ed04d34
test: add tests .SRCINFO parsing and git update routine
Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-01-27 15:40:25 +01:00
moson-mo
ec239ceeb3
feat: add "Last Updated" column to search results
Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-01-25 22:39:36 +01:00
moson-mo
becce1aac4
fix: occasional errors when loading package details
Fixes errors that might occur when loading the package details page.

Problem:
We are querying a list of "Required by" packages.
This list is loaded with all details for a "PackageDependency" record.

Now we also have a reference to some attributes from the
related package (PackageDependency.Package.xxx)

This will effectively trigger the ORM to run another query (lazyload),
to fetch the missing Package data (for each PackageDependency record).

At that point it might have happened that a referenced package
got deleted / updated so that we can't retrieve this data anymore and
our dep.Package object is "None"

Fix:
We can force our query to include Package data right away.
Thus we can avoid running a separate query (per "required by"...)

As a side-effect we get better performance.

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-01-25 22:34:19 +01:00
moson-mo
ff0123b54a
fix: save notification state for unchanged comments
When we edit a comment we can enable notifications (if not yet enabled).

We should also do this when the comment text is not changed.

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-01-25 09:42:20 +01:00
moson-mo
36fd58d7a6
fix: show notification box when adding a comment
Currently, the "Enable notifications" checkbox
is only shown when editing a comment.

We should also show it when a new comment is about to be added.

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-01-25 09:42:19 +01:00
Leonidas Spyropoulos
4d0a982c51 fix: assert offset and per_page are positive
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2023-01-14 20:57:11 +00:00
moson-mo
f6c4891415
feat: add Support section to Dashboard
Adds the "Support" section (displayed on "Home") to the "Dashboard" page as well.

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-01-14 13:12:33 +01:00
moson-mo
ff44eb02de
feat: add link to mailing list article on requests page
Provides a convenient way to check for responses on the
mailing list prior to Accepting/Rejecting requests.

We compute the Message-ID hash that can be used to
link back to the article in the mailing list archive.

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-01-12 12:06:28 +01:00
moson-mo
7a9448a3e5
perf: improve packages search-query
Improves performance for queries with large result sets.

The "group by" clause can be removed for all search types but the keywords.

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-01-05 22:00:32 +01:00
moson-mo
d8e91d058c
fix(rpc): provides search should return name match
We need to return packages matching on the name as well.
(A package always provides itself)

Signed-off-by: moson-mo <mo-son@mailbox.org>
2023-01-03 15:58:45 +01:00
moson-mo
7864ac6dfe
fix: search-by parameter for keyword links
Fixes:
Keyword-links on the package page pass wrong query-parameter.
Thus a name/description search is performed instead of  keywords

Issue report: #397

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-27 10:33:58 +01:00
moson-mo
a08681ba23
fix: Add "Show more..." link for "Required by"
Fix glitch on the package page:
"Show more..." not displayed for the "Required by" list

Fix test case:
Function name does not start with "test" hence it was never executed during test runs

Issue report: #363

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-25 12:24:04 +01:00
moson-mo
a832b3cddb
fix(test): FastAPI 0.87.0 - warning fixes
FastAPI 0.87.0 switched to the httpx library for their TestClient

* cookies need to be defined on the request instance instead of method calls

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-24 22:43:31 +01:00
moson-mo
1216399d53
fix(test): FastAPI 0.87.0 - error fixes
FastAPI 0.87.0 switched to the httpx library for their TestClient

* allow_redirects is deprecated and replaced by follow_redirects

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-24 22:23:37 +01:00
moson-mo
d5e102e3f4
feat: add "Submitter" field to /rpc info request
Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-22 18:46:57 +01:00
Leonidas Spyropoulos
ff92e95f7a
fix: delete associated ssh public keys with account deletion
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-11-22 16:51:09 +00:00
Leonidas Spyropoulos
bce5b81acd
feat: allow filtering requests from maintainers
These are usually easy to handle from TUs so allow to filter for them

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-11-22 16:39:11 +00:00
Leonidas Spyropoulos
500d6b403b
feat: add co-maintainers to RPC
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-11-22 16:32:51 +00:00
moson-mo
bcd808ddc1
feat(rpc): add "by" parameter - comaintainers
Add "by" parameter: comaintainers

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-11 11:32:39 +01:00
moson-mo
efd20ed2c7
feat(rpc): add "by" parameter - keywords
Add "by" parameter: keywords

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-11 11:32:31 +01:00
moson-mo
5484e68b42
feat(rpc): add "by" parameter - submitter
Add "by" parameter: submitter

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-11 11:32:19 +01:00
moson-mo
0583f30a53
feat(rpc): add "by" parameter - groups
Adding "by" parameter to search by "groups"

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-11 11:32:01 +01:00
moson-mo
50287cb066
feat(rpc): add "by" parameters - package relations
This adds new "by" search-parameters: provides, conflicts and replaces

Signed-off-by: moson-mo <mo-son@mailbox.org>
2022-11-11 11:30:44 +01:00
Leonidas Spyropoulos
73f0bddf0b
fix: handle default requests when using pages
The default page shows the pending requests which were working OK if one
used the Filters button. This fixes the case when someone submits by
using the pager (Next, Last etc).

Closes: #405

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-11-08 13:14:42 +00:00
Mario Oenning
6ee34ab3cb feat: add field "CoMaintainers" to metadata-archives 2022-10-31 09:42:56 +00:00
Mario Oenning
333051ab1f feat: add field "Submitter" to metadata-archives 2022-10-28 16:55:16 +00:00
Leonidas Spyropoulos
48e5dc6763
feat: remove empty lines from ssh_keys text area, and show helpful message
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-10-28 13:43:32 +01:00
Leonidas Spyropoulos
7e06823e58
refactor: remove redundand parenthesis when return tuple
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-10-28 13:43:32 +01:00
Leonidas Spyropoulos
9c0f8f053e
chore: rename logging.py and redis.py to avoid circular imports
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-10-22 18:51:38 +01:00
Leonidas Spyropoulos
b757e66997 feature: add filters and stats for requests
Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-10-15 15:26:53 +03:00
Kevin Morris
8657fd336e
feat: GET|POST /account/{name}/delete
Closes #348

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-30 05:08:50 -07:00
Leonidas Spyropoulos
0dddaeeb98
fix: remove sessions of suspended users
Fixes: #394

Signed-off-by: Leonidas Spyropoulos <artafinde@archlinux.org>
2022-09-26 08:59:44 +01:00
Kevin Morris
30e72d2db5 feat: archive git repository (experimental)
See doc/git-archive.md for general Git archive specifications
See doc/repos/metadata-repo.md for info and direction related to the new Git metadata archive
2022-09-24 16:51:25 +00:00
Kevin Morris
ec3152014b
fix: retry transactions who fail due to deadlocks
In my opinion, this kind of handling of transactions is pretty ugly.
The being said, we have issues with running into deadlocks on aur.al,
so this commit works against that immediate bug.

An ideal solution would be to deal with retrying transactions through
the `db.begin()` scope, so we wouldn't have to explicitly annotate
functions as "retry functions," which is what this commit does.

Closes #376

Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-13 12:54:08 -07:00
Kevin Morris
17f2c05fd3
feat(rpc): add GET /rpc/v5/suggest/{arg} openapi route
Signed-off-by: Kevin Morris <kevr@0cost.org>
2022-09-12 06:50:26 -07:00