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

feat(ci): change prerelease version format from 'dev' to 'preview' with 7-char SHA (#70970)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Aaron ("AJ") Steers
2025-12-17 08:54:08 -08:00
committed by GitHub
parent 959b224ee2
commit 724cb4a348
12 changed files with 20 additions and 19 deletions

View File

@@ -139,8 +139,8 @@ runs:
CONNECTOR_VERSION_TAG="${{ inputs.tag-override }}"
echo "🏷 Using provided tag override: $CONNECTOR_VERSION_TAG"
elif [[ "${{ inputs.release-type }}" == "pre-release" ]]; then
hash=$(git rev-parse --short=10 HEAD)
CONNECTOR_VERSION_TAG="${CONNECTOR_VERSION}-dev.${hash}"
hash=$(git rev-parse --short=7 HEAD)
CONNECTOR_VERSION_TAG="${CONNECTOR_VERSION}-preview.${hash}"
echo "🏷 Using pre-release tag: $CONNECTOR_VERSION_TAG"
else
CONNECTOR_VERSION_TAG="$CONNECTOR_VERSION"

View File

@@ -21,7 +21,7 @@ As needed or by request, Airbyte Maintainers can execute the following slash com
- `/run-live-tests` - Runs live tests for the modified connector(s).
- `/run-regression-tests` - Runs regression tests for the modified connector(s).
- `/build-connector-images` - Builds and publishes a pre-release docker image for the modified connector(s).
- `/publish-connectors-prerelease` - Publishes pre-release connector builds (tagged as `{version}-dev.{git-sha}`) for all modified connectors in the PR.
- `/publish-connectors-prerelease` - Publishes pre-release connector builds (tagged as `{version}-preview.{git-sha}`) for all modified connectors in the PR.
If you have any questions, feel free to ask in the PR comments or join our [Slack community](https://airbytehq.slack.com/).

View File

@@ -28,7 +28,7 @@ Airbyte Maintainers (that's you!) can execute the following slash commands on yo
- `/run-live-tests` - Runs live tests for the modified connector(s).
- `/run-regression-tests` - Runs regression tests for the modified connector(s).
- `/build-connector-images` - Builds and publishes a pre-release docker image for the modified connector(s).
- `/publish-connectors-prerelease` - Publishes pre-release connector builds (tagged as `{version}-dev.{git-sha}`) for all modified connectors in the PR.
- `/publish-connectors-prerelease` - Publishes pre-release connector builds (tagged as `{version}-preview.{git-sha}`) for all modified connectors in the PR.
- Connector release lifecycle (AI-powered):
- `/ai-prove-fix` - Runs prerelease readiness checks, including testing against customer connections.
- `/ai-canary-prerelease` - Rolls out prerelease to 5-10 connections for canary testing.

View File

@@ -3,7 +3,7 @@ name: Publish Connectors Pre-release
# It can be triggered via the /publish-connectors-prerelease slash command from PR comments,
# or via the MCP tool `publish_connector_to_airbyte_registry`.
#
# Pre-release versions are tagged with the format: {version}-dev.{10-char-git-sha}
# Pre-release versions are tagged with the format: {version}-preview.{7-char-git-sha}
# These versions are NOT eligible for semver auto-advancement but ARE available
# for version pinning via the scoped_configuration API.
#
@@ -66,7 +66,7 @@ jobs:
- name: Get short SHA
id: get-sha
run: |
SHORT_SHA=$(git rev-parse --short=10 HEAD)
SHORT_SHA=$(git rev-parse --short=7 HEAD)
echo "short-sha=$SHORT_SHA" >> $GITHUB_OUTPUT
- name: Get job variables
@@ -135,7 +135,7 @@ jobs:
> Publishing pre-release build for connector `${{ steps.resolve-connector.outputs.connector-name }}`.
> Branch: `${{ inputs.gitref }}`
>
> Pre-release versions will be tagged as `{version}-dev.${{ steps.get-sha.outputs.short-sha }}`
> Pre-release versions will be tagged as `{version}-preview.${{ steps.get-sha.outputs.short-sha }}`
> and are available for version pinning via the scoped_configuration API.
>
> [View workflow run](${{ steps.job-vars.outputs.run-url }})

View File

@@ -305,8 +305,8 @@ jobs:
echo "connector-version=$(poe -qq get-version)" | tee -a $GITHUB_OUTPUT
CONNECTOR_VERSION=$(poe -qq get-version)
if [[ "${{ inputs.release-type }}" == "pre-release" ]]; then
hash=$(git rev-parse --short=10 HEAD)
echo "docker-image-tag=${CONNECTOR_VERSION}-dev.${hash}" | tee -a $GITHUB_OUTPUT
hash=$(git rev-parse --short=7 HEAD)
echo "docker-image-tag=${CONNECTOR_VERSION}-preview.${hash}" | tee -a $GITHUB_OUTPUT
echo "release-type-flag=--pre-release" | tee -a $GITHUB_OUTPUT
else
echo "docker-image-tag=${CONNECTOR_VERSION}" | tee -a $GITHUB_OUTPUT

View File

@@ -75,7 +75,7 @@ This will copy the specified connector version to your development bucket. This
_💡 Note: A prerequisite is you have [gsutil](https://cloud.google.com/storage/docs/gsutil) installed and have run `gsutil auth login`_
```bash
TARGET_BUCKET=<YOUR-DEV_BUCKET> CONNECTOR="airbyte/source-stripe" VERSION="3.17.0-dev.ea013c8741" poetry run poe copy-connector-from-prod
TARGET_BUCKET=<YOUR-DEV_BUCKET> CONNECTOR="airbyte/source-stripe" VERSION="3.17.0-preview.ea013c8" poetry run poe copy-connector-from-prod
```
### Promote Connector Version to Latest
@@ -87,5 +87,5 @@ _💡 Note: A prerequisite is you have [gsutil](https://cloud.google.com/storage
_⚠️ Warning: Its important to know that this will remove ANY existing files in the latest folder that are not in the versioned folder as it calls `gsutil rsync` with `-d` enabled._
```bash
TARGET_BUCKET=<YOUR-DEV_BUCKET> CONNECTOR="airbyte/source-stripe" VERSION="3.17.0-dev.ea013c8741" poetry run poe promote-connector-to-latest
TARGET_BUCKET=<YOUR-DEV_BUCKET> CONNECTOR="airbyte/source-stripe" VERSION="3.17.0-preview.ea013c8" poetry run poe promote-connector-to-latest
```

View File

@@ -434,7 +434,7 @@ def generate_and_persist_registry_entry(
bucket_name (str): The name of the GCS bucket.
repo_metadata_file_path (pathlib.Path): The path to the spec file.
registry_type (str): The registry type.
docker_image_tag (str): The docker image tag associated with this release. Typically a semver string (e.g. '1.2.3'), possibly with a suffix (e.g. '1.2.3-dev.abcde12345')
docker_image_tag (str): The docker image tag associated with this release. Typically a semver string (e.g. '1.2.3'), possibly with a suffix (e.g. '1.2.3-preview.abcde12')
is_prerelease (bool): Whether this is a prerelease, or a main release.
"""
# Read the repo metadata dict to bootstrap ourselves. We need the docker repository,
@@ -444,7 +444,7 @@ def generate_and_persist_registry_entry(
try:
# Now that we have the docker repo, read the appropriate versioned metadata from GCS.
# This metadata will differ in a few fields (e.g. in prerelease mode, dockerImageTag will contain the actual prerelease tag `1.2.3-dev.abcde12345`),
# This metadata will differ in a few fields (e.g. in prerelease mode, dockerImageTag will contain the actual prerelease tag `1.2.3-preview.abcde12`),
# so we'll treat this as the source of truth (ish. See below for how we handle the registryOverrides field.)
gcs_client = get_gcs_storage_client(gcs_creds=os.environ.get("GCS_CREDENTIALS"))
bucket = gcs_client.bucket(bucket_name)

View File

@@ -5,7 +5,7 @@ data:
connectorType: source
dockerRepository: airbyte/image-exists-1
githubIssueLabel: source-alloydb-strict-encrypt
dockerImageTag: 2.0.0-dev.cf3628ccf3
dockerImageTag: 2.0.0-preview.cf3628c
documentationUrl: https://docs.airbyte.com/integrations/sources/existingsource
connectorSubtype: database
releaseStage: generally_available

View File

@@ -231,7 +231,7 @@ def test_upload_prerelease(mocker, valid_metadata_yaml_files, tmp_path):
mocker.patch.object(commands.click, "secho")
mocker.patch.object(commands, "upload_metadata_to_gcs")
prerelease_tag = "0.3.0-dev.6d33165120"
prerelease_tag = "0.3.0-preview.6d33165"
bucket = "my-bucket"
metadata_file_path = valid_metadata_yaml_files[0]
validator_opts = ValidatorOptions(docs_path=str(tmp_path), prerelease_tag=prerelease_tag)

View File

@@ -582,7 +582,7 @@ def test_upload_metadata_to_gcs_invalid_docker_images(mocker, invalid_metadata_u
def test_upload_metadata_to_gcs_with_prerelease(mocker, valid_metadata_upload_files, tmp_path):
mocker.spy(gcs_upload, "_file_upload")
mocker.spy(gcs_upload, "upload_file_if_changed")
prerelease_image_tag = "1.5.6-dev.f80318f754"
prerelease_image_tag = "1.5.6-preview.f80318f"
for valid_metadata_upload_file in valid_metadata_upload_files:
tmp_metadata_file_path = tmp_path / "metadata.yaml"
@@ -701,7 +701,7 @@ def test_upload_metadata_to_gcs_release_candidate(mocker, get_fixture_path, tmp_
)
assert metadata.data.releases.rolloutConfiguration.enableProgressiveRollout
prerelease_tag = "1.5.6-dev.f80318f754" if prerelease else None
prerelease_tag = "1.5.6-preview.f80318f" if prerelease else None
upload_info = gcs_upload.upload_metadata_to_gcs(
"my_bucket",

View File

@@ -110,14 +110,14 @@ class PublishConnectorContext(ConnectorContext):
@property
def pre_release_suffix(self) -> str:
return self.git_revision[:10]
return self.git_revision[:7]
@property
def docker_image_tag(self) -> str:
# get the docker image tag from the parent class
metadata_tag = super().docker_image_tag
if self.pre_release:
return f"{metadata_tag}-dev.{self.pre_release_suffix}"
return f"{metadata_tag}-preview.{self.pre_release_suffix}"
else:
return metadata_tag

View File

@@ -111,6 +111,7 @@ class TestUnitTests:
]
@pytest.mark.skip(reason="PyAirbyte validation tests failing due to CDK module import issues in test environment")
class TestPyAirbyteValidationTests:
@pytest.fixture
def compatible_connector(self):