Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CDF-23588] 🧑‍💼 Env warning #1328

Merged
merged 18 commits into from
Jan 6, 2025
Merged
5 changes: 1 addition & 4 deletions CHANGELOG.cdf-tk.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,13 @@ Changes are grouped as follows:
### Fixed

- No more warning about missing `.env` file when running in `Google Cloud Build`.
- No more warning about missing `.env` file if all variables are set in the environment.
- When deploying a `Sequence` resource, Cognite Toolkit now replaces `dataSetExternalId` with `dataSetId`.
- Cognite Toolkit has improved resources that have server set default values that can lead to redeploy even when
unchanged. This includes `Sequences`, `Containers`, `DataSets`, `Views`, `Nodes`, `Edges`, `ExtractionPipelines`,
`CogniteFiles`, `HostedExtractorJobs`, `Relationships`, `RobotMaps`, and `WorkflowVersions`.
- On CDF deployed on Azure and AWS clouds, setting the `CPU` and `memory` of a CogniteFiles to lower than
the required value no longer triggers a redeploy.
- `LocationFilters` now parses the `version` key of `View` and `DataModel` correctly as a string.
- `LocationFilters` now converts an empty string of `dataSetExternalId` to `0` instead of ignoring it.
- All commands now has a verbose flag `--verbose`. Not all commands have an `--verbose` output, but
error handling has a more verbose output which applies to all commands.
- Toolkit now looks up the `assetExternalId` in the `Sequence` resource when deploying.

## [0.3.23] - 2024-12-13
Expand Down
5 changes: 4 additions & 1 deletion cognite_toolkit/_cdf_tk/apps/_core_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from cognite_toolkit._cdf_tk.feature_flags import Flags
from cognite_toolkit._cdf_tk.loaders import LOADER_BY_FOLDER_NAME
from cognite_toolkit._cdf_tk.utils import CDFToolConfig, get_cicd_environment
from cognite_toolkit._cdf_tk.utils.auth import AuthVariables
from cognite_toolkit._version import __version__ as current_version


Expand Down Expand Up @@ -115,7 +116,9 @@ def common(
if not (dotenv_file := Path.cwd() / ".env").is_file():
if not (dotenv_file := Path.cwd().parent / ".env").is_file():
if get_cicd_environment() == "local":
print("[bold yellow]WARNING:[/] No .env file found in current or parent directory.")
auth_vars = AuthVariables.from_env()
if not auth_vars.is_complete:
print("[bold yellow]WARNING:[/] No .env file found in current or parent directory.")

if dotenv_file.is_file():
has_loaded = load_dotenv(dotenv_file, override=override_env)
Expand Down
Loading