You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f'Invalid Organization Key: "{self.organization}". The expected characters are lowercase letters, numbers, and hyphens (-).\n\nYou can get the keys for your organization using the CLI or the web interface.',
f'Invalid Workspace Key: "{self.workspace}". The expected characters are lowercase letters, numbers, and hyphens (-).\n\nYou can get the keys for your workspace using the CLI or the web interface.',
raiseRuntimeError("API client is not initialized.")
334
359
360
+
ifself.projectandnotvalid_key(self.project):
361
+
raiseRuntimeError(
362
+
f'Invalid Project Key: "{self.project}". The expected characters are lowercase letters, numbers, and hyphens (-).\n\nYou can get the keys for your project using the CLI or the web interface.',
f"Invalid project path format: '{path}'.\n\nExpected formats are 'org/workspace/project', 'workspace/project', or 'project'. Where each component is the key for that entity.'"
453
+
)
422
454
423
455
# The groups are: (Org, Workspace, Project)
424
456
groups=match.groups()
425
457
426
458
present_components= [cforcingroupsifcisnotNone]
427
459
460
+
# validate each component
461
+
forcomponentinpresent_components:
462
+
ifnotvalid_key(component):
463
+
raiseRuntimeError(
464
+
f'Invalid Key: "{component}". The expected characters are lowercase letters, numbers, and hyphens (-).\n\nYou can get the keys for your organization, workspace, and project using the CLI or the web interface.',
465
+
)
466
+
428
467
iflen(present_components) ==3:
429
468
org, workspace, project=groups
430
469
eliflen(present_components) ==2:
@@ -472,6 +511,10 @@ def configure(
472
511
1. Environment variables:
473
512
- `DREADNODE_SERVER_URL` or `DREADNODE_SERVER`
474
513
- `DREADNODE_API_TOKEN` or `DREADNODE_API_KEY`
514
+
- `DREADNODE_ORGANIZATION`
515
+
- `DREADNODE_WORKSPACE`
516
+
- `DREADNODE_PROJECT`
517
+
475
518
2. Dreadnode profile (from `dreadnode login`)
476
519
- Uses `profile` parameter if provided
477
520
- Falls back to `DREADNODE_PROFILE` environment variable
@@ -484,7 +527,7 @@ def configure(
484
527
local_dir: The local directory to store data in.
485
528
organization: The default organization name or ID to use.
486
529
workspace: The default workspace name or ID to use.
487
-
project: The default project name to associate all runs with. This can also be in the format `org/workspace/project`.
530
+
project: The default project name to associate all runs with. This can also be in the format `org/workspace/project` using the keys.
488
531
service_name: The service name to use for OpenTelemetry.
489
532
service_version: The service version to use for OpenTelemetry.
490
533
console: Log span information to the console (`DREADNODE_CONSOLE` or the default is True).
0 commit comments