Skip to content

Commit

Permalink
check and bypass on basis of status w/signoff
Browse files Browse the repository at this point in the history
Signed-off-by: Jougan-0 <[email protected]>
  • Loading branch information
Jougan-0 committed Oct 4, 2024
1 parent 758a131 commit b471696
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 10 additions & 1 deletion models/registration/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ func (rh *RegistrationHelper) register(pkg PackagingUnit) {
//silently exit if the model does not conatin any components or relationships
return
}
ignored := model.ModelDefinitionStatusIgnored
// 1. Register the model
model := pkg.Model

modelstatus := model.Status
if modelstatus == ignored {
return
}
// Don't register anything else if registrant is not there
if model.Registrant.Kind == "" {
err := ErrMissingRegistrant(model.Name)
Expand Down Expand Up @@ -100,6 +104,11 @@ func (rh *RegistrationHelper) register(pkg PackagingUnit) {
var registeredRelationships []relationship.RelationshipDefinition
// 2. Register components
for _, comp := range pkg.Components {
status := *comp.Status
if status == component.Ignored {
continue
}

comp.Model = model

if comp.Styles != nil {
Expand Down
4 changes: 3 additions & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ func CreateDirectory(path string) error {
func ReplaceSpacesAndConvertToLowercase(s string) string {
return strings.ToLower(strings.ReplaceAll(s, " ", ""))
}

func ReplaceSpacesWithHyphenAndConvertToLowercase(s string) string {
return strings.ToLower(strings.ReplaceAll(s, " ", "-"))
}
func ExtractDomainFromURL(location string) string {
parsedURL, err := url.Parse(location)
// If unable to extract domain return the location as is.
Expand Down

0 comments on commit b471696

Please sign in to comment.