Skip to content

Commit 0a15283

Browse files
Merge branch 'master' into SNOW-1926861-run-lob-tests-with-128-mb-limit
2 parents 94a3e49 + 12acdf6 commit 0a15283

File tree

8 files changed

+590
-76
lines changed

8 files changed

+590
-76
lines changed

.github/ISSUE_TEMPLATE/BUG_REPORT.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@ labels: bug
55
---
66

77

8-
<!--
9-
If you need urgent assistance then file the issue using the support process:
10-
https://community.snowflake.com/s/article/How-To-Submit-a-Support-Case-in-Snowflake-Lodge
11-
otherwise continue here.
12-
-->
8+
:exclamation: If you need **urgent assistance** then [file a case with Snowflake Support](https://community.snowflake.com/s/article/How-To-Submit-a-Support-Case-in-Snowflake-Lodge).
9+
Otherwise continue here.
1310

1411
Please answer these questions before submitting your issue.
1512
In order to accurately debug the issue this information is required. Thanks!

.github/workflows/jira_close.yml

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,40 @@ jobs:
88
close-issue:
99
runs-on: ubuntu-latest
1010
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v4
13-
with:
14-
repository: snowflakedb/gh-actions
15-
ref: jira_v1
16-
token: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} # stored in GitHub secrets
17-
path: .
18-
- name: Jira login
19-
uses: atlassian/gajira-login@master
20-
env:
21-
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
22-
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
23-
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
2411
- name: Extract issue from title
2512
id: extract
2613
env:
27-
TITLE: "${{ github.event.issue.title }}"
14+
TITLE: '${{ github.event.issue.title }}'
2815
run: |
2916
jira=$(echo -n $TITLE | awk '{print $1}' | sed -e 's/://')
3017
echo ::set-output name=jira::$jira
31-
- name: Close issue
32-
uses: ./jira/gajira-close
18+
19+
- name: Close Jira Issue
3320
if: startsWith(steps.extract.outputs.jira, 'SNOW-')
34-
with:
35-
issue: "${{ steps.extract.outputs.jira }}"
21+
env:
22+
ISSUE_KEY: ${{ steps.extract.outputs.jira }}
23+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
24+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
25+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
26+
run: |
27+
JIRA_API_URL="${JIRA_BASE_URL}/rest/api/2/issue/${ISSUE_KEY}/transitions"
28+
29+
curl -X POST \
30+
--url "$JIRA_API_URL" \
31+
--user "${JIRA_USER_EMAIL}:${JIRA_API_TOKEN}" \
32+
--header "Content-Type: application/json" \
33+
--data "{
34+
\"update\": {
35+
\"comment\": [
36+
{ \"add\": { \"body\": \"Closed on GitHub\" } }
37+
]
38+
},
39+
\"fields\": {
40+
\"customfield_12860\": { \"id\": \"11506\" },
41+
\"customfield_10800\": { \"id\": \"-1\" },
42+
\"customfield_12500\": { \"id\": \"11302\" },
43+
\"customfield_12400\": { \"id\": \"-1\" },
44+
\"resolution\": { \"name\": \"Done\" }
45+
},
46+
\"transition\": { \"id\": \"71\" }
47+
}"

.github/workflows/jira_issue.yml

