Verified Commit 6720d8e5 authored by Orhun Parmaksız's avatar Orhun Parmaksız
Browse files

Merge branch 'main' of ssh://gitlab.archlinux.org:222/archlinux/gluebuddy into ci/run_clippy

parents 886edfc8 11091ee1
Pipeline #15173 failed with stages
in 2 minutes and 16 seconds
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
name = "gluebuddy" name = "gluebuddy"
version = "0.1.0" version = "0.1.0"
authors = ["Levente Polyak <anthraxx@archlinux.org>", "Sven-Hendrik Haase <svenstaro@gmail.com>"] authors = ["Levente Polyak <anthraxx@archlinux.org>", "Sven-Hendrik Haase <svenstaro@gmail.com>"]
edition = "2018" edition = "2021"
license-file = "LICENSE" license-file = "LICENSE"
repository = "https://gitlab.archlinux.org/archlinux/gluebuddy" repository = "https://gitlab.archlinux.org/archlinux/gluebuddy"
categories = ["command-line-utilities"] categories = ["command-line-utilities"]
......
...@@ -142,7 +142,7 @@ impl GitLabGlue { ...@@ -142,7 +142,7 @@ impl GitLabGlue {
let mut summary = PlanSummary::new(&label); let mut summary = PlanSummary::new(&label);
let members = self.get_group_members(&group.full_path).await?; let members = self.get_group_members(&group.full_path).await?;
for member in &members { for member in &members {
if is_archlinux_bot(&member) { if is_archlinux_bot(member) {
continue; continue;
} }
...@@ -199,7 +199,7 @@ impl GitLabGlue { ...@@ -199,7 +199,7 @@ impl GitLabGlue {
.await?; .await?;
for member in &members { for member in &members {
if is_archlinux_bot(&member) { if is_archlinux_bot(member) {
continue; continue;
} }
...@@ -258,7 +258,7 @@ impl GitLabGlue { ...@@ -258,7 +258,7 @@ impl GitLabGlue {
for staff in state.staff() { for staff in state.staff() {
if !gitlab_group_member_names.contains(&staff.username) if !gitlab_group_member_names.contains(&staff.username)
&& self && self
.add_group_member(action, &staff, group, DEFAULT_ARCH_LINUX_GROUP_ACCESS_LEVEL) .add_group_member(action, staff, group, DEFAULT_ARCH_LINUX_GROUP_ACCESS_LEVEL)
.await? .await?
{ {
summary.add += 1; summary.add += 1;
...@@ -266,7 +266,7 @@ impl GitLabGlue { ...@@ -266,7 +266,7 @@ impl GitLabGlue {
} }
for member in &archlinux_group_members { for member in &archlinux_group_members {
if is_archlinux_bot(&member) { if is_archlinux_bot(member) {
continue; continue;
} }
match state.staff_from_gitlab_id(member.id) { match state.staff_from_gitlab_id(member.id) {
...@@ -316,7 +316,7 @@ impl GitLabGlue { ...@@ -316,7 +316,7 @@ impl GitLabGlue {
for staff in state.staff() { for staff in state.staff() {
if !gitlab_group_member_names.contains(&staff.username) if !gitlab_group_member_names.contains(&staff.username)
&& self && self
.add_group_member(action, &staff, group, DEFAULT_STAFF_GROUP_ACCESS_LEVEL) .add_group_member(action, staff, group, DEFAULT_STAFF_GROUP_ACCESS_LEVEL)
.await? .await?
{ {
summary.add += 1; summary.add += 1;
...@@ -324,7 +324,7 @@ impl GitLabGlue { ...@@ -324,7 +324,7 @@ impl GitLabGlue {
} }
for member in &archlinux_group_members { for member in &archlinux_group_members {
if is_archlinux_bot(&member) { if is_archlinux_bot(member) {
continue; continue;
} }
match state.staff_from_gitlab_id(member.id) { match state.staff_from_gitlab_id(member.id) {
...@@ -375,7 +375,7 @@ impl GitLabGlue { ...@@ -375,7 +375,7 @@ impl GitLabGlue {
&& self && self
.add_group_member( .add_group_member(
action, action,
&staff, staff,
devops_group, devops_group,
DEVOPS_INFRASTRUCTURE_ACCESS_LEVEL, DEVOPS_INFRASTRUCTURE_ACCESS_LEVEL,
) )
...@@ -386,7 +386,7 @@ impl GitLabGlue { ...@@ -386,7 +386,7 @@ impl GitLabGlue {
} }
for member in &group_members { for member in &group_members {
if is_archlinux_bot(&member) { if is_archlinux_bot(member) {
continue; continue;
} }
match state.devops_from_gitlab_id(member.id) { match state.devops_from_gitlab_id(member.id) {
...@@ -511,7 +511,7 @@ impl GitLabGlue { ...@@ -511,7 +511,7 @@ impl GitLabGlue {
debug!("Adding user {} to GitLab group '{}'", user.username, group); debug!("Adding user {} to GitLab group '{}'", user.username, group);
util::print_diff( util::print_diff(
&"", "",
util::format_gitlab_member_access(group, &user.username, access_level).as_str(), util::format_gitlab_member_access(group, &user.username, access_level).as_str(),
)?; )?;
match action { match action {
...@@ -547,7 +547,7 @@ impl GitLabGlue { ...@@ -547,7 +547,7 @@ impl GitLabGlue {
util::access_level_from_u64(member.access_level), util::access_level_from_u64(member.access_level),
) )
.as_str(), .as_str(),
&"", "",
)?; )?;
match action { match action {
Action::Apply => { Action::Apply => {
...@@ -663,7 +663,7 @@ impl GitLabGlue { ...@@ -663,7 +663,7 @@ impl GitLabGlue {
user.username, project user.username, project
); );
util::print_diff( util::print_diff(
&"", "",
util::format_gitlab_member_access(project, &user.username, access_level).as_str(), util::format_gitlab_member_access(project, &user.username, access_level).as_str(),
)?; )?;
match action { match action {
...@@ -701,7 +701,7 @@ impl GitLabGlue { ...@@ -701,7 +701,7 @@ impl GitLabGlue {
util::access_level_from_u64(member.access_level), util::access_level_from_u64(member.access_level),
) )
.as_str(), .as_str(),
&"", "",
)?; )?;
match action { match action {
Action::Apply => { Action::Apply => {
......
...@@ -116,8 +116,7 @@ impl Keycloak { ...@@ -116,8 +116,7 @@ impl Keycloak {
.await?; .await?;
let groups = all_groups let groups = all_groups
.iter() .iter()
.filter(|group| root_groups.contains(&group.name.as_ref().unwrap().as_ref())) .filter(|group| root_groups.contains(&group.name.as_ref().unwrap().as_ref()));
.collect::<Vec<_>>();
let groups_members = groups.into_iter().flat_map(|group| { let groups_members = groups.into_iter().flat_map(|group| {
let group_name = group.name.as_ref().unwrap(); let group_name = group.name.as_ref().unwrap();
......
...@@ -20,12 +20,9 @@ use tokio::sync::Mutex; ...@@ -20,12 +20,9 @@ use tokio::sync::Mutex;
async fn run(args: Args) -> Result<()> { async fn run(args: Args) -> Result<()> {
/* Early exit for completions */ /* Early exit for completions */
match args.command { if let Command::Completions(completions) = args.command {
Command::Completions(completions) => {
args::gen_completions(&completions)?; args::gen_completions(&completions)?;
return Ok(()); return Ok(());
}
_ => {}
} }
let state = Arc::new(Mutex::new(State::default())); let state = Arc::new(Mutex::new(State::default()));
......
...@@ -95,5 +95,5 @@ pub fn format_gitlab_project_settings( ...@@ -95,5 +95,5 @@ pub fn format_gitlab_project_settings(
} }
pub fn format_separator() -> String { pub fn format_separator() -> String {
"-".repeat(72).to_string() "-".repeat(72)
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment