diff --git a/README.md b/README.md index c5550ebc..1c013dbf 100644 --- a/README.md +++ b/README.md @@ -72,43 +72,36 @@ $ ./otterdog.sh -h To start using the cli part of `otterdog` right away on a specific organization you have to set up the following: -- define a default configuration to use, you can use the [default config](https://github.com/EclipseFdn/otterdog-defaults/) of the Eclipse Foundation as starting point +- define a default configuration to use, you can use the following [default config](https://github.com/eclipse-csi/otterdog/blob/main/examples/template/otterdog-defaults.libsonnet) as a starting point - create a `otterdog.json` file that contains the list of organizations you want to manage and some customizations - start managing your organizations using the cli -### Default configuration @ Eclipse Foundation +### Default configuration -The default configuration that is in use by the Eclipse Foundation can be used right away. It has some hooks and configurations -defined that are not meaningful for other uses though. Also the `config` repsitory is set to `.eclipsefdn` and is defined like -that in the default configuration and will be created upon the first `apply` execution. - -For simple testing though, you can use this base template: `https://github.com/EclipseFdn/otterdog-defaults#otterdog-defaults.libsonnet@main`. +You can define your own default configuration or use the following base template right away: `https://github.com/eclipse-csi/otterdog#examples/template/otterdog-defaults.libsonnet@main`. ### Otterdog configuration -The following example configuration is used to the manage the [Otterdogtest organization](https://github.com/OtterdogTest): +Create a `otterdog.json` file with the following content (replace bracketed values according to your setup): ```json { "defaults": { - "bitwarden": { - "api_token_key": "api_token_admin" - }, "jsonnet": { - "base_template": "https://github.com/EclipseFdn/otterdog-defaults#otterdog-defaults.libsonnet@main", + "base_template": "https://github.com/eclipse-csi/otterdog#examples/template/otterdog-defaults.libsonnet@main", "config_dir": "orgs" }, "github": { - "config_repo": ".eclipsefdn" + "config_repo": ".otterdog" } }, "organizations": [ { - "name": "OtterdogTest", - "github_id": "OtterdogTest", + "name": "", + "github_id": "", "credentials": { "provider": "bitwarden", - "item_id": "118276ad-158c-4720-b68d-af8c00fe3481" + "item_id": "" } } ] diff --git a/examples/template/otterdog-defaults.libsonnet b/examples/template/otterdog-defaults.libsonnet index aefa1640..6b24233d 100644 --- a/examples/template/otterdog-defaults.libsonnet +++ b/examples/template/otterdog-defaults.libsonnet @@ -267,7 +267,7 @@ local newOrg(id) = { settings: { name: null, plan: "free", - billing_email: null, + billing_email: "", company: null, email: null, twitter_username: null, diff --git a/otterdog/models/github_organization.py b/otterdog/models/github_organization.py index 23ffc160..c4e0cf43 100644 --- a/otterdog/models/github_organization.py +++ b/otterdog/models/github_organization.py @@ -386,7 +386,6 @@ async def load_from_provider( jsonnet_config: JsonnetConfig, provider: GitHubProvider, no_web_ui: bool = False, - printer: IndentingPrinter | None = None, concurrency: int | None = None, ) -> GitHubOrganization: start = datetime.now() @@ -457,7 +456,7 @@ async def load_from_provider( else: _logger.debug("not reading org secrets, no default config available") - if jsonnet_config.default_org_ruleset_config is not None: + if jsonnet_config.default_org_ruleset_config is not None and org.settings.plan == "enterprise": start = datetime.now() _logger.trace("rulesets: reading...") diff --git a/otterdog/operations/diff_operation.py b/otterdog/operations/diff_operation.py index 48c25968..b1c2488a 100644 --- a/otterdog/operations/diff_operation.py +++ b/otterdog/operations/diff_operation.py @@ -239,7 +239,7 @@ def coerce_current_org(self) -> bool: async def load_current_org(self, github_id: str, jsonnet_config: JsonnetConfig) -> GitHubOrganization: return await GitHubOrganization.load_from_provider( - github_id, jsonnet_config, self.gh_client, self.no_web_ui, self.printer, self.concurrency + github_id, jsonnet_config, self.gh_client, self.no_web_ui, self.concurrency ) def preprocess_orgs( diff --git a/otterdog/operations/import_configuration.py b/otterdog/operations/import_configuration.py index 7dbfa9de..3ea4d2ef 100644 --- a/otterdog/operations/import_configuration.py +++ b/otterdog/operations/import_configuration.py @@ -88,7 +88,7 @@ async def execute( async with GitHubProvider(credentials) as provider: organization = await GitHubOrganization.load_from_provider( - github_id, jsonnet_config, provider, self.no_web_ui, self.printer + github_id, jsonnet_config, provider, self.no_web_ui ) # copy secrets from existing configuration if it is present. diff --git a/otterdog/operations/show_live.py b/otterdog/operations/show_live.py index 3193d958..3293945e 100644 --- a/otterdog/operations/show_live.py +++ b/otterdog/operations/show_live.py @@ -63,7 +63,7 @@ async def execute( ) organization = await GitHubOrganization.load_from_provider( - github_id, jsonnet_config, provider, self.no_web_ui, self.printer + github_id, jsonnet_config, provider, self.no_web_ui ) for model_object, parent_object in organization.get_model_objects():