Skip to content

Commit

Permalink
Using version of sentry with crontab validator
Browse files Browse the repository at this point in the history
  • Loading branch information
szokeasaurusrex committed Nov 9, 2023
1 parent 0c8636f commit 0b555af
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 27 deletions.
32 changes: 13 additions & 19 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ regex = "1.7.1"
runas = "1.0.0"
rust-ini = "0.18.0"
semver = "1.0.16"
sentry = { version = "0.31.2", default-features = false, features = [
# TODO: Revert back to crates.io version prior to merge
sentry = {git = "https://github.com/getsentry/sentry-rust.git", rev = "refs/pull/625/head", default-features = false, features = [
"anyhow",
"curl",
"contexts",
Expand Down
12 changes: 5 additions & 7 deletions src/commands/monitors/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,16 @@ fn token_execute(
(success, code, None)
}

fn parse_monitor_config_args(matches: &ArgMatches) -> Option<MonitorConfig> {
match matches.get_one::<String>("schedule") {
fn parse_monitor_config_args(matches: &ArgMatches) -> Result<Option<MonitorConfig>> {
Ok(match matches.get_one::<String>("schedule") {
Some(schedule) => Some(MonitorConfig {
schedule: MonitorSchedule::Crontab {
value: String::from(schedule),
},
schedule: MonitorSchedule::from_crontab(&schedule)?,

Check failure on line 203 in src/commands/monitors/run.rs

View workflow job for this annotation

GitHub Actions / Lint

this expression creates a reference which is immediately dereferenced by the compiler
checkin_margin: matches.get_one("checkin_margin").copied(),
max_runtime: matches.get_one("max_runtime").copied(),
timezone: matches.get_one("timezone").cloned(),
}),
None => None,
}
})
}

pub fn execute(matches: &ArgMatches) -> Result<()> {
Expand All @@ -225,7 +223,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
let args: Vec<_> = matches.get_many::<String>("args").unwrap().collect();
let monitor_slug = matches.get_one::<String>("monitor_slug").unwrap();
let environment = matches.get_one::<String>("environment").unwrap();
let monitor_config = parse_monitor_config_args(&matches);
let monitor_config = parse_monitor_config_args(&matches)?;

Check failure on line 226 in src/commands/monitors/run.rs

View workflow job for this annotation

GitHub Actions / Lint

this expression creates a reference which is immediately dereferenced by the compiler

let (success, code) = match dsn {
// Use envelope API when dsn is provided. This is the prefered way to create check-ins,
Expand Down

0 comments on commit 0b555af

Please sign in to comment.