Skip to content

Commit

Permalink
Merge main to feature/egressExtension (#3668)
Browse files Browse the repository at this point in the history
  • Loading branch information
jander-msft authored Feb 14, 2023
2 parents 86e789a + 88145c0 commit 00a9ad7
Show file tree
Hide file tree
Showing 99 changed files with 984 additions and 338 deletions.
12 changes: 9 additions & 3 deletions .github/actions/generate-release-notes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ async function getPrsToMention(octokit, branch, repoOwner, repoName, minMergeDat
// Patch the origin PR information to have the backport PR number and URL
// so that the release notes links to the backport, but grabs the rest of
// the information from the origin PR.
originPr.originNumber = originPr.number;
originPr.number = pr.number;
originPr.html_url = pr.html_url;

Expand All @@ -99,6 +100,9 @@ async function getPrsToMention(octokit, branch, repoOwner, repoName, minMergeDat
commitHashesInRelease.add(commit.sha);
}

// Keep track of all of the prs we mention to avoid duplicates from resolved backports.
let mentionedOriginNumbers = new Set();

let prs = [];
for (const pr of candidatePrs) {
// Get a fully-qualified version of the pr that has all of the relevant information,
Expand All @@ -109,8 +113,10 @@ async function getPrsToMention(octokit, branch, repoOwner, repoName, minMergeDat
pull_number: pr.number
}))?.data;

if (commitHashesInRelease.has(fqPr.merge_commit_sha)) {
console.log(`Including: #${fqPr.number}`);
let originNumber = pr.originNumber ?? pr.number;
if (commitHashesInRelease.has(fqPr.merge_commit_sha) && !mentionedOriginNumbers.has(originNumber)) {
console.log(`Including: #${fqPr.number} -- origin:#${originNumber}`);
mentionedOriginNumbers.add(originNumber);
prs.push(pr);
} else {
console.log(`Skipping: #${fqPr.number} --- ${fqPr.merge_commit_sha}`);
Expand Down Expand Up @@ -143,7 +149,7 @@ async function generateChangelog(octokit, branch, repoOwner, repoName, minMergeD
entry += ` ${significantLabels[index].moniker}`;
}

const changelogRegex=/^###### Release Notes Entry\r?\n(?<releaseNotesEntry>.*)/m
const changelogRegex=/^###### Release Notes Entry\s+(?<releaseNotesEntry>.*)/m
const userDefinedChangelogEntry = pr.body?.match(changelogRegex)?.groups?.releaseNotesEntry?.trim();
if (userDefinedChangelogEntry !== undefined && userDefinedChangelogEntry.length !== 0) {
entry += ` ${userDefinedChangelogEntry}`
Expand Down
7 changes: 7 additions & 0 deletions .github/dependabot.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ updates:
interval: "daily"
target-branch: "main"
#@ for branch in ["main", "release/8.x", "release/7.x", "release/7.0", "release/6.x"]:
#@ commit_prefix = "[" + branch + "] "
- package-ecosystem: "nuget"
directory: "/eng/dependabot"
schedule:
Expand All @@ -18,11 +19,15 @@ updates:
ignore:
- dependency-name: "Microsoft.Extensions.*"
update-types: [ "version-update:semver-major" ]
commit-message:
prefix: #@ commit_prefix
- package-ecosystem: "nuget"
directory: "/eng/dependabot/nuget.org"
schedule:
interval: "daily"
target-branch: #@ branch
commit-message:
prefix: #@ commit_prefix
#@ for tfm in ["net7.0", "net6.0", "netcoreapp3.1"]:
- package-ecosystem: "nuget"
directory: #@ "/eng/dependabot/" + tfm
Expand All @@ -32,5 +37,7 @@ updates:
ignore:
- dependency-name: "*"
update-types: [ "version-update:semver-major" ]
commit-message:
prefix: #@ commit_prefix
#@ end
#@ end
50 changes: 50 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ updates:
- dependency-name: Microsoft.Extensions.*
update-types:
- version-update:semver-major
commit-message:
prefix: '[main] '
- package-ecosystem: nuget
directory: /eng/dependabot/nuget.org
schedule:
interval: daily
target-branch: main
commit-message:
prefix: '[main] '
- package-ecosystem: nuget
directory: /eng/dependabot/net7.0
schedule:
Expand All @@ -28,6 +32,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[main] '
- package-ecosystem: nuget
directory: /eng/dependabot/net6.0
schedule:
Expand All @@ -37,6 +43,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[main] '
- package-ecosystem: nuget
directory: /eng/dependabot/netcoreapp3.1
schedule:
Expand All @@ -46,6 +54,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[main] '
- package-ecosystem: nuget
directory: /eng/dependabot
schedule:
Expand All @@ -55,11 +65,15 @@ updates:
- dependency-name: Microsoft.Extensions.*
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/8.x] '
- package-ecosystem: nuget
directory: /eng/dependabot/nuget.org
schedule:
interval: daily
target-branch: release/8.x
commit-message:
prefix: '[release/8.x] '
- package-ecosystem: nuget
directory: /eng/dependabot/net7.0
schedule:
Expand All @@ -69,6 +83,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/8.x] '
- package-ecosystem: nuget
directory: /eng/dependabot/net6.0
schedule:
Expand All @@ -78,6 +94,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/8.x] '
- package-ecosystem: nuget
directory: /eng/dependabot/netcoreapp3.1
schedule:
Expand All @@ -87,6 +105,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/8.x] '
- package-ecosystem: nuget
directory: /eng/dependabot
schedule:
Expand All @@ -96,11 +116,15 @@ updates:
- dependency-name: Microsoft.Extensions.*
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/7.x] '
- package-ecosystem: nuget
directory: /eng/dependabot/nuget.org
schedule:
interval: daily
target-branch: release/7.x
commit-message:
prefix: '[release/7.x] '
- package-ecosystem: nuget
directory: /eng/dependabot/net7.0
schedule:
Expand All @@ -110,6 +134,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/7.x] '
- package-ecosystem: nuget
directory: /eng/dependabot/net6.0
schedule:
Expand All @@ -119,6 +145,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/7.x] '
- package-ecosystem: nuget
directory: /eng/dependabot/netcoreapp3.1
schedule:
Expand All @@ -128,6 +156,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/7.x] '
- package-ecosystem: nuget
directory: /eng/dependabot
schedule:
Expand All @@ -137,11 +167,15 @@ updates:
- dependency-name: Microsoft.Extensions.*
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/7.0] '
- package-ecosystem: nuget
directory: /eng/dependabot/nuget.org
schedule:
interval: daily
target-branch: release/7.0
commit-message:
prefix: '[release/7.0] '
- package-ecosystem: nuget
directory: /eng/dependabot/net7.0
schedule:
Expand All @@ -151,6 +185,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/7.0] '
- package-ecosystem: nuget
directory: /eng/dependabot/net6.0
schedule:
Expand All @@ -160,6 +196,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/7.0] '
- package-ecosystem: nuget
directory: /eng/dependabot/netcoreapp3.1
schedule:
Expand All @@ -169,6 +207,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/7.0] '
- package-ecosystem: nuget
directory: /eng/dependabot
schedule:
Expand All @@ -178,11 +218,15 @@ updates:
- dependency-name: Microsoft.Extensions.*
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/6.x] '
- package-ecosystem: nuget
directory: /eng/dependabot/nuget.org
schedule:
interval: daily
target-branch: release/6.x
commit-message:
prefix: '[release/6.x] '
- package-ecosystem: nuget
directory: /eng/dependabot/net7.0
schedule:
Expand All @@ -192,6 +236,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/6.x] '
- package-ecosystem: nuget
directory: /eng/dependabot/net6.0
schedule:
Expand All @@ -201,6 +247,8 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/6.x] '
- package-ecosystem: nuget
directory: /eng/dependabot/netcoreapp3.1
schedule:
Expand All @@ -210,3 +258,5 @@ updates:
- dependency-name: '*'
update-types:
- version-update:semver-major
commit-message:
prefix: '[release/6.x] '
27 changes: 27 additions & 0 deletions .github/workflows/scan-for-to-do-comments.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Scan For To Do Comments
on:
pull_request_review_comment:
types: [created]
issue_comment:
types: [created]