Lines changed: 80 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,92 @@ jobs:
1313
issues: write
1414
if: ((github.event_name == 'issue_comment' && github.event.comment.body == 'recreate jira' && github.event.comment.user.login == 'sfc-gh-mkeller') || (github.event_name == 'issues' && github.event.pull_request.user.login != 'whitesource-for-github-com[bot]'))
1515
steps:
16-
- name: Checkout
17-
uses: actions/checkout@v4
18-
with:
19-
repository: snowflakedb/gh-actions
20-
ref: jira_v1
21-
token: ${{ secrets.SNOWFLAKE_GITHUB_TOKEN }} # stored in GitHub secrets
22-
path: .
23-
24-
- name: Login
25-
uses: atlassian/[email protected]
16+
- name: Create JIRA Ticket
17+
id: create
2618
env:
2719
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
2820
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
2921
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
22+
ISSUE_TITLE: ${{ github.event.issue.title }}
23+
ISSUE_BODY: ${{ github.event.issue.body }}
24+
ISSUE_URL: ${{ github.event.issue.html_url }}
25+
run: |
26+
# debug
27+
#set -x
28+
TMP_BODY=$(mktemp)
29+
trap "rm -f $TMP_BODY" EXIT
3030
31-
- name: Create JIRA Ticket
32-
id: create
33-
uses: atlassian/[email protected]
34-
with:
35-
project: SNOW
36-
issuetype: Bug
37-
summary: '${{ github.event.issue.title }}'
38-
description: |
39-
${{ github.event.issue.body }} \\ \\ _Created from GitHub Action_ for ${{ github.event.issue.html_url }}
40-
fields: '{ "customfield_11401": {"id": "14723"}, "assignee": {"id": "712020:e527ae71-55cc-4e02-9217-1ca4ca8028a2"}, "components":[{"id":"19292"}], "labels": ["oss"], "priority": {"id": "10001"} }'
31+
# Escape special characters in title and body
32+
TITLE=$(echo "${ISSUE_TITLE//`/\\`}" | sed 's/"/\\"/g' | sed "s/'/\\\'/g")
33+
echo "${ISSUE_BODY//`/\\`}" | sed 's/"/\\"/g' | sed "s/'/\\\'/g" > $TMP_BODY
34+
echo -e "\n\n_Created from GitHub Action_ for $ISSUE_URL" >> $TMP_BODY
35+
BODY=$(cat "$TMP_BODY")
36+
37+
PAYLOAD=$(jq -n \
38+
--arg issuetitle "$TITLE" \
39+
--arg issuebody "$BODY" \
40+
'{
41+
fields: {
42+
project: { key: "SNOW" },
43+
issuetype: { name: "Bug" },
44+
summary: $issuetitle,
45+
description: $issuebody,
46+
customfield_11401: { id: "14723" },
47+
assignee: { id: "712020:e527ae71-55cc-4e02-9217-1ca4ca8028a2" },
48+
components: [{ id: "19292" }],
49+
labels: ["oss"],
50+
priority: { id: "10001" }
51+
}
52+
}')
53+
54+
# Create JIRA issue using REST API
55+
RESPONSE=$(curl -s -X POST \
56+
-H "Content-Type: application/json" \
57+
-H "Accept: application/json" \
58+
-u "$JIRA_USER_EMAIL:$JIRA_API_TOKEN" \
59+
"$JIRA_BASE_URL/rest/api/2/issue" \
60+
-d "$PAYLOAD")
61+
62+
# Extract JIRA issue key from response
63+
JIRA_KEY=$(echo "$RESPONSE" | jq -r '.key')
64+
65+
if [ "$JIRA_KEY" = "null" ] || [ -z "$JIRA_KEY" ]; then
66+
echo "Failed to create JIRA issue"
67+
echo "Response: $RESPONSE"
68+
echo "Request payload: $PAYLOAD"
69+
exit 1
70+
fi
71+
72+
echo "Created JIRA issue: $JIRA_KEY"
73+
echo "jira_key=$JIRA_KEY" >> $GITHUB_OUTPUT
4174
4275
- name: Update GitHub Issue
43-
uses: ./jira/gajira-issue-update
4476
env:
4577
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
with:
47-
issue_number: "{{ event.issue.id }}"
48-
owner: "{{ event.repository.owner.login }}"
49-
name: "{{ event.repository.name }}"
50-
jira: "${{ steps.create.outputs.issue }}"
78+
REPOSITORY: ${{ github.repository }}
79+
ISSUE_NUMBER: ${{ github.event.issue.number }}
80+
JIRA_KEY: ${{ steps.create.outputs.jira_key }}
81+
ISSUE_TITLE: ${{ github.event.issue.title }}
82+
run: |
83+
TITLE=$(echo "${ISSUE_TITLE//`/\\`}" | sed 's/"/\\"/g' | sed "s/'/\\\'/g")
84+
PAYLOAD=$(jq -n \
85+
--arg issuetitle "$TITLE" \
86+
--arg jirakey "$JIRA_KEY" \
87+
'{
88+
title: ($jirakey + ": " + $issuetitle)
89+
}')
90+
91+
# Update Github issue title with jira id
92+
curl -s \
93+
-X PATCH \
94+
-H "Authorization: Bearer $GITHUB_TOKEN" \
95+
-H "Accept: application/vnd.github+json" \
96+
-H "X-GitHub-Api-Version: 2022-11-28" \
97+
"https://api.github.com/repos/$REPOSITORY/issues/$ISSUE_NUMBER" \
98+
-d "$PAYLOAD"
99+
100+
if [ "$?" != 0 ]; then
101+
echo "Failed to update GH issue. Payload was:"
102+
echo "$PAYLOAD"
103+
exit 1
104+
fi

cpp/AwsAttestation.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ namespace Snowflake {
2222
};
2323

2424
boost::optional<Attestation> createAwsAttestation(const AttestationConfig& config) {
25+
if (config.workloadIdentityImpersonationPath &&
26+
!config.workloadIdentityImpersonationPath.get().empty()) {
27+
CXX_LOG_ERROR("Workload identity impersonation is not supported for AWS");
28+
return boost::none;
29+
}
30+
2531
auto awsSdkInit = AwsUtils::initAwsSdk();
2632
auto creds = config.awsSdkWrapper->getCredentials();
2733
if (creds.IsEmpty()) {

cpp/AzureAttestation.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ namespace {
1313
namespace Snowflake {
1414
namespace Client {
1515
boost::optional<Attestation> createAzureAttestation(AttestationConfig& config) {
16+
if (config.workloadIdentityImpersonationPath &&
17+
!config.workloadIdentityImpersonationPath.get().empty()) {
18+
CXX_LOG_ERROR("Workload identity impersonation is not supported for Azure");
19+
return boost::none;
20+
}
21+
1622
auto azureConfigOpt = AzureAttestationConfig::fromConfig(config);
1723
if (!azureConfigOpt) {
1824
return boost::none;

0 commit comments

Comments
 (0)