Skip to content

Commit

Permalink
Remove teams from publisher ownership list
Browse files Browse the repository at this point in the history
  • Loading branch information
jdisanti committed Jan 27, 2023
1 parent c217058 commit 3271854
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 43 deletions.
6 changes: 0 additions & 6 deletions tools/publisher/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ pub const SDK_REPO_CRATE_PATH: &str = "sdk";
pub const SDK_REPO_NAME: &str = "aws-sdk-rust";
pub const SMITHYRS_REPO_NAME: &str = "smithy-rs";

// https://github.com/orgs/awslabs/teams/smithy-rs-server
pub const SMITHY_RS_SERVER_OWNER: &str = "github:awslabs:smithy-rs-server";

// https://github.com/orgs/awslabs/teams/rust-sdk-owners
pub const RUST_SDK_OWNER: &str = "github:awslabs:rust-sdk-owners";

// https://github.com/aws-sdk-rust-ci
pub const RUST_SDK_CI_OWNER: &str = "aws-sdk-rust-ci";

Expand Down
52 changes: 15 additions & 37 deletions tools/publisher/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use crate::fs::Fs;
use crate::sort::dependency_order;
use crate::{RUST_SDK_CI_OWNER, RUST_SDK_OWNER, SMITHY_RS_SERVER_OWNER};
use crate::RUST_SDK_CI_OWNER;
use anyhow::{Context, Result};
use cargo_toml::{Dependency, DepsSet, Manifest};
use semver::Version;
Expand Down Expand Up @@ -95,23 +95,11 @@ impl Package {
}

/// Returns the expected owners of the crate.
pub fn expected_package_owners(category: &PackageCategory, package_name: &str) -> HashSet<String> {
let mut ret = HashSet::new();

// Crate ownership for SDK crates. Crates.io requires that at least one owner
// is an individual rather than a team, so we use the automation user for that.
ret.insert(String::from(RUST_SDK_CI_OWNER));

if category.is_sdk() {
ret.insert(String::from(RUST_SDK_OWNER));
} else if package_name.starts_with("aws-smithy-http-server") {
ret.insert(String::from(SMITHY_RS_SERVER_OWNER));
} else {
ret.insert(String::from(RUST_SDK_OWNER));
ret.insert(String::from(SMITHY_RS_SERVER_OWNER));
}

ret
pub fn expected_package_owners(
_category: &PackageCategory,
_package_name: &str,
) -> HashSet<String> {
[RUST_SDK_CI_OWNER.to_string()].into_iter().collect()
}

/// Batch of packages.
Expand Down Expand Up @@ -536,12 +524,9 @@ mod tests {
];
for pkg in server_packages {
assert_eq!(
[
String::from("github:awslabs:smithy-rs-server"),
String::from("aws-sdk-rust-ci")
]
.into_iter()
.collect::<HashSet<String>>(),
[String::from("aws-sdk-rust-ci")]
.into_iter()
.collect::<HashSet<String>>(),
pkg.expected_owners()
);
}
Expand All @@ -551,12 +536,9 @@ mod tests {
fn test_expected_package_owners_sdk_crate() {
let sdk_package = package("aws-types", &[]);
assert_eq!(
[
String::from("github:awslabs:rust-sdk-owners"),
String::from("aws-sdk-rust-ci")
]
.into_iter()
.collect::<HashSet<String>>(),
[String::from("aws-sdk-rust-ci")]
.into_iter()
.collect::<HashSet<String>>(),
sdk_package.expected_owners()
);
}
Expand All @@ -565,13 +547,9 @@ mod tests {
fn test_expected_package_owners_smithy_runtime_crate() {
let smithy_runtime_package = package("aws-smithy-types", &[]);
assert_eq!(
[
String::from("github:awslabs:smithy-rs-server"),
String::from("github:awslabs:rust-sdk-owners"),
String::from("aws-sdk-rust-ci")
]
.into_iter()
.collect::<HashSet<String>>(),
[String::from("aws-sdk-rust-ci")]
.into_iter()
.collect::<HashSet<String>>(),
smithy_runtime_package.expected_owners()
);
}
Expand Down

0 comments on commit 3271854

Please sign in to comment.