Skip to content

Commit

Permalink
Merge branch 'main' into java-flight-sql-objects
Browse files Browse the repository at this point in the history
  • Loading branch information
tokoko authored Jan 22, 2024
2 parents 1f15ae0 + 784d913 commit 7cd7c2d
Show file tree
Hide file tree
Showing 737 changed files with 99,807 additions and 14,818 deletions.
4 changes: 4 additions & 0 deletions .asf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
github:
description: "Database connectivity API standard and libraries for Apache Arrow"
homepage: https://arrow.apache.org/adbc/
collaborators:
- krlmlr
- nbenn
- ywc88
enabled_merge_buttons:
merge: false
rebase: false
Expand Down
24 changes: 24 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
---
# Only defaults for now, slowly enable more as desired
# Disable clang-analyzer-core, it fires on nanoarrow (I think it doesn't see that ArrowBufferReserve won't leave buffer->data NULL)
# Disable the warning about memset, etc. since it suggests C11 functions
# Disable valist, it's buggy: https://github.com/llvm/llvm-project/issues/40656
Checks: '-clang-analyzer-core.*,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-valist.Uninitialized'
FormatStyle: google
UseColor: true
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ MANYLINUX=2014
MAVEN=3.5.4
PYTHON=3.10
GO=1.19.5
ARROW_MAJOR_VERSION=12
ARROW_MAJOR_VERSION=14
DOTNET=7.0

# Used through docker-compose.yml and serves as the default version for the
# ci/scripts/install_vcpkg.sh script.
Expand Down
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@
# under the License.

c/vendor/* linguist-vendored
go/adbc/drivermgr/adbc.h linguist-vendored
go/adbc/drivermgr/adbc_driver_manager.cc linguist-vendored
go/adbc/pkg/flightsql/* linguist-generated
go/adbc/pkg/panicdummy/* linguist-generated
go/adbc/pkg/snowflake/* linguist-generated
python/adbc_driver_flightsql/adbc_driver_flightsql/_static_version.py export-subst
python/adbc_driver_manager/adbc_driver_manager/_static_version.py export-subst
python/adbc_driver_postgresql/adbc_driver_postgresql/_static_version.py export-subst
python/adbc_driver_snowflake/adbc_driver_snowflake/_static_version.py export-subst
python/adbc_driver_sqlite/adbc_driver_sqlite/_static_version.py export-subst
54 changes: 54 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# Any committer can add themselves to any of the path patterns
# and will subsequently get requested as a reviewer for any PRs
# that change matching files.
#
# This file uses .gitignore syntax with a few exceptions see the
# documentation about the syntax: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

## Format
adbc.h @lidavidm

## Implementations
/c/ @lidavidm
/csharp/ @lidavidm @CurtHagenlocher
/glib/ @kou
/java/ @lidavidm
/go/ @zeroshade
/python/ @lidavidm
/r/ @paleolimbot
/ruby/ @kou
/rust/ @wjones127

## Docs
/docs/ @lidavidm
# *.md
# *.rst
# *.txt

## PR CI and repo files
/.github/ @lidavidm @zeroshade
.asf.yaml @lidavidm @kou
.pre-commit-config.yaml @lidavidm
# .git*

# release scripts
/ci/ @lidavidm @kou
/dev/ @lidavidm @kou
.env @lidavidm
41 changes: 41 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "chore: "
- package-ecosystem: "nuget"
directory: "/csharp/"
schedule:
interval: "weekly"
commit-message:
prefix: "chore(csharp): "
ignore:
- dependency-name: "Microsoft.Extensions.*"
update-types:
- "version-update:semver-major"
- dependency-name: "Microsoft.Bcl.*"
update-types:
- "version-update:semver-major"
- dependency-name: "System.*"
update-types:
- "version-update:semver-major"
65 changes: 65 additions & 0 deletions .github/workflows/csharp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: C#

on:
push:
paths:
- '.github/workflows/csharp.yml'
- 'ci/scripts/csharp_*'
- 'csharp/**'
pull_request:
paths:
- '.github/workflows/csharp.yml'
- 'ci/scripts/csharp_*'
- 'csharp/**'

concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true

permissions:
contents: read

jobs:
csharp:
name: "C# ${{ matrix.os }} ${{ matrix.dotnet }}"
runs-on: ${{ matrix.os }}
if: ${{ !contains(github.event.pull_request.title, 'WIP') }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
version: ['7.0.x']
os: [ubuntu-latest, windows-2019, macos-latest]
steps:
- name: Install C#
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Checkout ADBC
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Install Source Link
shell: bash
run: dotnet tool install --global sourcelink
- name: Build
shell: bash
run: ci/scripts/csharp_build.sh $(pwd)
6 changes: 3 additions & 3 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ jobs:
name: "pre-commit"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-go@v3
- uses: actions/setup-go@v5
with:
go-version-file: 'go/adbc/go.mod'
check-latest: true
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
- name: install golangci-lint
run: |
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.49.0
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/dev_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
name: Process
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
persist-credentials: false

Expand All @@ -42,9 +42,16 @@ jobs:
github.event_name == 'pull_request_target' &&
(github.event.action == 'opened' ||
github.event.action == 'edited')
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const script = require(`${process.env.GITHUB_WORKSPACE}/.github/workflows/dev_pr/title_check.js`);
script({github, context});
await script({github, context});
- name: Assign milestone
if: always()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./.github/workflows/dev_pr/milestone.sh "${GITHUB_REPOSITORY}" ${{github.event.number}}
55 changes: 55 additions & 0 deletions .github/workflows/dev_pr/milestone.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/usr/bin/env bash
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

# Assign a milestone to the given PR based on the open milestones and known
# releases.

set -euo pipefail

main() {
local -r repo="${1}"
local -r pr_number="${2}"
echo "On ${repo} pull ${pr_number}"

local -r existing_milestone=$(gh pr view "${pr_number}" \
--json milestone \
-t '{{if .milestone}}{{.milestone.title}}{{end}}')

if [[ -n "${existing_milestone}" ]]; then
echo "PR has milestone: ${existing_milestone}"
return 0
fi

local -r latest_version=$(git ls-remote --heads origin |
grep -o '[0-9.]*$' |
sort --version-sort |
tail -n1)

local -r milestone=$(gh api "/repos/${repo}/milestones" |
jq -r '.[] | .title' |
grep -E '^ADBC Libraries' |
grep -v "${latest_version}" |
head -n1)

echo "Latest tagged version: ${latest_version}"
echo "Assigning milestone: ${milestone}"

gh pr edit "${pr_number}" -m "${milestone}"
}

main "$@"
32 changes: 29 additions & 3 deletions .github/workflows/dev_pr/title_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
// specific language governing permissions and limitations
// under the License.

const fs = require("fs");

const COMMIT_TYPES = [
'build',
'chore',
Expand All @@ -32,12 +34,34 @@ const COMMIT_TYPES = [
const COMMENT_BODY = ":warning: Please follow the [Conventional Commits format in CONTRIBUTING.md](https://github.com/apache/arrow-adbc/blob/main/CONTRIBUTING.md) for PR titles.";

function matchesCommitFormat(title) {
const commitType = `(${COMMIT_TYPES.join('|')})`;
const scope = "(\\([a-zA-Z0-9_/\\-,]+\\))?";
const commitType = `(?:${COMMIT_TYPES.join('|')})`;
const scope = "(?:\\(([a-zA-Z0-9_/\\-,]+)\\))?";
const delimiter = "!?:";
const subject = " .+";
const regexp = new RegExp(`^${commitType}${scope}${delimiter}${subject}$`);
return title.match(regexp) != null;

const matches = title.match(regexp);
if (matches === null) {
return false;
} else if (typeof matches[1] === "undefined") {
// No component
return true;
}

const components = matches[1].split(",");
console.info(`Components are ${components}`);
for (const component of components) {
if (component === "format") {
console.info(`Component is "format"`);
continue;
} else if (!fs.existsSync(component)) {
console.info(`Component "${component}" does not exist!`);
return false;
}
console.info(`Component "${component}" is valid`);
}

return true;
}

async function commentCommitFormat(github, context, pullRequestNumber) {
Expand Down Expand Up @@ -69,7 +93,9 @@ async function commentCommitFormat(github, context, pullRequestNumber) {
module.exports = async ({github, context}) => {
const pullRequestNumber = context.payload.number;
const title = context.payload.pull_request.title;
console.info(`Checking title "${title}"`);
if (!matchesCommitFormat(title)) {
console.info(`Title was not valid`);
await commentCommitFormat(github, context, pullRequestNumber);
}
};
Loading

0 comments on commit 7cd7c2d

Please sign in to comment.