Skip to content

Commit 6c4407c

Browse files
DX-114802: Support Jira tickets in PR titles
1 parent d983fbb commit 6c4407c

3 files changed

Lines changed: 76 additions & 30 deletions

File tree

.github/workflows/dev_pr.js

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,20 @@ module.exports = {
122122
const title = context.payload.pull_request.title;
123123
if (title.startsWith("MINOR: ")) {
124124
console.log("PR is a minor PR");
125-
return {"issue": null};
125+
return {"issue": null, "type": "minor"};
126126
}
127127

128-
const match = title.match(/^GH-([0-9]+): .*$/);
128+
const match = title.match(/^(GH|DX)-([0-9]+): .*$/);
129129
if (match === null) {
130-
core.setFailed("Invalid PR title format. Must either be MINOR: or GH-NNN:");
131-
return {"issue": null};
130+
core.setFailed("Invalid PR title format. Must either be MINOR:, GH-NNN:, or DX-NNN:");
131+
return {"issue": null, "type": null};
132132
}
133-
return {"issue": parseInt(match[1], 10)};
133+
134+
const issueType = match[1]; // "GH" or "DX"
135+
const issueNumber = parseInt(match[2], 10);
136+
137+
console.log(`PR references ${issueType}-${issueNumber}`);
138+
return {"issue": issueNumber, "type": issueType};
134139
},
135140

136141
apply_labels: async function({core, github, context}) {
@@ -203,9 +208,28 @@ See [CONTRIBUTING.md](https://github.com/apache/arrow-java/blob/main/CONTRIBUTIN
203208
console.log("This is a MINOR PR");
204209
return;
205210
}
206-
const expected = `https://github.com/apache/arrow-java/issues/${issue.issue}`;
207211

208-
const query = `
212+
// Handle Jira tickets (DX-NNN)
213+
if (issue.type === "DX") {
214+
const jiraUrl = `https://dremio.atlassian.net/browse/DX-${issue.issue}`;
215+
console.log(`This PR references Jira ticket: ${jiraUrl}`);
216+
217+
// Add a comment with the Jira link
218+
const comment_tag = "jira_link_comment";
219+
const maybe_comment_id = await have_comment(github, context, context.payload.pull_request.number, comment_tag);
220+
const body_text = `<!-- ${comment_tag} -->
221+
**Related Jira Ticket:** [DX-${issue.issue}](${jiraUrl})`;
222+
223+
await upsert_comment(github, maybe_comment_id, body_text, true);
224+
console.log("Added/updated Jira link comment");
225+
return;
226+
}
227+
228+
// Handle GitHub issues (GH-NNN)
229+
if (issue.type === "GH") {
230+
const expected = `https://github.com/apache/arrow-java/issues/${issue.issue}`;
231+
232+
const query = `
209233
query($owner: String!, $name: String!, $number: Int!) {
210234
repository(owner: $owner, name: $name) {
211235
pullRequest(number: $number) {
@@ -220,22 +244,23 @@ query($owner: String!, $name: String!, $number: Int!) {
220244
}
221245
}`;
222246

223-
const result = await github.graphql(query, {
224-
owner: context.repo.owner,
225-
name: context.repo.repo,
226-
number: context.payload.pull_request.number,
227-
});
228-
const issues = result.repository.pullRequest.closingIssuesReferences.edges;
229-
console.log(issues);
230-
231-
for (const link of issues) {
232-
console.log(`PR is linked to ${link.node.number}`);
233-
if (link.node.number === issue.issue) {
234-
console.log(`Found link to ${expected}`);
235-
return;
247+
const result = await github.graphql(query, {
248+
owner: context.repo.owner,
249+
name: context.repo.repo,
250+
number: context.payload.pull_request.number,
251+
});
252+
const issues = result.repository.pullRequest.closingIssuesReferences.edges;
253+
console.log(issues);
254+
255+
for (const link of issues) {
256+
console.log(`PR is linked to ${link.node.number}`);
257+
if (link.node.number === issue.issue) {
258+
console.log(`Found link to ${expected}`);
259+
return;
260+
}
236261
}
262+
console.log(`Did not find link to ${expected}`);
263+
core.setFailed("Missing link to issue in title");
237264
}
238-
console.log(`Did not find link to ${expected}`);
239-
core.setFailed("Missing link to issue in title");
240265
},
241266
};

ci/scripts/jni_manylinux_build.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ set -euo pipefail
2525
# shellcheck source=ci/scripts/util_log.sh
2626
. "$(dirname "${0}")/util_log.sh"
2727

28+
github_actions_group_begin "Update llvm"
29+
vcpkg install \
30+
--debug \
31+
--clean-after-build \
32+
--x-install-root=${VCPKG_ROOT}/installed \
33+
--x-manifest-root=/arrow/ci/vcpkg \
34+
--overlay-ports=/arrow/ci/vcpkg/overlay/llvm/ \
35+
--x-feature=dev \
36+
--x-feature=flight \
37+
--x-feature=gcs \
38+
--x-feature=json \
39+
--x-feature=parquet \
40+
--x-feature=gandiva \
41+
--x-feature=s3
42+
github_actions_group_end
43+
2844
github_actions_group_begin "Prepare arguments"
2945
source_dir="$(cd "${1}" && pwd)"
3046
arrow_dir="$(cd "${2}" && pwd)"
@@ -57,7 +73,7 @@ devtoolset_version="$(rpm -qa "devtoolset-*-gcc" --queryformat '%{VERSION}' | gr
5773
devtoolset_include_cpp="/opt/rh/devtoolset-${devtoolset_version}/root/usr/include/c++/${devtoolset_version}"
5874
: "${ARROW_ACERO:=ON}"
5975
export ARROW_ACERO
60-
: "${ARROW_BUILD_TESTS:=ON}"
76+
: "${ARROW_BUILD_TESTS:=OFF}"
6177
export ARROW_BUILD_TESTS
6278
: "${ARROW_DATASET:=ON}"
6379
export ARROW_DATASET

vector/src/main/codegen/templates/UnionListWriter.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class Union${listName}Writer extends AbstractFieldWriter {
5353
private boolean inStruct = false;
5454
private boolean listStarted = false;
5555
private String structName;
56+
private ArrowType extensionType;
5657
<#if listName == "LargeList" || listName == "LargeListView">
5758
private static final long OFFSET_WIDTH = 8;
5859
<#else>
@@ -203,13 +204,13 @@ public MapWriter map(String name, boolean keysSorted) {
203204
204205
@Override
205206
public ExtensionWriter extension(ArrowType arrowType) {
206-
writer.extension(arrowType);
207-
return writer;
207+
extensionType = arrowType;
208+
return this;
208209
}
210+
209211
@Override
210212
public ExtensionWriter extension(String name, ArrowType arrowType) {
211-
ExtensionWriter extensionWriter = writer.extension(name, arrowType);
212-
return extensionWriter;
213+
return writer.extension(name, arrowType);
213214
}
214215
215216
<#if listName == "LargeList">
@@ -336,14 +337,18 @@ public void writeNull() {
336337
337338
@Override
338339
public void writeExtension(Object value) {
339-
writer.writeExtension(value);
340+
writer.writeExtension(value, extensionType);
341+
writer.setPosition(writer.idx() + 1);
340342
}
343+
341344
@Override
342-
public void addExtensionTypeWriterFactory(ExtensionTypeWriterFactory var1) {
343-
writer.addExtensionTypeWriterFactory(var1);
345+
public void writeExtension(Object value, ArrowType type) {
346+
writeExtension(value);
344347
}
348+
345349
public void write(ExtensionHolder var1) {
346350
writer.write(var1);
351+
writer.setPosition(writer.idx() + 1);
347352
}
348353
349354
<#list vv.types as type>

0 commit comments

Comments
 (0)