Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implied relationship don't preserve tags in scripts #293

Closed
galuszkak opened this issue May 13, 2024 · 0 comments
Closed

Implied relationship don't preserve tags in scripts #293

galuszkak opened this issue May 13, 2024 · 0 comments

Comments

@galuszkak
Copy link

galuszkak commented May 13, 2024

Description

Hi @simonbrowndotje ,

Thanks for awesome project. While working on modelling our system we encountered on a situation that our systemContext views that had implied relationships from containers are not showing up with our tags filtering. After further investigation we realized that while implied relationships are created, they aren't copying tags when using scripts.

However when you use DSL only without scripts tags are properly assigned. We are wondering why tags are copied on findRelationshipStyle. Is there any reason why this isn't part of model code? We saw issue #167 #174 that are mentioning this, but we can't quite understand why tags aren't copied when building model not when relationshipStyles are looked on...

Steps to reproduce

Code sample is provided below. To validate problem you can run it:

$ structurizr-cli validate -w test.dsl
2024-05-13T12:31:28.119+02:00 [main] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
Pass '--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED' to enable.

System Context Tags:
Relationship: 'Uses' tags: ''


Container Tags:
Relationship: 'Uses' tags: 'Relationship,Tag1'

Screenshot

No response

Code sample

workspace {
    !identifiers hierarchical
    model {

        softwareSystem1 = softwareSystem "Software System 1" "My software system." {
            container1 = container "WebApp"
        }
        softwareSystem2 = softwareSystem "Software System 2" "My software system." {
            container2 = container "WebApp"
        }
        softwareSystem1.container1 -> softwareSystem2.container2 "Uses" {
            tags "Tag1"
        }
    }
    views {
        systemContext softwareSystem1 "SystemContext" {
            include softwareSystem1 softwareSystem2
            !script ruby {
                puts "\nSystem Context Tags:"
                puts view.relationships.map{ |r| "Relationship: '#{r.relationship.description}' tags: '#{r.relationship.tags}'" }
                puts "\n"
            }
            autoLayout
        }
        container softwareSystem1 "containerSoftwareSystem1" {
            include softwareSystem1.container1 softwareSystem2.container2
            !script ruby {
                puts "\nContainer Tags:"
                puts view.relationships.map{ |r| "Relationship: '#{r.relationship.description}' tags: '#{r.relationship.tags}'" }
                puts "\n\n"
            }
            autoLayout
        }
    }
}

Configuration

No response

Severity

Major

Priority

I'm willing to fix this myself and raise a PR (please confirm approach first)

More information

No response

@galuszkak galuszkak added the bug label May 13, 2024
@structurizr structurizr locked and limited conversation to collaborators Jul 2, 2024
@simonbrowndotje simonbrowndotje converted this issue into discussion #310 Jul 2, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants