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

Added new --all-branches option #244

Merged
merged 15 commits into from
Jul 6, 2023

Conversation

qtzar
Copy link
Contributor

@qtzar qtzar commented Jun 14, 2023

Two new options have been added to the Generate Site command

--all-branches
--exclude-branches

This will allow the site builder to generate a site for every branch that is found in a remote repository and exclude any that have been explicitly named.

Not sure how to create a test for this, there doesn't seem to be any test for the existing site builder processes.

Copy link
Collaborator

@dirkgroot dirkgroot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this useful addition! I've added 1 remark about the naming of the new arguments.

@qtzar qtzar marked this pull request as draft June 21, 2023 12:52
@qtzar
Copy link
Contributor Author

qtzar commented Jun 21, 2023

@dirkgroot I've moved this to be a draft PR for the moment. I want to test to see what happens when if it hits a branch that does not build correctly or doesn't even have a workspace.dsl file and then do a little error trapping to skip those branches. I think this will provide a better experience.

@qtzar
Copy link
Contributor Author

qtzar commented Jun 21, 2023

@dirkgroot I think I have a good solution for site generation using --all-branches where a branch may contain malformed DSL or even doesn't contain a DSL file at all.

My first thought was to just drop a try/catch around the diagram and site generator but this would result in the bad branches still being listed in the branch switcher dropdown. To get around this I had to loop the branches twice, first to generate the diagrams and detect the errors and then a second loop to generate the actual sites after the bad branches names had been removed from the lists of found branches.

@qtzar qtzar requested a review from dirkgroot June 21, 2023 13:55
@qtzar qtzar marked this pull request as ready for review June 21, 2023 13:55
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@dirkgroot dirkgroot changed the title Added new --allbranches option Added new --all-branches option Jun 23, 2023
qtzar and others added 8 commits June 23, 2023 10:32
Co-authored-by: Dirk Groot <dirkgroot77@gmail.com>
Co-authored-by: Dirk Groot <dirkgroot77@gmail.com>
Co-authored-by: Dirk Groot <dirkgroot77@gmail.com>
…eCommand.kt

Co-authored-by: Dirk Groot <dirkgroot77@gmail.com>
…eCommand.kt

Co-authored-by: Dirk Groot <dirkgroot77@gmail.com>
…ultiBranchSupport

# Conflicts:
#	src/main/kotlin/nl/avisi/structurizr/site/generatr/GenerateSiteCommand.kt
…t loop to detect workspaces that do not compile.
Copy link
Collaborator

@dirkgroot dirkgroot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! I've added 2 suggestions to make the code more idiomatic and concise.

@qtzar qtzar requested a review from dirkgroot July 5, 2023 17:09
@qtzar
Copy link
Contributor Author

qtzar commented Jul 5, 2023

Thanks for the code review. Kotlin is not my primary language so always good to learn a few new tricks.

qtzar and others added 2 commits July 5, 2023 13:17
…ot documented as a default and probably shouldn't default it to that as it is GitHub specific.
Copy link
Collaborator

@dirkgroot dirkgroot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks for your contribution!

@dirkgroot dirkgroot merged commit 43bc0f6 into avisi-cloud:main Jul 6, 2023
@qtzar qtzar deleted the GitMultiBranchSupport branch July 6, 2023 12:06
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

Successfully merging this pull request may close these issues.

2 participants