zed/script/get-preview-channel-changes

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

150 lines
4.1 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env node --redirect-warnings=/dev/null
const { execFileSync } = require("child_process");
2024-08-09 00:00:10 +03:00
const { GITHUB_ACCESS_TOKEN } = process.env;
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
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);
// Maintain list manually, as our GitHub organization has community members in it.
const STAFF_MEMBERS = new Set([
"as-cii",
"bennetbo",
2024-08-09 00:00:10 +03:00
"conradirwin",
"danilo-leal",
"iamnbutler",
2024-08-09 00:00:10 +03:00
"josephtlyons",
"jvmncs",
"maxbrunsfeld",
"maxdeviant",
"mikayla-maki",
"nathansobo",
"notpeter",
"osiewicz",
"rgbkrk",
"rtfeldman",
2024-08-09 00:00:10 +03:00
"someonetoignore",
"thorstenball",
]);
main();
async function main() {
// Get the last two preview tags
const [newTag, oldTag] = execFileSync(
"git",
["tag", "--sort", "-committerdate"],
{ encoding: "utf8" },
)
.split("\n")
2023-05-22 06:38:01 +03:00
.filter((t) => t.startsWith("v") && t.endsWith("-pre"));
// Print the previous release
console.log(`Changes from ${oldTag} to ${newTag}\n`);
if (!GITHUB_ACCESS_TOKEN) {
try {
GITHUB_ACCESS_TOKEN = execFileSync("gh", ["auth", "token"]).toString();
} catch (error) {
console.log(error);
console.log("No GITHUB_ACCESS_TOKEN, and no `gh auth token`");
process.exit(1);
}
}
// Get the PRs merged between those two tags.
const pullRequestNumbers = getPullRequestNumbers(oldTag, newTag);
// Get the PRs that were cherry-picked between main and the old tag.
const existingPullRequestNumbers = new Set(
getPullRequestNumbers("main", oldTag),
);
2023-05-22 06:38:01 +03:00
// Filter out those existing PRs from the set of new PRs.
const newPullRequestNumbers = pullRequestNumbers.filter(
(number) => !existingPullRequestNumbers.has(number),
);
// Fetch the pull requests from the GitHub API.
console.log("Merged Pull requests:");
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
console.log(DIVIDER);
for (const pullRequestNumber of newPullRequestNumbers) {
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
const pullRequestApiURL = `${PULL_REQUEST_API_URL}/${pullRequestNumber}`;
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
const response = await fetch(pullRequestApiURL, {
headers: {
Authorization: `token ${GITHUB_ACCESS_TOKEN}`,
},
});
const pullRequest = await response.json();
const releaseNotesHeader = /^\s*Release Notes:(.+)/ims;
2024-08-09 00:00:10 +03:00
const releaseNotes = pullRequest.body || "";
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
let contributor =
pullRequest.user?.login ?? "Unable to identify contributor";
const captures = releaseNotesHeader.exec(releaseNotes);
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
let notes = captures ? captures[1] : "MISSING";
notes = notes.trim();
2024-08-09 00:00:10 +03:00
const isStaff = isStaffMember(contributor);
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
if (SKIPPABLE_NOTE_REGEX.exec(notes) != null) {
continue;
}
2023-05-22 06:38:01 +03:00
2024-08-09 00:00:10 +03:00
const credit = getCreditString(pullRequestNumber, contributor, isStaff);
contributor = isStaff ? `${contributor} (staff)` : contributor;
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
console.log(`PR Title: ${pullRequest.title}`);
console.log(`Contributor: ${contributor}`);
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
console.log(`Credit: (${credit})`);
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
console.log("Release Notes:");
console.log();
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
console.log(notes);
console.log(DIVIDER);
}
}
2024-08-09 00:00:10 +03:00
function getCreditString(pullRequestNumber, contributor, isStaff) {
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
let credit = "";
if (pullRequestNumber) {
2024-08-09 00:00:10 +03:00
const pullRequestMarkdownLink = `[#${pullRequestNumber}](${PULL_REQUEST_WEB_URL}/${pullRequestNumber})`;
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
credit += pullRequestMarkdownLink;
}
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
2024-08-09 00:00:10 +03:00
if (contributor && isStaff) {
Link to pull requests in changelog notes (#15996) This PR changes how we ask users to draft up PRs and how release note generation happens. We no longer force the user to create the markdown URL link, but we do ask them to use the `closes` [GitHub magic word](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) to link the PR to an issue, so that the issue is closed automatically when closing the PR. As for the changelog release notes, we are no longer linking to the issues, but the PR itself, which should contain the issue if a reader wants to dive further back. This makes our output more consistent, as every line will have a link, even if there is no issue associated, and it removes the need for us to try to parse the issue url in the body to try to correct mistakes in how they were forming Markdown urls - the PR url is always returned in the request, which makes it easy. **Lastly, it's just a lot less annoying to make the release notes.** The new PR format will be: ``` Closes #ISSUE Release Notes: - Added/Fixed/Improved ... ``` The new script output format will be: ``` PR Title: theme: Use a non-transparent color for the fallback `title_bar.inactive_background` Credit: ([#15709](https://github.com/zed-industries/zed/pull/15709); thanks [maxdeviant](https://github.com/maxdeviant)) Release Notes: - linux: Changed the fallback color of `title_bar.inactive_background` to a non-transparent value. -------------------------------------------------------------------------------- PR Title: Skip over folded regions when iterating over multibuffer chunks Credit: ([#15646](https://github.com/zed-industries/zed/pull/15646); thanks [osiewicz](https://github.com/osiewicz)) Release Notes: - Fixed poor performance when editing in the assistant panel after inserting large files using slash commands -------------------------------------------------------------------------------- ``` This still requires us to manually apply the credit line, but the line is already fully formed, so this should still be faster than having to manually create that line / fix any line where someone messed it up (which was all the time). I would just automatically apply it to the release notes, but sometimes we have multiple bullet points in a single PR and no real structure is enforced, so I foresee doing anything automatic breaking and needing manual adjustment. Release Notes: - N/A
2024-08-08 22:26:17 +03:00
const contributorMarkdownLink = `[${contributor}](${GITHUB_URL}/${contributor})`;
credit += `; thanks ${contributorMarkdownLink}`;
}
return credit;
}
2023-05-22 06:38:01 +03:00
function getPullRequestNumbers(oldTag, newTag) {
const pullRequestNumbers = execFileSync(
"git",
["log", `${oldTag}..${newTag}`, "--oneline"],
{ encoding: "utf8" },
2023-05-22 06:38:01 +03:00
)
.split("\n")
.filter((line) => line.length > 0)
.map((line) => {
2023-05-22 06:38:01 +03:00
const match = line.match(/#(\d+)/);
return match ? match[1] : null;
})
.filter((line) => line);
2023-05-22 06:38:01 +03:00
return pullRequestNumbers;
2023-05-22 06:38:01 +03:00
}
2024-08-09 00:00:10 +03:00
function isStaffMember(githubHandle) {
githubHandle = githubHandle.toLowerCase();
return STAFF_MEMBERS.has(githubHandle);
}