Skip to content

Commit ebd9eda

Browse files
fix: Explicitly deprecate --started flag
The Sentry server [already ignores the value passed as `--started`](https://github.com/getsentry/sentry/blob/993bddbb73d9091fb949ad34578c7b28e0e3b8ab/src/sentry/api/endpoints/organization_release_details.py#L415-L534) to the `releases finalize` command. So, the option does not work as expected. Here, we explicitly mark the parameter as deprecated by logging a warning message stating that the value is ignored. We also stop sending the started date to the server. Fixes #2481
1 parent 556a2a2 commit ebd9eda

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/api/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,8 +2054,6 @@ pub struct UpdatedRelease {
20542054
pub projects: Option<Vec<String>>,
20552055
#[serde(skip_serializing_if = "Option::is_none")]
20562056
pub url: Option<String>,
2057-
#[serde(rename = "dateStarted", skip_serializing_if = "Option::is_none")]
2058-
pub date_started: Option<DateTime<Utc>>,
20592057
#[serde(rename = "dateReleased", skip_serializing_if = "Option::is_none")]
20602058
pub date_released: Option<DateTime<Utc>>,
20612059
#[serde(skip_serializing_if = "Option::is_none")]

src/commands/releases/finalize.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ pub fn make_command(command: Command) -> Command {
2020
.arg(
2121
Arg::new("started")
2222
.long("started")
23+
.hide(true)
2324
.value_parser(get_timestamp)
2425
.value_name("TIMESTAMP")
25-
.help("Set the release start date."),
26+
.help("[DEPRECATED] This value is ignored."),
2627
)
2728
.arg(
2829
Arg::new("released")
@@ -38,13 +39,19 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
3839
let api = Api::current();
3940
let version = matches.get_one::<String>("version").unwrap();
4041

42+
if matches.get_one::<DateTime<Utc>>("started").is_some() {
43+
log::warn!(
44+
"The --started flag is deprecated. Its value is ignored, \
45+
and the argument will be completely removed in a future version."
46+
);
47+
}
48+
4149
api.authenticated()?.update_release(
4250
&config.get_org(matches)?,
4351
version,
4452
&UpdatedRelease {
4553
projects: config.get_projects(matches).ok(),
4654
url: matches.get_one::<String>("url").cloned(),
47-
date_started: matches.get_one::<DateTime<Utc>>("started").copied(),
4855
date_released: Some(
4956
matches
5057
.get_one::<DateTime<Utc>>("released")

tests/integration/_cases/releases/releases-finalize-dates.trycmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
```
2-
$ sentry-cli releases finalize wat-release --started 1431648100 --released 1431648000
2+
$ sentry-cli releases finalize wat-release --released 1431648000
33
? success
44
Finalized release wat-release
55

0 commit comments

Comments
 (0)