Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}

- name: Set up cache
uses: actions/cache@v3.3.2
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ hashFiles('poetry.lock') }}
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,9 @@ namespaces:
- node-name: src:001:name
description: Description about sources related to name
external_id: src:001:name
# optional since 3.5.0:
# creates additional variants by adding a suffix separated by '-' to the end (after '-spc'!)
space-variants: ["i", "m"]
- ns-name: in
- ns-nodes:
- node-name: in:001:name
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ inputs:

runs:
using: "docker"
image: docker://cognite/bootstrap-cli:v3.4.1
image: docker://cognite/bootstrap-cli:v3.5.0
env:
BOOTSTRAP_TOKEN_URL: ${{ inputs.token-url }}
BOOTSTRAP_PROJECT: ${{ inputs.cdf-project-name }}
Expand Down
4 changes: 3 additions & 1 deletion configs/config-deploy-example-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ bootstrap:
external-id: src:001:sap
- node-name: src:002:weather
description: Sources 002; from Weather.com
# external-id will be auto generated in this case.
# if omitted 'external-id' will be auto generated in this case.
# creates additional variants with adding a suffix separated by '-' to the end (after '-spc'!)
space-variants: ["i", "m"]

- ns-name: in
description: End user data-input provided through deployed CDF driven solutions
Expand Down
790 changes: 396 additions & 394 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "inso-bootstrap-cli"
# 230802 pa: switched to keep manually in sync with
# 1. src/bootstrap/__init__.py => __version__ = "3.0.6"
# 2. action.yml => image: docker://cognite/bootstrap-cli:v3.0.6
version = "3.4.1"
version = "3.5.0"
description = "A CLI to deploy a CDF Project to bootstrap CDF Groups scoped with Data Sets and RAW DBs"
authors = [
"Peter Arwanitis <peter.arwanitis@cognite.com>",
Expand All @@ -21,7 +21,7 @@ python-dotenv = "^0.21.1"
pydantic-settings = "^2"
dependency-injector = { version = "^4.41.0", extras = ["yaml"] }
click = "^8.1.6"
cognite-sdk = { version = "^6.39", extras = ["pandas"] }
cognite-sdk = { version = "^7", extras = ["pandas"] }
rich = "^13"

[tool.poetry.dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
# 230301 pa: automated by adding it to pyproject.toml > [tool.semantic_release] > version_variable

# 230802 pa: switched to manual updates, after issues with semver gh-actions
__version__ = "3.4.1"
__version__ = "3.5.0"
9 changes: 5 additions & 4 deletions src/bootstrap/app_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from cognite.client.data_classes import Database, DataSet, Group
from cognite.client.data_classes._base import CogniteResource, CogniteResourceList
from cognite.client.data_classes.data_modeling.spaces import Space
from cognite.client.utils._time import convert_time_attributes_to_datetime
from cognite.client.utils import _json
from cognite.client.utils._time import convert_and_isoformat_time_attrs


class CogniteResourceCache(UserList):
Expand Down Expand Up @@ -41,13 +42,13 @@ def __init__(
self.data = [r for r in resources] if isinstance(resources, CogniteResourceList) else [resources]

def __str__(self) -> str:
"""From CogniteResourceList v6.2.1
"""From CogniteResourceList v7.73.9

Returns:
_type_: _description_
"""
item = convert_time_attributes_to_datetime(self.dump())
return json.dumps(item, default=utils._auxiliary.json_dump_default, indent=4)
item = convert_and_isoformat_time_attrs(self.dump(camel_case=False))
return _json.dumps(item, indent=4)

def dump(self, camel_case: bool = False) -> list[dict[str, Any]]:
"""Dump the instance into a json serializable Python data type.
Expand Down
35 changes: 18 additions & 17 deletions src/bootstrap/app_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ class IdpCdfMapping(Model):

class IdpCdfMappingProjects(Model):
cdf_project: str
create_only_mapped_cdf_groups: Optional[bool] = True
create_only_mapped_cdf_groups: bool = True
mappings: list[IdpCdfMapping]


Expand All @@ -180,15 +180,16 @@ class SharedNode(Model):


class SharedAccess(Model):
owner: Optional[list[SharedNode]] = []
read: Optional[list[SharedNode]] = []
owner: list[SharedNode] = []
read: list[SharedNode] = []


class NamespaceNode(Model):
node_name: str
external_id: Optional[str] = None
metadata: Optional[dict[str, Any]] = None
description: Optional[str] = ""
space_variants: list[str] = []
description: str = ""
shared_access: Optional[SharedAccess] = SharedAccess(owner=[], read=[])


Expand All @@ -199,15 +200,15 @@ class Namespace(Model):


class BootstrapFeatures(Model):
with_raw_capability: Optional[bool] = True
with_datamodel_capability: Optional[bool] = True
with_undocumented_capabilities: Optional[bool] = False
group_prefix: Optional[str] = "cdf"
aggregated_level_name: Optional[str] = "allprojects"
dataset_suffix: Optional[str] = "dataset"
space_suffix: Optional[str] = "space"
rawdb_suffix: Optional[str] = "rawdb"
rawdb_additional_variants: Optional[list[str]] = ["state"]
with_raw_capability: bool = True
with_datamodel_capability: bool = True
with_undocumented_capabilities: bool = False
group_prefix: str = "cdf"
aggregated_level_name: str = "allprojects"
dataset_suffix: str = "dataset"
space_suffix: str = "space"
rawdb_suffix: str = "rawdb"
rawdb_additional_variants: list[str] = ["state"]
Comment on lines +203 to +211

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change. Is it a safe change? Will clients using your library break?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is fully backward compatible, but from 3.5.0 onward supports a new (additional) config

semantic versioning from 3.4.1 to 3.5.0 is indicating that, and release-notes will too

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I understand, something that was optional before is now mandatory. I see that as breaking. Did I misunderstand how it works?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah you meant removal of Optional[..], that was only done where the default value was not None anyway.

A corner case could be that a yaml-config was configured with null which had before passed a pydantic value-validation

as this was never documented (and makes no sense) it is theoretical

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as all have default values it is still optional when parsed by pydantic, just not support None anymore



class BootstrapCoreConfig(Model):
Expand Down Expand Up @@ -276,7 +277,7 @@ class BootstrapDeleteConfig(Model):
Configuration parameters for CDF Project Bootstrap 'delete' command
"""

datasets: Optional[list] = []
groups: Optional[list] = []
raw_dbs: Optional[list] = []
spaces: Optional[list] = []
datasets: list = []
groups: list = []
raw_dbs: list = []
spaces: list = []
Loading