Skip to content

Commit

Permalink
removed circular dependencies and madgerc override
Browse files Browse the repository at this point in the history
Signed-off-by: Jeromy Cannon <[email protected]>
  • Loading branch information
jeromy-cannon committed Jan 21, 2025
1 parent 8b961b3 commit 9722eee
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 28 deletions.
7 changes: 0 additions & 7 deletions .madgerc

This file was deleted.

9 changes: 1 addition & 8 deletions src/core/config/remote/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,9 @@
import {Migration} from './migration.js';
import {SoloError} from '../../errors.js';
import * as k8s from '@kubernetes/client-node';
import type {EmailAddress, Namespace, Version} from './types.js';
import type {EmailAddress, Namespace, RemoteConfigMetadataStructure, Version} from './types.js';
import type {Optional, ToObject, Validate} from '../../../types/index.js';

export interface RemoteConfigMetadataStructure {
name: Namespace;
lastUpdatedAt: Date;
lastUpdateBy: EmailAddress;
migration?: Migration;
}

/**
* Represent the remote config metadata object and handles:
* - Validation
Expand Down
29 changes: 29 additions & 0 deletions src/core/config/remote/remote_config_data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Copyright (C) 2024 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the ""License"");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an ""AS IS"" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import type {RemoteConfigMetadata} from './metadata.js';
import type {ComponentsDataWrapper} from './components_data_wrapper.js';
import type {CommonFlagsDataWrapper} from './common_flags_data_wrapper.js';
import {type Cluster, type Namespace} from './types.js';

export interface RemoteConfigData {
metadata: RemoteConfigMetadata;
clusters: Record<Cluster, Namespace>;
components: ComponentsDataWrapper;
lastExecutedCommand: string;
commandHistory: string[];
flags: CommonFlagsDataWrapper;
}
3 changes: 2 additions & 1 deletion src/core/config/remote/remote_config_data_wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ import {RemoteConfigMetadata} from './metadata.js';
import {ComponentsDataWrapper} from './components_data_wrapper.js';
import * as constants from '../../constants.js';
import {CommonFlagsDataWrapper} from './common_flags_data_wrapper.js';
import type {Cluster, Version, Namespace, RemoteConfigDataStructure, RemoteConfigData} from './types.js';
import type {Cluster, Version, Namespace, RemoteConfigDataStructure} from './types.js';
import type * as k8s from '@kubernetes/client-node';
import type {ToObject, Validate} from '../../../types/index.js';
import type {ConfigManager} from '../../config_manager.js';
import {type RemoteConfigData} from './remote_config_data.js';

export class RemoteConfigDataWrapper implements Validate, ToObject<RemoteConfigDataStructure> {
private readonly _version: Version = '1.0.0';
Expand Down
19 changes: 7 additions & 12 deletions src/core/config/remote/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
*/
import type {NodeAliases} from '../../../types/aliases.js';
import type {ComponentType, ConsensusNodeStates} from './enumerations.js';
import type {RemoteConfigMetadata, RemoteConfigMetadataStructure} from './metadata.js';
import type {ComponentsDataWrapper} from './components_data_wrapper.js';
import {type CommonFlagsDataWrapper} from './common_flags_data_wrapper.js';

export type EmailAddress = `${string}@${string}.${string}`;
export type Version = string;
Expand Down Expand Up @@ -49,15 +46,6 @@ export interface IConsensusNodeComponent extends Component {

export type ComponentsDataStructure = Record<ComponentType, Record<ComponentName, Component>>;

export interface RemoteConfigData {
metadata: RemoteConfigMetadata;
clusters: Record<Cluster, Namespace>;
components: ComponentsDataWrapper;
lastExecutedCommand: string;
commandHistory: string[];
flags: CommonFlagsDataWrapper;
}

export type RemoteConfigCommonFlagsStruct = {
releaseTag?: string;
chartDirectory?: string;
Expand All @@ -77,3 +65,10 @@ export interface RemoteConfigDataStructure {
lastExecutedCommand: string;
flags: RemoteConfigCommonFlagsStruct;
}

export interface RemoteConfigMetadataStructure {
name: Namespace;
lastUpdatedAt: Date;
lastUpdateBy: EmailAddress;
migration?: IMigration;
}

0 comments on commit 9722eee

Please sign in to comment.