Skip to content
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

Studio not pulling entire repo #60

Open
e-wagner-OH opened this issue Sep 12, 2024 · 9 comments
Open

Studio not pulling entire repo #60

e-wagner-OH opened this issue Sep 12, 2024 · 9 comments

Comments

@e-wagner-OH
Copy link

Trying to create a super diagram that pulls in 13 other d2 diagrams. Have a github action that adds git submodules to a branch and pushes that branch. Try to open in d2 studio, and the git submodules and their dir are not showing up.

The git branch looks normal, I think it is just a limitation of studio at this point? How can I add other diagrams (which are in their own git repos) to another diagram that may have it's own dependencies on the lower level diagram?

@alixander
Copy link
Contributor

@e-wagner-OH to be clear, the repo that D2 is pulling from has submodules? And the issue is that those are not being detected?

If so, the fix should be simple, just want to understand.

@e-wagner-OH
Copy link
Author

@alixander - yes, exactly. Submodules not being detected within Studio. Also, when I push to a test branch from the super diagram in Studio, the submodule diagrams do not get pushed.

@alixander
Copy link
Contributor

@e-wagner-OH I see, thanks for the information. I have a few followup questions:

  1. What is in these submodules?
  2. Are there any references being made from the main repo to submodules? E.g. icons, imports
  3. I didn't quite understand your last sentence. If the "super diagram" is the repository that contains those submodules, why would the submodules also get a git push?

@e-wagner-OH
Copy link
Author

e-wagner-OH commented Sep 13, 2024

@alixander
What is in these submodules? D2 diagrams
Are there any references being made from the main repo to submodules? E.g. icons, imports Yes, imports
I didn't quite understand your last sentence. If the "super diagram" is the repository that contains those submodules, why would the submodules also get a git push? The super diagram would contain its own index.d2 file and the 13 git submodules of other diagrams. I wanted to use composition (layers and scenarios) to walk different groups through the work being considered.

I created a test with 2 git repos and I made them public. d2-test-a and d2-test-b.

In test-a, I have a ...@d2-test-b/index line in the index.d2 and I have added the d2-test-b as a git submodule. Locally developing d2, the import command works fine and I get what I expect from the import.

image

When I connect to studio with the same branch, the git submodule is not available/ or pulled into terrastruct. Error in studio.

image

@alixander
Copy link
Contributor

The super diagram would contain its own index.d2 file and the 13 git submodules of other diagrams.

Let's say I open the super diagram in D2 Studio and the contents of the submodules also appear. If I update the content of the submodule, is it expected those changes also be pushed to the submodule repository?

To be honest I haven't considered this use case. It's an interesting one that I'll think about more whether and how to support. Currently have a backlog of todo's and will queue this and get back to you in a few sprints.

@e-wagner-OH
Copy link
Author

@alixander - Thanks

I would assume that the git submodules would not be updatable via studio. Changes to them could be made via the composition configurations at the layer or scenario level.

@e-wagner-OH
Copy link
Author

I wrote some ci with GitHub actions that removes the git wrappings of the submodules, and pushes a new git repo to get the desired effect. It works pretty. Ill let you know if my team finds it useful.

@e-wagner-OH
Copy link
Author

@alixander - smaller issue with the super-diagram not creating links to the sub-diagrams in d2 studio. Looking to have the links work in both the menu to the left and the diagram. diagram # 744331451

@e-wagner-OH
Copy link
Author

Also, I think the d2 push from studio gets rid of my .github/workflows directory. I have to replace the gha I was using to create to super-diagram.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants