Skip to content

fix: Explicitly deprecate --started flag #2515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2054,8 +2054,6 @@ pub struct UpdatedRelease {
pub projects: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
#[serde(rename = "dateStarted", skip_serializing_if = "Option::is_none")]
pub date_started: Option<DateTime<Utc>>,
#[serde(rename = "dateReleased", skip_serializing_if = "Option::is_none")]
pub date_released: Option<DateTime<Utc>>,
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down
11 changes: 9 additions & 2 deletions src/commands/releases/finalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ pub fn make_command(command: Command) -> Command {
.arg(
Arg::new("started")
.long("started")
.hide(true)
.value_parser(get_timestamp)
.value_name("TIMESTAMP")
.help("Set the release start date."),
.help("[DEPRECATED] This value is ignored."),
)
.arg(
Arg::new("released")
Expand All @@ -38,13 +39,19 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
let api = Api::current();
let version = matches.get_one::<String>("version").unwrap();

if matches.get_one::<DateTime<Utc>>("started").is_some() {
log::warn!(
"The --started flag is deprecated. Its value is ignored, \
and the argument will be completely removed in a future version."
);
}

api.authenticated()?.update_release(
&config.get_org(matches)?,
version,
&UpdatedRelease {
projects: config.get_projects(matches).ok(),
url: matches.get_one::<String>("url").cloned(),
date_started: matches.get_one::<DateTime<Utc>>("started").copied(),
date_released: Some(
matches
.get_one::<DateTime<Utc>>("released")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```
$ sentry-cli releases finalize wat-release --started 1431648100 --released 1431648000
$ sentry-cli releases finalize wat-release --released 1431648000
? success
Finalized release wat-release

Expand Down
1 change: 0 additions & 1 deletion tests/integration/releases/finalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ fn release_with_custom_dates() {
.with_response_file("releases/get-release.json")
.with_matcher(Matcher::PartialJson(json!({
"projects": ["wat-project"],
"dateStarted": "2015-05-15T00:01:40Z",
"dateReleased": "2015-05-15T00:00:00Z"
}))),
)
Expand Down