-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into alejandro.gonzalez/rasp-fli
- Loading branch information
Showing
129 changed files
with
3,750 additions
and
1,201 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Increment milestones on tag | ||
on: | ||
create | ||
permissions: | ||
issues: write # Required to update milestones | ||
|
||
jobs: | ||
increment_milestone: | ||
if: github.event.ref_type == 'tag' && contains(github.event.ref,'-RC') == false | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Close current milestone | ||
id: close-milestone | ||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # 7.0.1 | ||
with: | ||
script: | | ||
// Get the milestone title ("X.Y.Z") from tag name ("vX.Y.Z") | ||
const match = '${{github.event.ref}}'.match(/v(\d+\.\d+\.\d+)/i) | ||
if (!match) { | ||
core.setFailed('Failed to parse tag name into milestone title: ${{github.event.ref}}') | ||
return | ||
} | ||
const milestoneTitle = match[1] | ||
// Look for the milestone from its title | ||
const response = await github.rest.issues.listMilestones({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
state: 'open' | ||
}) | ||
if (!response.data || response.data.length == 0) { | ||
core.setFailed(`Failed to list milestones: ${response.status}`) | ||
return | ||
} | ||
const milestone = response.data.find(milestone => milestone.title == milestoneTitle) | ||
if (!milestone) { | ||
core.setFailed(`Failed to find milestone: ${milestoneTitle}`) | ||
return | ||
} | ||
// Close the milestone | ||
await github.rest.issues.updateMilestone({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
state: 'closed', | ||
milestone_number: milestone.number | ||
}).catch(error => { | ||
core.setFailed(`Failed to close milestone: ${error}`) | ||
}) | ||
// Compute the next milestone version | ||
const versionNumbers = milestoneTitle.split('.').map(Number) | ||
if (versionNumbers[2] != 0) { | ||
core.info('Closing a patch version milestone. Not opening a new one.') | ||
return | ||
} | ||
versionNumbers[1]++ | ||
const nextMilestoneTitle = versionNumbers.join('.') | ||
core.info(`Creating next version milestone: ${nextMilestoneTitle}`) | ||
// Create the next milestone | ||
await github.issues.createMilestone({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
title: nextMilestoneTitle | ||
}).catch(error => { | ||
core.setFailed(`Failed to create milestone ${nextMilestoneTitle}: ${error}`) | ||
}) |
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
.github/workflows/tests/add-milestone-to-pull-requests/payload-pull-request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"pull_request": { | ||
"number": 7549, | ||
"base": { | ||
"ref": "master" | ||
}, | ||
"merged": true | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
.github/workflows/tests/add-milestone-to-pull-requests/test-pull-request.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
source "$(dirname "$0")/../env.sh" | ||
testworkflow pull_request |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
function testworkflow() { | ||
local EVENT_TYPE=$1 | ||
# Get workflow name | ||
local TEST_PATH | ||
TEST_PATH=$(dirname "$(readlink -f "${BASH_SOURCE[1]}")") | ||
local WORKFLOW_NAME | ||
WORKFLOW_NAME=$(basename "$TEST_PATH") | ||
local WORKFLOW_FILE=.github/workflows/${WORKFLOW_NAME}.yaml | ||
local PAYLOAD_FILE=${TEST_PATH}/payload-${EVENT_TYPE//_/-}.json | ||
# Move to project root directory | ||
local FILE_PATH | ||
FILE_PATH=$(dirname "$0") | ||
cd "$FILE_PATH/../../../../" || exit 1 | ||
# Check if workflow file and payload file exist | ||
if [ ! -f "$WORKFLOW_FILE" ]; then | ||
echo "Workflow file not found: $WORKFLOW_FILE" | ||
exit 1 | ||
fi | ||
if [ ! -f "$PAYLOAD_FILE" ]; then | ||
echo "Payload file not found: $PAYLOAD_FILE" | ||
exit 1 | ||
fi | ||
# Run workflow using act | ||
act "${EVENT_TYPE}" \ | ||
--workflows "${WORKFLOW_FILE}" \ | ||
--eventpath "${PAYLOAD_FILE}" \ | ||
--container-architecture linux/amd64 \ | ||
--secret GITHUB_TOKEN="$(gh auth token)" \ | ||
--verbose | ||
} |
4 changes: 4 additions & 0 deletions
4
.github/workflows/tests/increment-milestone-on-tag/payload-create.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"ref_type": "tag", | ||
"ref": "v1.40.0" | ||
} |
3 changes: 3 additions & 0 deletions
3
.github/workflows/tests/increment-milestone-on-tag/test-create.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
source "$(dirname "$0")/../env.sh" | ||
testworkflow create |
6 changes: 6 additions & 0 deletions
6
.github/workflows/tests/update-issues-on-release/payload-release.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"release": { | ||
"name": "1.39.0", | ||
"html_url": "https://github.com/DataDog/dd-trace-java/releases/tag/v1.39.0" | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
.github/workflows/tests/update-issues-on-release/payload-workflow-dispatch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"inputs": { | ||
"milestone": "1.39.0" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
.github/workflows/tests/update-issues-on-release/test-release.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
source "$(dirname "$0")/../env.sh" | ||
testworkflow release |
3 changes: 3 additions & 0 deletions
3
.github/workflows/tests/update-issues-on-release/test-workflow-dispatch.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
source "$(dirname "$0")/../env.sh" | ||
testworkflow workflow_dispatch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.