Skip to content

Commit

Permalink
remove github_url
Browse files Browse the repository at this point in the history
  • Loading branch information
alafanechere committed Sep 14, 2023
1 parent 85a977c commit 9350c16
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 22 deletions.
18 changes: 1 addition & 17 deletions airbyte-ci/connectors/base_images/base_images/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
from abc import ABC, abstractmethod
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from typing import final

import dagger
import semver
from base_images import consts, errors, registries, sanity_checks
from base_images import errors, registries, sanity_checks


@dataclass
Expand All @@ -40,7 +39,6 @@ class AirbyteConnectorBaseImage(ABC):
"""

name_with_tag: str
github_url: str
version: semver.VersionInfo

@final
Expand All @@ -56,7 +54,6 @@ def __init__(self, dagger_client: dagger.Client, platform: dagger.Platform):
self._validate_platform_availability()

def __init_subclass__(cls) -> None:
cls.github_url = AirbyteConnectorBaseImage.get_github_url(cls)
if not inspect.isabstract(cls):
cls.version = registries.get_version_from_class_name(cls)
cls.name_with_tag = f"{cls.image_name}:{cls.version}"
Expand Down Expand Up @@ -200,16 +197,3 @@ async def run_sanity_checks(base_image_version: AirbyteConnectorBaseImage):
await sanity_checks.check_label_defined_with_dagger(
base_image_version.container, "io.airbyte.base_image", base_image_version.name_with_tag
)

@staticmethod
def get_github_url(cls) -> str:
"""This method returns the GitHub URL of the file where the class is defined on the main branch.
This URL is used to generate the changelog entry for the release notes.
This URL will resolve once the code is pushed to the main branch.
Returns:
str: The GitHub URL of the file where the class is defined on the main branch.
"""
absolute_module_path = inspect.getfile(cls)
relative_module_path = Path(absolute_module_path).relative_to(consts.AIRBYTE_ROOT_DIR)
return f"{consts.AIRBYTE_GITHUB_REPO_URL}/blob/{consts.MAIN_BRANCH_NAME}/{relative_module_path}"
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def write_changelog(self) -> Path:
self.changelog_path.unlink(missing_ok=True)
entries = [
{
"Version": f"[{base_version_image_class.version}]({base_version_image_class.github_url})",
"Version": base_version_image_class.version,
"Changelog": base_version_image_class.changelog_entry,
}
for base_version_image_class in self.versions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog for airbyte-python-connector-base

| Version | Changelog |
|--------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
|[1.1.0](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/base_images/base_images/python/v1.py)| Install poetry 1.6.1 |
|[1.0.0](https://github.com/airbytehq/airbyte/blob/master/airbyte-ci/connectors/base_images/base_images/python/v1.py)|Declare our first base image version. It uses Python 3.9.18 on a Debian 11 (Bookworm) system with Pip 23.2.1 and UTC timezone.|
|Version| Changelog |
|-------|------------------------------------------------------------------------------------------------------------------------------|
| 1.1.0 | Install poetry 1.6.1 |
| 1.0.0 |Declare our first base image version. It uses Python 3.9.18 on a Debian 11 (Bookworm) system with Pip 23.2.1 and UTC timezone.|

0 comments on commit 9350c16

Please sign in to comment.