You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3afd80e
Browse filesBrowse the repository at this point in the historyBrowse files
/// Print the release description instead of creating the GitHub release
41
+
#[arg(long)]
42
+
dry_run:bool,
43
+
}
10
44
11
45
implCli{
12
46
pubfnexec(self) -> Result<()>{
47
+
let version = cargo::get_version()?;
48
+
let parsed_version = Version::parse(&version)
49
+
.with_context(|| format!("Invalid release version {version:?}"))?;
50
+
let notes = release_notes(&paths::find_repo_root()?,&parsed_version)?;
51
+
52
+
ifself.dry_run{
53
+
println!("{notes}");
54
+
returnOk(());
55
+
}
56
+
13
57
let artifacts = glob("target/artifacts/*")
14
58
.expect("failed to read glob pattern")
15
59
.collect::<Result<Vec<_>,_>>()
@@ -19,7 +63,6 @@ impl Cli {
19
63
.collect::<Result<Vec<_>,_>>()
20
64
.map_err(|e| anyhow!("failed to turn path into string: {}", e.to_string_lossy()))?;
21
65
22
-
let version = cargo::get_version()?;
23
66
letmut command = Command::new("gh");
24
67
command.in_repo();
25
68
command.args(
@@ -32,9 +75,7 @@ impl Cli {
32
75
"--title",
33
76
&format!("v{version}"),
34
77
"--notes",
35
-
&format!(
36
-
"The [COSE team](https://opensource.datadoghq.com/about/#the-community-open-source-engineering-team) is excited to announce version `{version}`! 🚀\n\n[View release notes](https://vector.dev/releases/{version})"
37
-
),
78
+
¬es,
38
79
]
39
80
.map(String::from)
40
81
.into_iter()
@@ -44,3 +85,201 @@ impl Cli {
44
85
Ok(())
45
86
}
46
87
}
88
+
89
+
#[derive(Debug,Deserialize)]
90
+
structChangelogEntry{
91
+
#[serde(rename = "type")]
92
+
kind:String,
93
+
#[serde(default)]
94
+
breaking:bool,
95
+
#[serde(default)]
96
+
contributors:Vec<String>,
97
+
}
98
+
99
+
/// Build the GitHub release description from the release CUE file and the upgrade guide.
"The [COSE team](https://opensource.datadoghq.com/about/#the-community-open-source-engineering-team) is happy to announce Vector `{version}`! 🚀 Vector is a lightweight, ultra-fast tool for building observability pipelines that puts you in control of your data.\n\n"
152
+
);
153
+
154
+
if !changelog.is_empty(){
155
+
let total = changelog.len();
156
+
let contributors = changelog
157
+
.iter()
158
+
.flat_map(|entry| &entry.contributors)
159
+
.collect::<BTreeSet<_>>()
160
+
.len();
161
+
match contributors {
162
+
0 => {
163
+
let noun = if total == 1{"change"}else{"changes"};
164
+
write!(out,"This release includes {total} {noun}:").unwrap();
165
+
}
166
+
1 => out.push_str("Thanks to the contributor who made "),
167
+
_ => write!(out,"Thanks to the {contributors} contributors who made ").unwrap(),
168
+
}
169
+
if contributors > 0{
170
+
if total == 1{
171
+
out.push_str("the change");
172
+
}else{
173
+
write!(out,"the {total} changes").unwrap();
174
+
}
175
+
out.push_str(" in this release!");
176
+
}
177
+
out.push_str("\n\n");
178
+
179
+
let breaking = changelog.iter().filter(|entry| entry.breaking).count();
180
+
if breaking > 0{
181
+
let noun = if breaking == 1{
182
+
"breaking change"
183
+
}else{
184
+
"breaking changes"
185
+
};
186
+
// The release page renders its breaking-changes section only when the release
The [COSE team](https://opensource.datadoghq.com/about/#the-community-open-source-engineering-team) is happy to announce Vector `0.59.0`! 🚀 Vector is a lightweight, ultra-fast tool for building observability pipelines that puts you in control of your data.
254
+
255
+
Thanks to the 3 contributors who made the 4 changes in this release!
let changelog = [entry("chore",true,&[]),entry("fix",false,&[])];
270
+
let notes = render_notes(&Version::new(0,59,1),&changelog,None);
271
+
272
+
assert_eq!(
273
+
notes,
274
+
indoc::indoc! {"
275
+
The [COSE team](https://opensource.datadoghq.com/about/#the-community-open-source-engineering-team) is happy to announce Vector `0.59.1`! 🚀 Vector is a lightweight, ultra-fast tool for building observability pipelines that puts you in control of your data.
0 commit comments