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
1 change: 0 additions & 1 deletion .github/workflows/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
pull_request:
paths-ignore:
- 'alfs/**'
- 'archived/**'
- 'aries/**'
- 'config/**'
- 'docker/**'
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
pull_request:
paths-ignore:
- 'alfs/**'
- 'archived/**'
- 'aries/**'
- 'config/**'
- 'docker/**'
Expand All @@ -15,6 +14,10 @@ on:
- 'third-party/**'
- 'toolchains/**'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
# Label of the runner job
runner-job:
Expand Down
10 changes: 9 additions & 1 deletion jupiter/src/storage/issue_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,16 @@ impl IssueStorage {
pub async fn list_labels_by_page(
&self,
page: Pagination,
name: &str,
) -> Result<(Vec<label::Model>, u64), MegaError> {
let paginator = label::Entity::find().paginate(self.get_connection(), page.per_page);
let mut condition = Condition::all();
if !name.is_empty() {
let name = format!("%{name}%");
condition = condition.add(label::Column::Name.like(name));
}
let paginator = label::Entity::find()
.filter(condition)
.paginate(self.get_connection(), page.per_page);
let num_pages = paginator.num_items().await?;
Ok(paginator
.fetch_page(page.page - 1)
Expand Down
2 changes: 1 addition & 1 deletion mono/src/api/label/label_router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async fn fetch_label_list(
) -> Result<Json<CommonResult<CommonPage<LabelItem>>>, ApiError> {
let (items, total) = state
.issue_stg()
.list_labels_by_page(json.pagination)
.list_labels_by_page(json.pagination, &json.additional)
.await?;
Ok(Json(CommonResult::success(Some(CommonPage {
items: items.into_iter().map(|m| m.into()).collect(),
Expand Down
21 changes: 10 additions & 11 deletions mono/src/api/mr/mr_router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use common::{
errors::MegaError,
model::{CommonPage, CommonResult, PageParams},
};
use saturn::ActionEnum;

use crate::api::MonoApiServiceState;
use crate::api::{
api_common::{
self,
Expand All @@ -25,7 +25,6 @@ use crate::api::{
mr::{FilesChangedList, MRDetailRes, MrFilesRes, MuiTreeNode},
oauth::model::LoginUser,
};
use crate::api::{util, MonoApiServiceState};
use crate::{api::error::ApiError, server::https_server::MR_TAG};

pub fn routers() -> OpenApiRouter<MonoApiServiceState> {
Expand Down Expand Up @@ -157,15 +156,15 @@ async fn merge(
let model = res.ok_or(MegaError::with_message("Not Found"))?;

if model.status == MergeStatusEnum::Open {
let path = model.path.clone();
util::check_permissions(
&user.username,
&path,
ActionEnum::ApproveMergeRequest,
state.clone(),
)
.await
.unwrap();
// let path = model.path.clone();
// util::check_permissions(
// &user.username,
// &path,
// ActionEnum::ApproveMergeRequest,
// state.clone(),
// )
// .await
// .unwrap();
state.monorepo().merge_mr(&user.username, model).await?;
}
Ok(Json(CommonResult::success(None)))
Expand Down
Loading