Compare commits
14 Commits
fix_devcon
...
v0.148.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
623a463777 | ||
|
|
afb3fbff24 | ||
|
|
47c9b1ef70 | ||
|
|
ccd8a9af89 | ||
|
|
1dfc2fe1fa | ||
|
|
fb449399fc | ||
|
|
5ec8cdcb3c | ||
|
|
371b828d28 | ||
|
|
fdb5c7fbd3 | ||
|
|
84d68660a3 | ||
|
|
7e44cd04aa | ||
|
|
7b8a87b61c | ||
|
|
79e5ea7210 | ||
|
|
822a4ccb6b |
6
.github/pull_request_template.md
vendored
6
.github/pull_request_template.md
vendored
@@ -1,13 +1,15 @@
|
||||
|
||||
Closes #ISSUE
|
||||
|
||||
Release Notes:
|
||||
|
||||
- Added/Fixed/Improved ... ([#NNNNN](https://github.com/zed-industries/zed/issues/NNNNN)).
|
||||
- Added/Fixed/Improved ...
|
||||
|
||||
Optionally, include screenshots / media showcasing your addition that can be included in the release notes.
|
||||
|
||||
### Or...
|
||||
|
||||
Closes #ISSUE
|
||||
|
||||
Release Notes:
|
||||
|
||||
- N/A
|
||||
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -13775,7 +13775,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zed"
|
||||
version = "0.148.0"
|
||||
version = "0.148.1"
|
||||
dependencies = [
|
||||
"activity_indicator",
|
||||
"anyhow",
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#![cfg_attr(target_os = "windows", allow(unused, dead_code))]
|
||||
|
||||
pub mod assistant_panel;
|
||||
pub mod assistant_settings;
|
||||
mod context;
|
||||
|
||||
@@ -3337,11 +3337,10 @@ impl Render for ConfigurationView {
|
||||
.map(|provider| self.render_provider_view(&provider, cx))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
v_flex()
|
||||
let mut element = v_flex()
|
||||
.id("assistant-configuration-view")
|
||||
.track_focus(&self.focus_handle)
|
||||
.w_full()
|
||||
.min_h_full()
|
||||
.size_full()
|
||||
.p(Spacing::XXLarge.rems(cx))
|
||||
.overflow_y_scroll()
|
||||
.gap_6()
|
||||
@@ -3359,8 +3358,23 @@ impl Render for ConfigurationView {
|
||||
)
|
||||
.color(Color::Muted),
|
||||
)
|
||||
.child(v_flex().mt_2().gap_4().children(provider_views)),
|
||||
.child(v_flex().flex_1().mt_2().gap_4().children(provider_views)),
|
||||
)
|
||||
.into_any();
|
||||
|
||||
// We use a canvas here to get scrolling to work in the ConfigurationView. It's a workaround
|
||||
// because we couldn't the element to take up the size of the parent.
|
||||
gpui::canvas(
|
||||
move |bounds, cx| {
|
||||
element.prepaint_as_root(bounds.origin, bounds.size.into(), cx);
|
||||
element
|
||||
},
|
||||
|_, mut element, cx| {
|
||||
element.paint(cx);
|
||||
},
|
||||
)
|
||||
.flex_1()
|
||||
.w_full()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
description = "The fast, collaborative code editor."
|
||||
edition = "2021"
|
||||
name = "zed"
|
||||
version = "0.148.0"
|
||||
version = "0.148.1"
|
||||
publish = false
|
||||
license = "GPL-3.0-or-later"
|
||||
authors = ["Zed Team <hi@zed.dev>"]
|
||||
|
||||
@@ -1 +1 @@
|
||||
dev
|
||||
stable
|
||||
@@ -9,8 +9,10 @@ prHygiene({
|
||||
});
|
||||
|
||||
const RELEASE_NOTES_PATTERN = new RegExp("Release Notes:\\r?\\n\\s+-", "gm");
|
||||
const body = danger.github.pr.body;
|
||||
|
||||
const hasReleaseNotes = RELEASE_NOTES_PATTERN.test(body);
|
||||
|
||||
const hasReleaseNotes = RELEASE_NOTES_PATTERN.test(danger.github.pr.body);
|
||||
if (!hasReleaseNotes) {
|
||||
warn(
|
||||
[
|
||||
@@ -21,7 +23,7 @@ if (!hasReleaseNotes) {
|
||||
"```",
|
||||
"Release Notes:",
|
||||
"",
|
||||
"- (Added|Fixed|Improved) ... ([#<public_issue_number_if_exists>](https://github.com/zed-industries/zed/issues/<public_issue_number_if_exists>)).",
|
||||
"- Added/Fixed/Improved ...",
|
||||
"```",
|
||||
"",
|
||||
'If your change is not user-facing, you can use "N/A" for the entry:',
|
||||
@@ -34,21 +36,28 @@ if (!hasReleaseNotes) {
|
||||
);
|
||||
}
|
||||
|
||||
const INCORRECT_ISSUE_LINK_PATTERN = new RegExp("-.*\\(#\\d+\\)", "g");
|
||||
|
||||
const hasIncorrectIssueLinks = INCORRECT_ISSUE_LINK_PATTERN.test(
|
||||
danger.github.pr.body,
|
||||
const ISSUE_LINK_PATTERN = new RegExp(
|
||||
"(?:https://github\\.com/[\\w-]+/[\\w-]+/issues/\\d+|#\\d+)",
|
||||
"g",
|
||||
);
|
||||
if (hasIncorrectIssueLinks) {
|
||||
|
||||
const includesIssueUrl = ISSUE_LINK_PATTERN.test(body);
|
||||
|
||||
if (includesIssueUrl) {
|
||||
const matches = body.match(ISSUE_LINK_PATTERN);
|
||||
const issues = matches
|
||||
.map((match) =>
|
||||
match
|
||||
.replace(/^#/, "")
|
||||
.replace(/https:\/\/github\.com\/zed-industries\/zed\/issues\//, ""),
|
||||
)
|
||||
.filter((issue, index, self) => self.indexOf(issue) === index);
|
||||
|
||||
warn(
|
||||
[
|
||||
"This PR has incorrectly formatted GitHub issue links in the release notes.",
|
||||
"",
|
||||
"GitHub issue links must be formatted as plain Markdown links:",
|
||||
"",
|
||||
"```",
|
||||
"- Improved something ([#ISSUE](https://github.com/zed-industries/zed/issues/ISSUE)).",
|
||||
"```",
|
||||
"This PR includes links to the following GitHub Issues: " +
|
||||
issues.map((issue) => `#${issue}`).join(", "),
|
||||
"If this PR aims to close an issue, please include a `Closes #ISSUE` line at the top of the PR body.",
|
||||
].join("\n"),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +1,38 @@
|
||||
#!/usr/bin/env node --redirect-warnings=/dev/null
|
||||
|
||||
const { execFileSync } = require("child_process");
|
||||
let { GITHUB_ACCESS_TOKEN } = process.env;
|
||||
const FIXES_REGEX = /(fixes|closes|completes) (.+[/#]\d+.*)$/im;
|
||||
const { GITHUB_ACCESS_TOKEN } = process.env;
|
||||
const GITHUB_URL = "https://github.com";
|
||||
const SKIPPABLE_NOTE_REGEX = /^\s*-?\s*n\/?a\s*/ims;
|
||||
const PULL_REQUEST_WEB_URL = "https://github.com/zed-industries/zed/pull";
|
||||
const PULL_REQUEST_API_URL =
|
||||
"https://api.github.com/repos/zed-industries/zed/pulls";
|
||||
const DIVIDER = "-".repeat(80);
|
||||
|
||||
main();
|
||||
|
||||
async function main() {
|
||||
const STAFF_MEMBERS = new Set(
|
||||
(
|
||||
await (
|
||||
await fetch(
|
||||
"https://api.github.com/orgs/zed-industries/teams/staff/members",
|
||||
{
|
||||
headers: {
|
||||
Authorization: `token ${GITHUB_ACCESS_TOKEN}`,
|
||||
Accept: "application/vnd.github+json",
|
||||
},
|
||||
},
|
||||
)
|
||||
).json()
|
||||
).map(({ login }) => login.toLowerCase()),
|
||||
);
|
||||
|
||||
const isStaffMember = (githubHandle) => {
|
||||
githubHandle = githubHandle.toLowerCase();
|
||||
return STAFF_MEMBERS.has(githubHandle);
|
||||
};
|
||||
|
||||
// Get the last two preview tags
|
||||
const [newTag, oldTag] = execFileSync(
|
||||
"git",
|
||||
@@ -44,51 +70,62 @@ async function main() {
|
||||
|
||||
// Fetch the pull requests from the GitHub API.
|
||||
console.log("Merged Pull requests:");
|
||||
console.log(DIVIDER);
|
||||
for (const pullRequestNumber of newPullRequestNumbers) {
|
||||
const webURL = `https://github.com/zed-industries/zed/pull/${pullRequestNumber}`;
|
||||
const apiURL = `https://api.github.com/repos/zed-industries/zed/pulls/${pullRequestNumber}`;
|
||||
const pullRequestApiURL = `${PULL_REQUEST_API_URL}/${pullRequestNumber}`;
|
||||
|
||||
const response = await fetch(apiURL, {
|
||||
const response = await fetch(pullRequestApiURL, {
|
||||
headers: {
|
||||
Authorization: `token ${GITHUB_ACCESS_TOKEN}`,
|
||||
},
|
||||
});
|
||||
|
||||
// Print the pull request title and URL.
|
||||
const pullRequest = await response.json();
|
||||
const releaseNotesHeader = /^\s*Release Notes:(.+)/ims;
|
||||
|
||||
let releaseNotes = pullRequest.body || "";
|
||||
let contributor = pullRequest.user?.login ?? "Unable to identify";
|
||||
const releaseNotes = pullRequest.body || "";
|
||||
let contributor =
|
||||
pullRequest.user?.login ?? "Unable to identify contributor";
|
||||
const captures = releaseNotesHeader.exec(releaseNotes);
|
||||
const notes = captures ? captures[1] : "MISSING";
|
||||
const skippableNoteRegex = /^\s*-?\s*n\/?a\s*/ims;
|
||||
let notes = captures ? captures[1] : "MISSING";
|
||||
notes = notes.trim();
|
||||
const isStaff = isStaffMember(contributor);
|
||||
|
||||
if (skippableNoteRegex.exec(notes) != null) {
|
||||
if (SKIPPABLE_NOTE_REGEX.exec(notes) != null) {
|
||||
continue;
|
||||
}
|
||||
console.log("*", pullRequest.title);
|
||||
console.log(" PR URL: ", webURL);
|
||||
console.log(" Author: ", contributor);
|
||||
|
||||
// If the pull request contains a 'closes' line, print the closed issue.
|
||||
const fixesMatch = (pullRequest.body || "").match(FIXES_REGEX);
|
||||
if (fixesMatch) {
|
||||
const fixedIssueURL = fixesMatch[2];
|
||||
console.log(" Issue URL: ", fixedIssueURL);
|
||||
}
|
||||
const credit = getCreditString(pullRequestNumber, contributor, isStaff);
|
||||
contributor = isStaff ? `${contributor} (staff)` : contributor;
|
||||
|
||||
releaseNotes = notes.trim().split("\n");
|
||||
console.log(" Release Notes:");
|
||||
|
||||
for (const line of releaseNotes) {
|
||||
console.log(` ${line}`);
|
||||
}
|
||||
console.log(`PR Title: ${pullRequest.title}`);
|
||||
console.log(`Contributor: ${contributor}`);
|
||||
console.log(`Credit: (${credit})`);
|
||||
|
||||
console.log("Release Notes:");
|
||||
console.log();
|
||||
console.log(notes);
|
||||
|
||||
console.log(DIVIDER);
|
||||
}
|
||||
}
|
||||
|
||||
function getCreditString(pullRequestNumber, contributor, isStaff) {
|
||||
let credit = "";
|
||||
|
||||
if (pullRequestNumber) {
|
||||
const pullRequestMarkdownLink = `[#${pullRequestNumber}](${PULL_REQUEST_WEB_URL}/${pullRequestNumber})`;
|
||||
credit += pullRequestMarkdownLink;
|
||||
}
|
||||
|
||||
if (contributor && !isStaff) {
|
||||
const contributorMarkdownLink = `[${contributor}](${GITHUB_URL}/${contributor})`;
|
||||
credit += `; thanks ${contributorMarkdownLink}`;
|
||||
}
|
||||
|
||||
return credit;
|
||||
}
|
||||
|
||||
function getPullRequestNumbers(oldTag, newTag) {
|
||||
const pullRequestNumbers = execFileSync(
|
||||
"git",
|
||||
|
||||
Reference in New Issue
Block a user