Skip to content

Commit

Permalink
Merge branch 'master' into feature/fix-import-name-for-connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas65535 authored Sep 10, 2024
2 parents cf74170 + b3446d8 commit 5219d3b
Show file tree
Hide file tree
Showing 9 changed files with 156 additions and 121 deletions.
77 changes: 77 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,96 @@



## v4.22.0 (2024-09-09)

### Documentation

* docs: update documentation ([`e20b1bd`](https://github.com/Riminder/hrflow-connectors/commit/e20b1bda22c8847a79ace67315eb7bb2ff8fd1e8))

* docs: updating readme caused by subtype addition ([`69be864`](https://github.com/Riminder/hrflow-connectors/commit/69be86489cf56024a14d71c0463a0fa134a4f503))

### Feature

* feat: setting all connectors subtype value ([`1269ad8`](https://github.com/Riminder/hrflow-connectors/commit/1269ad831eaee865305fb1f607aa82a957c7644d))

### Fix

* fix: connectors tests ([`aa658c3`](https://github.com/Riminder/hrflow-connectors/commit/aa658c3dbae75dcd12af4fa7deb6db76d0422004))

* fix: connectors tests that uses based_on method ([`912611a`](https://github.com/Riminder/hrflow-connectors/commit/912611a5c84532fe316edadd9b31897847aec859))

* fix: removing unecessary subtype in connectors initialization in tests ([`4fd07de`](https://github.com/Riminder/hrflow-connectors/commit/4fd07de30c664a369a18923b619a91bd41903aa3))

* fix: removing unecessary subtype in connectors initialization ([`c953ff9`](https://github.com/Riminder/hrflow-connectors/commit/c953ff947e25975fb1734615f972cd7eae5be82f))

* fix: updating pytests for subtype addition and making subtype optional ([`d14a679`](https://github.com/Riminder/hrflow-connectors/commit/d14a6791b3119028d5dfa873e80cf375c011b31e))

* fix: adding missing tests related to subtype addition ([`fa5b855`](https://github.com/Riminder/hrflow-connectors/commit/fa5b855137fa3c936064e2135495896e5bf87df3))

### Unknown

* Merge pull request #280 from Riminder/feature/update-subtype-paths

core: replacing all ConnectorModel.name.lower() into ConnectorModel.s… ([`6b66cda`](https://github.com/Riminder/hrflow-connectors/commit/6b66cda573953f0b67265538b1f6a03685d1faa1))

* core: replacing all ConnectorModel.name.lower() into ConnectorModel.subtype ([`7a7f346`](https://github.com/Riminder/hrflow-connectors/commit/7a7f346edb91400887c74921c7adbe795c0a9f99))

* Merge pull request #275 from Riminder/feature/add-connector-subtype

feat: add subtype property to all connectors ([`7c325a0`](https://github.com/Riminder/hrflow-connectors/commit/7c325a042cf7ecca3a0332418918550d185cc0e0))

* core: making subtype property from Connector object mandatory ([`65f24f0`](https://github.com/Riminder/hrflow-connectors/commit/65f24f02e4213ba28b011eb4c6ce6641b8ffaf04))

* Merge branch 'feature/add-connector-subtype' of github.com:Riminder/hrflow-connectors into feature/add-connector-subtype ([`9fb79a6`](https://github.com/Riminder/hrflow-connectors/commit/9fb79a61d6efb53d61eb86d3a362aefbbbc7cb74))

* core: adding subtype property for ConnectorModel ([`5ef2604`](https://github.com/Riminder/hrflow-connectors/commit/5ef260443cce61b1a30aa691391458443cd5679c))


## v4.21.0 (2024-09-05)

### Documentation

* docs: updating readme caused by subtype addition ([`35c7365`](https://github.com/Riminder/hrflow-connectors/commit/35c7365b923df0fdc6aa6b7726e39e9876f2039f))

* docs: updating readme caused by subtype addition ([`ee8f09b`](https://github.com/Riminder/hrflow-connectors/commit/ee8f09b285bd24d0781c58dfeaec2603b19fa80e))

### Feature

* feat: use last hrflow sdk version 4.2.0 ([`4489706`](https://github.com/Riminder/hrflow-connectors/commit/4489706c6890c4d028e7fe0e5d71c0487a562113))

* feat: setting all connectors subtype value ([`58f24e1`](https://github.com/Riminder/hrflow-connectors/commit/58f24e10d0703c803f50aef133c9fbf1b5de79c2))

* feat: setting all connectors subtype value ([`9d8af7b`](https://github.com/Riminder/hrflow-connectors/commit/9d8af7ba6ffb688a75438869c8a18d588676539c))

### Fix

* fix: connectors tests that uses based_on method ([`aba8233`](https://github.com/Riminder/hrflow-connectors/commit/aba8233db6ea1c23be381575efbd969574f906d3))

* fix: removing unecessary subtype in connectors initialization in tests ([`e3bff24`](https://github.com/Riminder/hrflow-connectors/commit/e3bff247f51bec496caf403fb7d4aa3724e15994))

* fix: removing unecessary subtype in connectors initialization ([`d7f0960`](https://github.com/Riminder/hrflow-connectors/commit/d7f096060ff0264abda3d08dc721e0d3eaf7ff72))

* fix: updating pytests for subtype addition and making subtype optional ([`a492118`](https://github.com/Riminder/hrflow-connectors/commit/a492118a4a866e6f9269a20c2ae3bb3496b76509))

* fix: adding missing tests related to subtype addition ([`93fc2c4`](https://github.com/Riminder/hrflow-connectors/commit/93fc2c431557867f155b2aa1d7cfed2b7a11cfb8))

### Unknown

* Merge branches 'feature/add-connector-subtype' and 'feature/add-connector-subtype' of github.com:Riminder/hrflow-connectors into feature/add-connector-subtype ([`b06bfcc`](https://github.com/Riminder/hrflow-connectors/commit/b06bfcc0e2200e02693b125c6df94bc51c7147f7))

* core: adding subtype property for ConnectorModel ([`ec5c860`](https://github.com/Riminder/hrflow-connectors/commit/ec5c860327b443bd9176505e7ec76f4f22bada5a))


## v4.20.1 (2024-09-02)

### Fix

* fix: update usage of Hrflow python SDK to match 3.3.0 ([`8e1c4e8`](https://github.com/Riminder/hrflow-connectors/commit/8e1c4e8ca579321d7905c5d8e6b585df2f6efbff))

### Unknown

* core: adding subtype property for ConnectorModel ([`d3f6d7c`](https://github.com/Riminder/hrflow-connectors/commit/d3f6d7cd36c25b3034f00101a31a00bb9fa28f4a))


## v4.20.0 (2024-08-30)

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hrflow-connectors"
version = "4.21.0"
version = "4.22.0"
description = "hrflow-connectors is an open source project created by HrFlow.ai to allow developers to connect easily HR ecosystem component."
license = "Apache-2.0"
authors = ["HrFlow.ai <support+hrflow_connectors@hrflow.ai>"]
Expand Down
4 changes: 2 additions & 2 deletions src/hrflow_connectors/core/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ def logo(self, connectors_directory: Path) -> str:
"PIL is not found in current environment. Mind that you need to install"
" the package with dev dependencies to use manifest utility"
)
connector_directory = connectors_directory / self.name.lower()
connector_directory = connectors_directory / self.subtype
if not connector_directory.is_dir():
raise ValueError(
"No directory found for connector {} in {}".format(
Expand Down Expand Up @@ -925,7 +925,7 @@ def manifest(self, connectors_directory: Path) -> t.Dict:

jsonmap_path = (
connectors_directory
/ model.name.lower()
/ model.subtype
/ "mappings"
/ "format"
/ "{}.json".format(action.name.value)
Expand Down
8 changes: 4 additions & 4 deletions src/hrflow_connectors/core/documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def update_root_readme(connectors: t.List[Connector], root: Path) -> t.Dict:
model = connector.model
result = subprocess.run(
GIT_UPDATE_DATE.format(
connector=model.name.lower(),
connector=model.subtype,
base_connector_path=BASE_CONNECTOR_PATH.get().rstrip("/"),
),
shell=True,
Expand All @@ -204,7 +204,7 @@ def update_root_readme(connectors: t.List[Connector], root: Path) -> t.Dict:
if result.stderr:
raise Exception(
"Subprocess run for Git update dates failed for connector {} with"
" errors {}".format(model.name.lower(), result.stderr)
" errors {}".format(model.subtype, result.stderr)
)
filtered = [
line.split(" ")[0]
Expand Down Expand Up @@ -253,7 +253,7 @@ def update_root_readme(connectors: t.List[Connector], root: Path) -> t.Dict:
name=match.group("name"),
readme_link="./{base_connector_path}/{connector}/README.md".format(
base_connector_path=BASE_CONNECTOR_PATH.get().strip("/"),
connector=model.name.lower(),
connector=model.subtype,
),
type=model.type.value,
release_date=match.group("release_date"),
Expand Down Expand Up @@ -283,7 +283,7 @@ def generate_docs(
)
for connector in connectors:
model = connector.model
connector_directory = connectors_directory / model.name.lower()
connector_directory = connectors_directory / model.subtype
if not connector_directory.is_dir():
logging.error(
"Skipping documentation for {}: no directory found at {}".format(
Expand Down
20 changes: 9 additions & 11 deletions src/hrflow_connectors/core/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class InvalidTestConfigException(Exception):


@contextmanager
def secrets(connector_name: str, connectors_directory: Path):
def secrets(connector_name: str, connector_subtype: str, connectors_directory: Path):
secrets_prefix = ENVIRON_SECRETS_PREFIX.format(
connector_name=connector_name.upper()
)
Expand All @@ -63,9 +63,7 @@ def secrets(connector_name: str, connectors_directory: Path):
else:
global_secrets = dict()

connector_secrets_file = (
connectors_directory / connector_name.lower() / "secrets.json"
)
connector_secrets_file = connectors_directory / connector_subtype / "secrets.json"
if connector_secrets_file.exists():
try:
connector_secrets = json.loads(connector_secrets_file.read_text())
Expand Down Expand Up @@ -97,16 +95,16 @@ def actions(connector: Connector):


@contextmanager
def warehouses(connector_name: str, connectors_directory: Path):
def warehouses(connector_subtype: str, connectors_directory: Path):
if connectors_directory is CONNECTORS_DIRECTORY: # pragma: no cover
warehouse_module = import_module(
"hrflow_connectors.connectors.{}.warehouse".format(connector_name.lower())
"hrflow_connectors.connectors.{}.warehouse".format(connector_subtype)
)
else:
import_from = connectors_directory.relative_to(PROJECT_DIRECTORY)
warehouse_module = import_module(
"{}.{}.warehouse".format(
str(import_from).replace("/", "."), connector_name.lower()
str(import_from).replace("/", "."), connector_subtype
)
)
warehouse_names = []
Expand Down Expand Up @@ -223,9 +221,8 @@ def collect_connector_tests(
connector: Connector, connectors_directory: Path = CONNECTORS_DIRECTORY
):
connector_name = connector.model.name
test_config_file = (
connectors_directory / connector_name.lower() / "test-config.yaml"
)
connector_subtype = connector.model.subtype
test_config_file = connectors_directory / connector_subtype / "test-config.yaml"
if test_config_file.exists() is False:
raise NoTestConfigException(
"No test configuration found for connector {} at {}".format(
Expand All @@ -243,14 +240,15 @@ def collect_connector_tests(

try:
with warehouses(
connector_name=connector_name,
connector_subtype=connector_subtype,
connectors_directory=connectors_directory,
):
with actions(
connector=connector,
):
with secrets(
connector_name=connector_name,
connector_subtype=connector_subtype,
connectors_directory=connectors_directory,
):
test_suite = ConnectorTestConfig(**test_config)
Expand Down
Loading

0 comments on commit 5219d3b

Please sign in to comment.