Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/frontend/src/composables/project-nag-validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const projectNagFields = {
'server-region': ['select-country'],
'server-languages': ['all-languages', 'too-many-languages', 'select-language'],
'java-address': ['add-java-address'],
'server-compatibility': ['select-compatibility'],
'server-compatibility': ['select-compatibility', 'modpack-version-not-public'],
tags: [
'select-tags',
'too-many-tags',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/labrinth/AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
- Use `ApiError` as the error type for API routes
- Always use spaces instead of tabs, and run `cargo fmt` before finishing a turn
- Always use `cargo clippy` instead of `cargo check`
- The return type of an HTTP route should not be `HttpResponse` if possible; always prefer more specific types
- Use `web::Json<T>` for JSON-encoded response
Expand Down
1 change: 1 addition & 0 deletions apps/labrinth/src/routes/internal/delphi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ async fn ingest_report_deserialized(
crate::routes::v3::projects::mutation::prepare_technical_review_exits(
&exited_projects,
&mut transaction,
&pool,
&redis,
)
.await?;
Expand Down
5 changes: 4 additions & 1 deletion apps/labrinth/src/routes/internal/moderation/tech_review.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,7 @@ pub async fn submit_report(
crate::routes::v3::projects::mutation::prepare_mutations(
&[project_id],
&mut txn,
&pool,
&redis,
Some(&user),
)
Expand All @@ -1291,7 +1292,7 @@ pub async fn submit_report(

if prepared.is_none() && removed.rows_affected() > 0 {
prepared = Some(crate::routes::v3::projects::mutation::prepare_technical_review_exits(
&[project_id], &mut txn, &redis,
&[project_id], &mut txn, &pool, &redis,
).await?);
}

Expand Down Expand Up @@ -1483,6 +1484,7 @@ pub async fn update_issue_details(
crate::routes::v3::projects::mutation::prepare_technical_review_exits(
&exited_projects,
&mut txn,
&pool,
&redis,
)
.await?;
Expand Down Expand Up @@ -1623,6 +1625,7 @@ pub async fn update_global_issue_details(
crate::routes::v3::projects::mutation::prepare_technical_review_exits(
&exited_projects,
&mut txn,
&pool,
&redis,
)
.await?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ pub async fn scan_rules(
let _ = sender.send(Bytes::from_static(b": connected\n\n"));

actix_web::rt::spawn(async move {
match run_scan(transaction, &sender, &redis).await {
match run_scan(transaction, &sender, &pool, &redis).await {
Ok(summary) => {
let event = RuleScanEvent {
phase: "complete",
Expand Down Expand Up @@ -461,6 +461,7 @@ pub async fn scan_rules(
async fn run_scan(
mut transaction: PgTransaction<'static>,
sender: &mpsc::UnboundedSender<Bytes>,
pool: &PgPool,
redis: &RedisPool,
) -> Result<ScanSummary> {
let project_ids = sqlx::query!(
Expand Down Expand Up @@ -797,6 +798,7 @@ async fn run_scan(
crate::routes::v3::projects::mutation::prepare_technical_review_exits(
&exited_projects,
&mut transaction,
pool,
redis,
)
.await?;
Expand Down
1 change: 1 addition & 0 deletions apps/labrinth/src/routes/v3/disclosures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ pub async fn modify_project_disclosures(
super::projects::mutation::finalize_mutation(
project.inner.id,
transaction,
&pool,
&redis,
Some(&user),
)
Expand Down
3 changes: 3 additions & 0 deletions apps/labrinth/src/routes/v3/organizations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,7 @@ pub async fn organization_delete(
super::projects::mutation::finalize_mutations(
&organization_project_ids,
transaction,
&pool,
&redis,
Some(&user),
)
Expand Down Expand Up @@ -1059,6 +1060,7 @@ pub async fn organization_projects_add(
super::projects::mutation::finalize_mutation(
project_item.inner.id,
transaction,
&pool,
&redis,
Some(&current_user),
)
Expand Down Expand Up @@ -1278,6 +1280,7 @@ pub async fn organization_projects_remove(
super::projects::mutation::finalize_mutation(
project_item.inner.id,
transaction,
&pool,
&redis,
Some(&current_user),
)
Expand Down
2 changes: 2 additions & 0 deletions apps/labrinth/src/routes/v3/project_creation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ pub async fn project_create_internal(
let prepared = super::projects::mutation::prepare_mutations(
&[project_id.into()],
&mut transaction,
&client,
&redis,
Some(&current_user),
)
Expand Down Expand Up @@ -466,6 +467,7 @@ pub async fn project_create_with_id(
let prepared = super::projects::mutation::prepare_mutations(
&[project_id.into()],
&mut transaction,
&client,
&redis,
Some(&current_user),
)
Expand Down
1 change: 1 addition & 0 deletions apps/labrinth/src/routes/v3/project_creation/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ pub async fn create(
super::super::projects::mutation::finalize_mutation(
project_id.into(),
txn,
&db,
&redis,
Some(&user),
)
Expand Down
20 changes: 17 additions & 3 deletions apps/labrinth/src/routes/v3/projects/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1473,6 +1473,7 @@ pub async fn project_edit_internal(
team_member.as_ref().is_none_or(|member| !member.accepted),
sync_archival_disclosure,
&mut transaction,
&pool,
&redis,
)
.await?;
Expand All @@ -1484,6 +1485,7 @@ pub async fn project_edit_internal(
project_item.inner.slug.clone(),
submit_for_review,
transaction,
&pool,
&redis,
Some(&user),
)
Expand Down Expand Up @@ -1542,6 +1544,7 @@ async fn submit_project_for_review(
notify_team_members: bool,
sync_archival_disclosure: bool,
transaction: &mut PgTransaction<'_>,
pool: &PgPool,
redis: &RedisPool,
) -> Result<bool, ApiError> {
let archival_disclosure =
Expand Down Expand Up @@ -1572,9 +1575,13 @@ async fn submit_project_for_review(
.wrap_internal_err("failed to remove archival disclosure")?;
}

let mut state =
mutation::sync_project_state(project.inner.id, transaction, redis)
.await?;
let mut state = mutation::sync_project_state(
project.inner.id,
transaction,
pool,
redis,
)
.await?;

sqlx::query!(
"
Expand Down Expand Up @@ -2322,6 +2329,7 @@ pub async fn projects_edit(
mutation::finalize_mutations(
&changed_project_ids,
transaction,
&pool,
&redis,
Some(&user),
)
Expand Down Expand Up @@ -2577,6 +2585,7 @@ pub async fn project_icon_edit_internal(
mutation::finalize_mutation(
project_item.inner.id,
transaction,
&pool,
&redis,
Some(&user),
)
Expand Down Expand Up @@ -2727,6 +2736,7 @@ pub async fn delete_project_icon_internal(
mutation::finalize_mutation(
project_item.inner.id,
transaction,
&pool,
&redis,
Some(&user),
)
Expand Down Expand Up @@ -2986,6 +2996,7 @@ pub async fn add_gallery_item_internal(
mutation::finalize_mutation(
project_item.inner.id,
transaction,
&pool,
&redis,
Some(&user),
)
Expand Down Expand Up @@ -3221,6 +3232,7 @@ pub async fn edit_gallery_item_internal(
mutation::finalize_mutation(
project_item.inner.id,
transaction,
&pool,
&redis,
Some(&user),
)
Expand Down Expand Up @@ -3368,6 +3380,7 @@ pub async fn delete_gallery_item_internal(
mutation::finalize_mutation(
project_item.inner.id,
transaction,
&pool,
&redis,
Some(&user),
)
Expand Down Expand Up @@ -3658,6 +3671,7 @@ pub async fn project_delete_internal(
original_slug,
false,
transaction,
&pool,
&redis,
Some(&user),
)
Expand Down
Loading
Loading