Skip to content

Commit 679ed7a

Browse files
authored
[Internal] Migrate workflows that need write access to use hosted runners (#1512)
This fixes an issue with newly configured IP access lists. Beware: the workflow in `push.yml` still runs on `macos-latest` and is the only workflow I didn't update. Note: the YAML files were formatted differently from the other repositories; please review with "hide whitespace". A potential follow-up is to configure and run Prettier on `.github` everywhere.
1 parent cc095b3 commit 679ed7a

15 files changed

+517
-472
lines changed

.github/.prettierrc.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Local configuration for Prettier.
2+
# This applies exclusively to the files in the ".github" directory.
3+
#
4+
# We like to keep the formatting of these files consistent
5+
# across repositories to keep diffs small and copy-paste friendly.
6+
#
7+
tabWidth: 2
8+
useTabs: false

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ name: Bug report
33
about: Create a report to help us improve
44
title: "[BUG]"
55
labels: bug
6-
assignees: ''
7-
6+
assignees: ""
87
---
98

109
**Describe the bug**
1110
A clear and concise description of what the bug is.
1211

1312
**To Reproduce**
1413
Steps to reproduce the behavior:
14+
1515
1. Go to '...'
1616
2. Click on '....'
1717
3. Scroll down to '....'

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Changes
2+
23
<!-- Summary of your changes that are easy to understand -->
34

45
## Tests
5-
<!-- How is this tested? -->
66

7+
<!-- How is this tested? -->

.github/dependabot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ updates:
55
schedule:
66
interval: "daily"
77
ignore:
8-
- dependency-name: "@databricks/*"
8+
- dependency-name: "@databricks/*"
99
- package-ecosystem: "npm"
1010
directory: "/packages/databricks-vscode"
1111
schedule:
1212
interval: "daily"
1313
ignore:
14-
- dependency-name: "@databricks/*"
14+
- dependency-name: "@databricks/*"
1515
- package-ecosystem: "npm"
1616
directory: "/packages/databricks-vscode-types"
1717
ignore:
18-
- dependency-name: "@databricks/*"
18+
- dependency-name: "@databricks/*"
1919
schedule:
2020
interval: "daily"
Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
11
name: Create Build Artefacts
22

33
on:
4-
workflow_call:
4+
workflow_call:
55

66
jobs:
7-
create-build-artifacts:
8-
runs-on: ubuntu-latest
9-
defaults:
10-
run:
11-
shell: bash
7+
create-build-artifacts:
8+
runs-on:
9+
group: databricks-deco-testing-runner-group
10+
labels: ubuntu-latest-deco
1211

13-
steps:
14-
- uses: actions/checkout@v3
12+
defaults:
13+
run:
14+
shell: bash
1515

16-
- name: Use Node.js 18
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: 18
20-
cache: "yarn"
16+
steps:
17+
- uses: actions/checkout@v3
2118

22-
- run: yarn install
23-
- run: yarn run build
24-
- run: yarn run package:all
25-
working-directory: packages/databricks-vscode
26-
env:
27-
GH_TOKEN: ${{ github.token }}
28-
BUILD_PLATFORM_ARCH: linux_amd64
19+
- name: Use Node.js 18
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 18
23+
cache: "yarn"
2924

30-
- uses: actions/upload-artifact@v3
31-
with:
32-
name: databricks
33-
path: "packages/databricks-vscode/*.vsix"
25+
- run: yarn install
26+
- run: yarn run build
27+
- run: yarn run package:all
28+
working-directory: packages/databricks-vscode
29+
env:
30+
GH_TOKEN: ${{ github.token }}
31+
BUILD_PLATFORM_ARCH: linux_amd64
32+
33+
- uses: actions/upload-artifact@v3
34+
with:
35+
name: databricks
36+
path: "packages/databricks-vscode/*.vsix"
Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
name: Create Draft Release
22

33
on:
4-
push:
5-
branches: ["main"]
4+
push:
5+
branches: ["main"]
66

7-
workflow_dispatch:
7+
workflow_dispatch:
88

99
jobs:
10-
create-build-artifacts:
11-
if: startsWith(github.event.head_commit.message, 'Release:') || github.event_name == 'workflow_dispatch'
12-
uses: ./.github/workflows/create-build-artifacts.yml
13-
secrets: inherit
14-
15-
create-release:
16-
if: startsWith(github.event.head_commit.message, 'Release:') || github.event_name == 'workflow_dispatch'
17-
needs: ["create-build-artifacts"]
18-
runs-on: macos-latest
19-
steps:
20-
- uses: actions/checkout@v3
21-
- uses: actions/download-artifact@v3
22-
id: download
23-
with:
24-
path: build
25-
26-
- run: ls -lr ${{ steps.download.outputs.download-path }}
27-
28-
- run: |
29-
TITLE=$(git show -s --format=%B HEAD | head -n1)
30-
CHANGELOG_FILE=packages/databricks-vscode/CHANGELOG.md
31-
RELEASE_VERSION=$(cat $CHANGELOG_FILE | grep -E "^# Release: v(([0-9]+\.){2}[0-9]+).*" | head -n1 | sed -nr 's/.*Release: v(([0-9]+\.){2}[0-9]+).*/\1/p')
32-
33-
tmpfile=$(mktemp /tmp/commit-message.XXXXX)
34-
cat $CHANGELOG_FILE | awk 'BEGIN{C=0} $0 ~ /^# Release: v.*/ && C==1{C=2} $0 ~ /^# Release: v'"$RELEASE_VERSION"'.*/{C=1} C==1 {print $0}' > $tmpfile
35-
cat $tmpfile >> $GITHUB_STEP_SUMMARY
36-
gh release create release-v$RELEASE_VERSION ${{ steps.download.outputs.download-path }}/databricks*/*.vsix \
37-
-d --target main -t "$TITLE" -F $tmpfile
38-
39-
env:
40-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10+
create-build-artifacts:
11+
if: startsWith(github.event.head_commit.message, 'Release:') || github.event_name == 'workflow_dispatch'
12+
uses: ./.github/workflows/create-build-artifacts.yml
13+
secrets: inherit
14+
15+
create-release:
16+
if: startsWith(github.event.head_commit.message, 'Release:') || github.event_name == 'workflow_dispatch'
17+
needs: ["create-build-artifacts"]
18+
19+
runs-on:
20+
group: databricks-deco-testing-runner-group
21+
labels: ubuntu-latest-deco
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: actions/download-artifact@v3
26+
id: download
27+
with:
28+
path: build
29+
30+
- run: ls -lr ${{ steps.download.outputs.download-path }}
31+
32+
- run: |
33+
TITLE=$(git show -s --format=%B HEAD | head -n1)
34+
CHANGELOG_FILE=packages/databricks-vscode/CHANGELOG.md
35+
RELEASE_VERSION=$(cat $CHANGELOG_FILE | grep -E "^# Release: v(([0-9]+\.){2}[0-9]+).*" | head -n1 | sed -nr 's/.*Release: v(([0-9]+\.){2}[0-9]+).*/\1/p')
36+
37+
tmpfile=$(mktemp /tmp/commit-message.XXXXX)
38+
cat $CHANGELOG_FILE | awk 'BEGIN{C=0} $0 ~ /^# Release: v.*/ && C==1{C=2} $0 ~ /^# Release: v'"$RELEASE_VERSION"'.*/{C=1} C==1 {print $0}' > $tmpfile
39+
cat $tmpfile >> $GITHUB_STEP_SUMMARY
40+
gh release create release-v$RELEASE_VERSION ${{ steps.download.outputs.download-path }}/databricks*/*.vsix \
41+
-d --target main -t "$TITLE" -F $tmpfile
42+
43+
env:
44+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/external-message.yml

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,54 @@ name: PR Comment
66
# DO NOT PULL THE PR OR EXECUTE ANY CODE FROM THE PR.
77

88
on:
9-
pull_request_target:
10-
types: [opened, reopened, synchronize]
11-
branches:
12-
- main
9+
pull_request_target:
10+
types: [opened, reopened, synchronize]
11+
branches:
12+
- main
1313

1414
jobs:
15-
comment-on-pr:
16-
runs-on: ubuntu-latest
17-
permissions:
18-
pull-requests: write
19-
20-
steps:
21-
- uses: actions/checkout@v4
22-
23-
- name: Delete old comments
24-
env:
25-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26-
run: |
27-
# Delete previous comment if it exists
28-
previous_comment_ids=$(gh api "repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" \
29-
--jq '.[] | select(.body | startswith("<!-- INTEGRATION_TESTS_MANUAL -->")) | .id')
30-
echo "Previous comment IDs: $previous_comment_ids"
31-
# Iterate over each comment ID and delete the comment
32-
if [ ! -z "$previous_comment_ids" ]; then
33-
echo "$previous_comment_ids" | while read -r comment_id; do
34-
echo "Deleting comment with ID: $comment_id"
35-
gh api "repos/${{ github.repository }}/issues/comments/$comment_id" -X DELETE
36-
done
37-
fi
38-
39-
- name: Comment on PR
40-
env:
41-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
43-
run: |
44-
gh pr comment ${{ github.event.pull_request.number }} --body \
45-
"<!-- INTEGRATION_TESTS_MANUAL -->
46-
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:
47-
48-
Trigger:
49-
[go/deco-tests-run/vscode](https://go/deco-tests-run/vscode)
50-
51-
Inputs:
52-
* PR number: ${{github.event.pull_request.number}}
53-
* Commit SHA: \`${{ env.COMMIT_SHA }}\`
54-
55-
Checks will be approved automatically on success.
56-
"
15+
comment-on-pr:
16+
runs-on:
17+
group: databricks-deco-testing-runner-group
18+
labels: ubuntu-latest-deco
19+
20+
permissions:
21+
pull-requests: write
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
26+
- name: Delete old comments
27+
env:
28+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
run: |
30+
# Delete previous comment if it exists
31+
previous_comment_ids=$(gh api "repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" \
32+
--jq '.[] | select(.body | startswith("<!-- INTEGRATION_TESTS_MANUAL -->")) | .id')
33+
echo "Previous comment IDs: $previous_comment_ids"
34+
# Iterate over each comment ID and delete the comment
35+
if [ ! -z "$previous_comment_ids" ]; then
36+
echo "$previous_comment_ids" | while read -r comment_id; do
37+
echo "Deleting comment with ID: $comment_id"
38+
gh api "repos/${{ github.repository }}/issues/comments/$comment_id" -X DELETE
39+
done
40+
fi
41+
42+
- name: Comment on PR
43+
env:
44+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
46+
run: |
47+
gh pr comment ${{ github.event.pull_request.number }} --body \
48+
"<!-- INTEGRATION_TESTS_MANUAL -->
49+
If integration tests don't run automatically, an authorized user can run them manually by following the instructions below:
50+
51+
Trigger:
52+
[go/deco-tests-run/vscode](https://go/deco-tests-run/vscode)
53+
54+
Inputs:
55+
* PR number: ${{github.event.pull_request.number}}
56+
* Commit SHA: \`${{ env.COMMIT_SHA }}\`
57+
58+
Checks will be approved automatically on success.
59+
"

0 commit comments

Comments
 (0)