1
0
mirror of synced 2025-12-19 18:14:56 -05:00

gradle: remove SUB_BUILD env var and references (#31027)

This commit is contained in:
Marius Posta
2023-10-04 14:58:22 -07:00
committed by GitHub
parent 0fe0b911a1
commit 53735b6d37
10 changed files with 9 additions and 101 deletions

View File

@@ -73,7 +73,7 @@ jobs:
repository: ${{ github.event.inputs.repo }}
ref: ${{ github.event.inputs.gitref }}
- name: Build CDK Package
run: SUB_BUILD=CDK ./gradlew --no-daemon --no-build-cache :airbyte-cdk:python:build
run: ./gradlew --no-daemon --no-build-cache :airbyte-cdk:python:build
- name: Post failure to Slack channel dev-connectors-extensibility
if: ${{ failure() }}
uses: slackapi/slack-github-action@v1.23.0

View File

@@ -70,7 +70,7 @@ pip install -e ".[dev]" # [dev] installs development-only dependencies
##### Autogenerated files
If the iteration you are working on includes changes to the models, you might want to regenerate them. In order to do that, you can run:
```commandline
SUB_BUILD=CDK ./gradlew format
./gradlew :airbyte-cdk:python:format
```
This will generate the files based on the schemas, add the license information and format the code. If you want to only do the former and rely on
pre-commit to the others, you can run the appropriate generation command i.e. `./gradlew generateComponentManifestClassFiles`.

View File

@@ -9,7 +9,7 @@ This module uses `jsonschema2pojo` to generate Java config objects from [json sc
```
- Run the following command under the project root:
```sh
SUB_BUILD=PLATFORM ./gradlew airbyte-config-oss:config-models-oss:generateJsonSchema2Pojo
./gradlew airbyte-config-oss:config-models-oss:generateJsonSchema2Pojo
```
The generated file is under:
```

View File

@@ -233,10 +233,6 @@ allprojects {
excludes.addAll excludes.collectMany {
it.startsWith("${project.name}/") ? [it, it.substring("${project.name}/".length())] : [it]
}
// TODO: remove this once SUB_BUILD is no longer a thing, here for github workflow backwards compatibility.
if (System.getenv().containsKey("SUB_BUILD")) {
excludes.add("airbyte-integrations/connectors")
}
// Prefix everything with double-globs because we only care about path suffixes.
excludes = excludes.collect { "**/${it}" }
// Remove whatever's covered by the project's subprojects, so that each file is targeted by at most one task.

View File

@@ -686,7 +686,7 @@ $ octavia apply
### Developing locally
0. Build the project locally (from the root of Airbyte's repo): `SUB_BUILD=OCTAVIA_CLI ./gradlew build # from the root directory of the repo`.
0. Build the project locally (from the root of Airbyte's repo): `./gradlew :octavia-cli:build # from the root directory of the repo`.
1. Install Python 3.8.12. We suggest doing it through `pyenv`.
2. Create a virtualenv: `python -m venv .venv`.
3. Activate the virtualenv: `source .venv/bin/activate`.

View File

@@ -90,90 +90,6 @@ dependencyResolutionManagement {
}
}
// SUB_BUILD is an enum of <blank>, PLATFORM, CONNECTORS_BASE, CDK, ALL_CONNECTORS and OCTAVIA_CLI.
// Blank is equivalent to ALL_CONNECTORS.
//
// This is a relic from the days of the monorepo and we support it here to not break existing github workflows.
// As soon as they are not referenced there (directly or indirectly) we can remove this whole if-block.
if (System.getenv().containsKey("SUB_BUILD")) {
def subBuild = System.getenv().get("SUB_BUILD")
println("Building Airbyte Sub Build: " + subBuild)
switch(subBuild) {
case "ALL_CONNECTORS":
break
case "CDK":
include ':airbyte-commons' // this wouldn't be necessary if it wasn't from https://github.com/airbytehq/airbyte/blob/645558b74aab0b91fda1b4628b37b7095d92b4cc/build.gradle
include ':tools:code-generator'
include ':airbyte-cdk:python'
return
case "OCTAVIA_CLI":
include ':airbyte-commons'
include ':airbyte-api'
include ':octavia-cli'
return
case "CONNECTORS_BASE":
include ':airbyte-commons'
include ':airbyte-api'
include ':airbyte-commons-cli'
include ':airbyte-commons-protocol'
include ':airbyte-config-oss:init-oss'
include ':airbyte-config-oss:config-models-oss' // reused by acceptance tests in connector base.
include ':airbyte-db:db-lib' // reused by acceptance tests in connector base.
include ':airbyte-json-validation'
include ':airbyte-test-utils'
include ':airbyte-connector-test-harnesses:acceptance-test-harness'
include ':tools:code-generator'
include ':airbyte-cdk:python'
include ':airbyte-cdk:java:airbyte-cdk'
include ':airbyte-cdk:java:airbyte-cdk:core'
include ':airbyte-cdk:java:airbyte-cdk:db-destinations'
include ':airbyte-cdk:java:airbyte-cdk:db-sources'
include ':airbyte-integrations:bases:base'
include ':airbyte-integrations:bases:base-java'
include ':airbyte-integrations:bases:base-java-s3'
include ':airbyte-integrations:bases:base-normalization'
include ':airbyte-integrations:bases:base-typing-deduping'
include ':airbyte-integrations:bases:base-typing-deduping-test'
include ':airbyte-integrations:bases:bases-destination-jdbc' // needs to be lexicographically after base-java and base-normalization to avoid race condition
include ':airbyte-integrations:bases:base-standard-source-test-file'
include ':airbyte-integrations:bases:connector-acceptance-test'
include ':airbyte-integrations:bases:standard-destination-test'
include ':airbyte-integrations:bases:s3-destination-base-integration-test'
include ':airbyte-integrations:bases:standard-source-test'
include ':airbyte-integrations:connector-templates:generator'
include ':airbyte-integrations:bases:debezium'
// Needed by normalization integration tests
include ':airbyte-integrations:connectors:destination-bigquery'
include ':airbyte-integrations:connectors:destination-mysql'
include ':airbyte-integrations:connectors:destination-postgres'
include ':airbyte-integrations:connectors:destination-redshift'
include ':airbyte-integrations:connectors:destination-snowflake'
include ':airbyte-integrations:connectors:destination-oracle'
include ':airbyte-integrations:connectors:destination-mssql'
include ':airbyte-integrations:connectors:destination-clickhouse'
include ':airbyte-integrations:connectors:destination-tidb'
include ':airbyte-integrations:connectors:destination-duckdb'
//Needed by destination-bigquery
include ':airbyte-integrations:connectors:destination-s3'
include ':airbyte-integrations:connectors:destination-gcs'
include ':airbyte-integrations:connectors-performance:source-harness'
include ':airbyte-integrations:connectors-performance:destination-harness'
return
default:
throw new IllegalArgumentException(String.format("%s is invalid. Must be unset or CONNECTORS_BASE, CDK, ALL_CONNECTORS or OCTAVIA_CLI", subBuild))
}
}
include ':airbyte-commons'
include ':airbyte-api'
include ':airbyte-commons-cli'
@@ -187,6 +103,8 @@ include ':airbyte-test-utils'
include ':airbyte-connector-test-harnesses:acceptance-test-harness'
include ':tools:code-generator'
include ':octavia-cli'
include ':airbyte-cdk:python'
include ':airbyte-cdk:java:airbyte-cdk'
include ':airbyte-cdk:java:airbyte-cdk:core'

View File

@@ -11,20 +11,17 @@ all_integration_tests=$(./gradlew integrationTest --dry-run | grep 'integrationT
run() {
if [[ "$connector" == "all" ]] ; then
echo "Running: ./gradlew --no-daemon --scan integrationTest"
SUB_BUILD=ALL_CONNECTORS ./gradlew --no-daemon --scan integrationTest
./gradlew --no-daemon --scan integrationTest
else
if [[ "$connector" == *"base-normalization"* ]]; then
selected_integration_test="base-normalization"
integrationTestCommand="$(_to_gradle_path "airbyte-integrations/bases/base-normalization" integrationTest)"
export SUB_BUILD="CONNECTORS_BASE"
# avoid schema conflicts when multiple tests for normalization are run concurrently
export RANDOM_TEST_SCHEMA="true"
./gradlew --no-daemon --scan assemble
elif [[ "$connector" == *"bases"* ]]; then
connector_name=$(echo $connector | cut -d / -f 2)
selected_integration_test=$(echo "$all_integration_tests" | grep "^$connector_name$" || echo "")
integrationTestCommand="$(_to_gradle_path "airbyte-integrations/$connector" integrationTest)"
export SUB_BUILD="CONNECTORS_BASE"
elif [[ "$connector" == *"connectors"* ]]; then
connector_name=$(echo $connector | cut -d / -f 2)
selected_integration_test=$(echo "$all_integration_tests" | grep "^$connector_name$" || echo "")

View File

@@ -32,15 +32,12 @@ else
if [[ "$connector" == *"base-normalization"* ]]; then
selected_performance_test="base-normalization"
performanceTestCommand="$(_to_gradle_path "airbyte-integrations/bases/base-normalization" performanceTest)"
export SUB_BUILD="CONNECTORS_BASE"
# avoid schema conflicts when multiple tests for normalization are run concurrently
export RANDOM_TEST_SCHEMA="true"
./gradlew --no-daemon --scan assemble
elif [[ "$connector" == *"bases"* ]]; then
connector_name=$(echo $connector | cut -d / -f 2)
selected_performance_test=$(echo "$all_performance_tests" | grep "^$connector_name$" || echo "")
performanceTestCommand="$(_to_gradle_path "airbyte-integrations/$connector" performanceTest)"
export SUB_BUILD="CONNECTORS_BASE"
elif [[ "$connector" == *"connectors"* ]]; then
connector_name=$(echo $connector | cut -d / -f 2)
selected_performance_test=$(echo "$all_performance_tests" | grep "^$connector_name$" || echo "")

View File

@@ -19,4 +19,4 @@ echo "Waiting for services to begin"
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8000/api/v1/health)" != "200" ]]; do echo "Waiting for docker deployment.."; sleep 5; done
echo "Running integration tests via gradle"
SUB_BUILD=OCTAVIA_CLI ./gradlew :octavia-cli:integrationTest --rerun-tasks --scan
./gradlew :octavia-cli:integrationTest --rerun-tasks --scan

View File

@@ -19,6 +19,6 @@ docker login --username "${DOCKER_HUB_USERNAME}" --password "${DOCKER_HUB_PASSWO
source ./tools/bin/bump_version.sh
echo "Building and publishing OCTAVIA version ${NEW_VERSION} for git revision ${GIT_REVISION}..."
VERSION=$NEW_VERSION SUB_BUILD=OCTAVIA_CLI ./gradlew clean build --scan
VERSION=$NEW_VERSION ./gradlew clean :octavia-cli:build --scan
./octavia-cli/publish.sh ${NEW_VERSION} ${GIT_REVISION}
echo "Completed building and publishing OCTAVIA..."