jobs:
scan-for-todo-issue:
runs-on: ubuntu-latest
if: startsWith(github.event.comment.body, '/TODO')
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Generate artifacts
run: |
trimmed_comment=$(echo "${{ github.event.comment.body }}" | sed 's|/TODO ||I')
mkdir -p ./issue
echo -n $trimmed_comment > ./issue/issue-title
echo -n "${{ github.event.comment.html_url }}" > ./issue/issue-url
echo -n "${{ github.event.comment.user.login }}" > ./issue/issue-user
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: issue-todo
path: issue/
45 changes: 45 additions & 0 deletions .github/workflows/submit-to-do-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: 'Submit To Do Issue'

on:
workflow_run:
workflows: ["Scan For To Do Comments"]
types:
- completed

permissions:
issues: write

jobs:
submit-todo-issue:
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion == 'success'
steps:
- uses: actions/[email protected]
id: check-user
with:
script: |
await github.rest.repos.checkCollaborator({
owner: context.repo.owner,
repo: context.repo.repo,
username: context.payload.workflow_run.triggering_actor.login
});
- name: Checkout
uses: actions/checkout@v3
# Download the artifact from the workflow that kicked off this one.
# The default artifact download action doesn't support cross-workflow
# artifacts, so use a 3rd party one.
- name: 'Download linting results'
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{env.workflow_name}}
run_id: ${{github.event.workflow_run.id }}
name: issue-todo
path: ./issue-todo
- name: Submit Issue
run: |
title=$(cat ./issue-todo/issue-title)
user=$(cat ./issue-todo/issue-user)
url=$(cat ./issue-todo/issue-url)
gh issue create --label "todo" --assignee "$user" --title "$title" --body "$url"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/track-shipping-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Track shipped versions
on:
release:
types: [released]

permissions:
contents: write

env:
shipping_branch_prefix: 'shipped'

jobs:
update-shipping-branch:
if: github.repository == 'dotnet/dotnet-monitor'
name: '[${{ github.ref_name }}] Update shipping branch'
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Update shipping branch
run: |
release_version=${GITHUB_REF_NAME%-*}
if [[ ! "$release_version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Unexpected release tag: $release_version."
exit 1
fi
major_minor_version=${release_version%.*}
shipping_branch_name="${{ env.shipping_branch_prefix }}/$major_minor_version"
# This is a shallow clone so we will always create a new local branch even if it already exists on the remote
git checkout -b "$shipping_branch_name"
git push --force --set-upstream origin "HEAD:$shipping_branch_name"
Loading

0 comments on commit 00a9ad7

Please sign in to comment.