Skip to content

Commit

Permalink
feat: Adds affiliation plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Chernicoff committed Oct 22, 2024
1 parent a72bd74 commit c4a57f1
Show file tree
Hide file tree
Showing 17 changed files with 1,211 additions and 21 deletions.
18 changes: 18 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ members = [
"plugins/github_api",
"plugins/npm_dependencies",
"plugins/activity",
"plugins/affiliation",
"plugins/fuzz"
]

Expand Down
6 changes: 4 additions & 2 deletions plugins/activity/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,16 @@ mod test {
let output = "2024-06-19T19:22:45Z".to_string();

// when calling into query, the input repo gets passed to `last_commit_date`, lets assume it returns the datetime `output`
Ok(MockResponses::new().insert("mitre/git/last_commit_date", repo, Ok(output))?)
let mut mock_responses = MockResponses::new();
mock_responses.insert("mitre/git/last_commit_date", repo, Ok(output))?;
Ok(mock_responses)
}

#[tokio::test]
async fn test_activity() {
let repo = repo();
let target = Target {
specifier: "expressjs".to_string(),
specifier: "express".to_string(),
local: repo,
remote: None,
package: None,
Expand Down
23 changes: 23 additions & 0 deletions plugins/affiliation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "affiliation_sdk"
version = "0.1.0"
license = "Apache-2.0"
edition = "2021"
publish = false

[dependencies]
anyhow = "1.0.89"
clap = { version = "4.5.18", features = ["derive"] }
hipcheck-sdk = { path = "../../sdk/rust", features = ["macros"]}
kdl = "4.6.0"
log = "0.4.22"
pathbuf = "1.0.0"
schemars = { version = "0.8.21", features = ["url"] }
serde = { version = "1.0.210", features = ["derive", "rc"] }
serde_json = "1.0.128"
strum = { version = "0.26.3", features = ["derive"] }
tokio = { version = "1.40.0", features = ["rt"] }

[dev-dependencies]
hipcheck-sdk = { path = "../../sdk/rust", features = ["macros", "mock_engine"]}
test-log = "0.2.16"
14 changes: 14 additions & 0 deletions plugins/affiliation/plugin.kdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
publisher "mitre"
name "affiliation"
version "0.1.0"
license "Apache-2.0"
entrypoint {
on arch="aarch64-apple-darwin" "./hc-mitre-affiliation"
on arch="x86_64-apple-darwin" "./hc-mitre-affiliation"
on arch="x86_64-unknown-linux-gnu" "./hc-mitre-affiliation"
on arch="x86_64-pc-windows-msvc" "./hc-mitre-affiliation"
}

dependencies {
plugin "mitre/git" version="0.1.0" manifest="./plugins/git/plugin.kdl"
}
Loading

0 comments on commit c4a57f1

Please sign in to comment.