Skip to content

Commit

Permalink
some refactoring (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesstoetzner authored Oct 14, 2024
1 parent 3bf4429 commit 9507b2c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 10 deletions.
27 changes: 27 additions & 0 deletions .idea/jsonSchemas.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 7 additions & 10 deletions src/graph/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -895,13 +895,6 @@ class ConstraintsOptions extends BaseOptions {
this.uniqueOutput = this.raw.unique_output_constraint ?? this.constraints
assert.isBoolean(this.uniqueOutput)

if (this.v3) {
this.requiredArtifact = this.raw.required_artifact_constraint ?? this.constraints
} else {
this.requiredArtifact = this.raw.required_artifact_constraint ?? this.constraints
}
assert.isBoolean(this.requiredArtifact)

this.requiredIncomingRelation = this.raw.required_incoming_relation_constraint ?? this.constraints
assert.isBoolean(this.requiredIncomingRelation)
} else {
Expand All @@ -926,13 +919,17 @@ class ConstraintsOptions extends BaseOptions {
this.uniqueOutput = this.raw.unique_output_constraint ?? this.raw.constraints ?? true
assert.isBoolean(this.uniqueOutput)

this.requiredArtifact = this.raw.required_artifact_constraint ?? this.raw.constraints ?? true
assert.isBoolean(this.requiredArtifact)

this.requiredIncomingRelation =
this.raw.required_incoming_relation_constraint ?? this.raw.constraints ?? false
assert.isBoolean(this.requiredIncomingRelation)
}

if (this.v3) {
this.requiredArtifact = this.raw.required_artifact_constraint ?? this.raw.constraints ?? true
} else {
this.requiredArtifact = this.raw.required_artifact_constraint ?? this.constraints
}
assert.isBoolean(this.requiredArtifact)
}
}

Expand Down
1 change: 1 addition & 0 deletions src/specification/variability.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export type NodeDefaultConditionMode =
| 'outgoingnaive'
| 'incomingnaive-artifact-host'
| 'incomingnaive-artifactnaive-host'
| 'artifact-host'
export type RelationDefaultConditionMode = 'source-target' | 'source' | 'target'
export type TechnologyDefaultConditionMode = 'container' | 'other' | 'container-other'
export type ArtifactDefaultConditionMode = 'container' | 'managed' | 'container-managed'
Expand Down
2 changes: 2 additions & 0 deletions src/technologies/plugins/rules/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ export class TechnologyRulePlugin implements TechnologyPlugin {
rule,
})

// TODO: hosting conditions should be combined by AND

// TODO: merge then and else block
if (rule.hosting.length !== 0) {
const output: LogicExpression[][] = []
Expand Down

0 comments on commit 9507b2c

Please sign in to comment.