Skip to content

Commit

Permalink
fix: Default to sending local commits if no repos linked (#791)
Browse files Browse the repository at this point in the history
When an org has no integrations setup and runs sentry-cli releases set-commits --auto, it currently bails. The expected behaviour is to create a new repo (with Unknown Provider) in Sentry and upload the local git commit metadata.
  • Loading branch information
NisanthanNanthakumar authored Jul 23, 2020
1 parent bdc76fb commit efc7fea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
11 changes: 3 additions & 8 deletions src/commands/releases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,14 +470,9 @@ fn execute_set_commits<'a>(
let mut commit_specs = vec![];
let config = Config::current();

if repos.is_empty() {
bail!(
"No repositories are configured in Sentry for \
your organization."
);
}

let heads = if matches.is_present("auto") {
let heads = if repos.is_empty() {
None
} else if matches.is_present("auto") {
let commits = find_heads(None, &repos, Some(config.get_cached_vcs_remote()))?;
if commits.is_empty() {
None
Expand Down
4 changes: 2 additions & 2 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ impl Config {
fn find_global_config_file() -> Result<PathBuf, Error> {
dirs::home_dir()
.ok_or_else(|| err_msg("Could not find home dir"))
.and_then(|mut path| {
.map(|mut path| {
path.push(CONFIG_RC_FILE_NAME);
Ok(path)
path
})
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::config::Config;
#[cfg(not(windows))]
pub fn run_or_interrupt<F>(f: F)
where
F: FnOnce() -> () + Send + 'static,
F: FnOnce() + Send + 'static,
{
let (tx, rx) = crossbeam_channel::bounded(100);
let signals =
Expand Down

0 comments on commit efc7fea

Please # to comment.