Skip to content

Commit 56c0dc2

Browse files
committed
Put the data into the csv
1 parent 5de096c commit 56c0dc2

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/gitlab/mod.rs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ query ListRustRepos($after: String) {
2323
nodes {
2424
id
2525
name
26+
fullPath
2627
path
2728
webUrl
2829
}
@@ -37,9 +38,11 @@ struct PageInfo {
3738
}
3839

3940
#[derive(Debug, Deserialize)]
41+
#[serde(rename_all = "camelCase")]
4042
struct Project {
4143
id: String,
4244
name: String,
45+
full_path: String,
4346
path: String,
4447
webUrl: String,
4548
}
@@ -91,13 +94,21 @@ pub fn scrape(data: &Data, config: &Config, should_stop: &AtomicBool) -> Fallibl
9194
break;
9295
}
9396

94-
let data = resp.data.expect("No data returned");
95-
println!("{:?}", data);
96-
let projects = data.projects;
97+
let gitlab_data = resp.data.expect("No data returned");
98+
println!("{:?}", gitlab_data);
99+
let projects = gitlab_data.projects;
97100

98-
let mut last_id = data.get_last_id("gitlab")?.unwrap_or_default();
99101
for project in projects.nodes {
100102
println!("{:?}", project);
103+
data.store_repo(
104+
"gitlab",
105+
Repo {
106+
id: project.id.clone(),
107+
name: project.full_path.to_string(),
108+
has_cargo_toml: true, // TODO set
109+
has_cargo_lock: true,
110+
},
111+
)?;
101112
}
102113

103114
if !projects.pageInfo.hasNextPage {

0 commit comments

Comments
 (0)