Skip to content

Commit

Permalink
debug, wip other notes to self
Browse files Browse the repository at this point in the history
  • Loading branch information
colemickens committed May 8, 2024
1 parent 2968e46 commit 21e5373
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,9 @@ impl Display for Visibility {
}
}
}


// TODO: get other list of changes from the other jj branch????
//
// FlakeStruct to decode into instead of get()
// TODO: for the commands, dbg!(as_std())
23 changes: 12 additions & 11 deletions src/push_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,17 @@ impl GitContext {

let gitlab_client = gitlab::Gitlab::new(gitlab_host, gitlab_token)?;

// gitlab -> repo labels
let labels_endpoint = gitlab::api::projects::labels::Labels::builder()
.build()
.unwrap();
let repo_labels = gitlab::api::paged(
labels_endpoint,
gitlab::api::Pagination::Limit(MAX_LABEL_LENGTH),
)
.query(&gitlab_client)?;
tracing::error!("skipping fetching repo labels from gitlab1");
// // gitlab -> repo labels
// let labels_endpoint = gitlab::api::projects::labels::Labels::builder()
// .build()
// .unwrap();
// let repo_labels = gitlab::api::paged(
// labels_endpoint,
// gitlab::api::Pagination::Limit(MAX_LABEL_LENGTH),
// )
// .query(&gitlab_client)?;
let repo_labels = vec![];

// revision_info: GET /projects/:id/repository/commits
// https://docs.gitlab.com/ee/api/commits.html
Expand Down Expand Up @@ -148,7 +150,7 @@ impl PushContext {
cli.backfill_from_gitlab_env();
}

// notes for future readers:
// NOTE(colemickens): for future readers:
// upload_name is derived from repository, unless set
// upload_name is then used for upload_name (and repository) there-after
// *except* in GitHub paths, where it's used to query the authoritative git_ctx and locally to fill the fake jwt
Expand Down Expand Up @@ -392,7 +394,6 @@ impl PushContext {

// flake_dir is an absolute path of flake_root(aka git_root)/subdir
let flake_dir = local_git_root.join(&subdir);
// TODO(review): depending on what the user called us with, this flake_dir isn't even necessarily canonicalized, is this a sec/traversal issue?

// FIXME: bail out if flake_metadata denotes a dirty tree.
let flake_metadata = flake_info::FlakeMetadata::from_dir(&flake_dir)
Expand Down
2 changes: 0 additions & 2 deletions src/release_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ pub(crate) struct ReleaseMetadata {
pub(crate) labels: Vec<String>,
}

// TODO(review,colemickens): I don't really undersatnd why these are nededed??? we don't need the OptionString-y stuff since this isn't GHA adjacent?

fn option_string_to_spdx<'de, D>(deserializer: D) -> Result<Option<spdx::Expression>, D::Error>
where
D: serde::de::Deserializer<'de>,
Expand Down
2 changes: 1 addition & 1 deletion src/revision_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::Path;

#[derive(Clone)]
pub(crate) struct RevisionInfo {
pub(crate) commit_count: Option<usize>,
pub(crate) commit_count: Option<usize>, // TODO: change out usize for sized types
pub(crate) revision: String,
}

Expand Down

0 comments on commit 21e5373

Please sign in to comment.