-
Notifications
You must be signed in to change notification settings - Fork 11
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
[Draft] feat: Server SDK Diagrams + Generator Action #657
Draft
JamieSinn
wants to merge
16
commits into
main
Choose a base branch
from
jamie/diagrams
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c909d12
Add diagrams
JamieSinn d01c293
Render PlantUML files
taplytics-robot 7403746
update action
JamieSinn 0b1878b
update action
JamieSinn b541df8
update action
JamieSinn 6ed2d33
Generate SVG files for PlantUML diagrams
JamieSinn f6732b1
Change action trigger
JamieSinn f121afe
Add titles and delete old
JamieSinn 1fe7333
Use defaulting
JamieSinn 00028dd
Fix ref checkout
JamieSinn 043b359
Generate SVG files for PlantUML diagrams
JamieSinn 3fea958
Add diagrams into docs under features.
JamieSinn def5d68
Merge branch 'main' into jamie/diagrams
andrewdmaclean dd55929
Update VSCode Extension version to 1.4.10 (#703)
taplytics-robot c03ad88
chore: update ws and braces deps (#705)
jonathannorris 448fc55
Update CLI version to v5.14.13 (#706)
taplytics-robot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Generate PlantUML Diagrams | ||
on: | ||
pull_request: | ||
paths: | ||
- 'diagrams/**.puml' | ||
|
||
permissions: | ||
contents: write | ||
jobs: | ||
generate_plantuml: | ||
runs-on: ubuntu-latest | ||
name: Generate | ||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
- name: Get changed UML files | ||
id: getfile | ||
run: | | ||
echo "::set-output name=files::$(git diff --name-only HEAD^ HEAD | grep .puml | xargs)" | ||
|
||
- name: Generate SVG Diagrams | ||
uses: holowinski/plantuml-github-action@main | ||
with: | ||
args: -v -tsvg "diagrams/**.puml" -o "../static/diagrams" | ||
|
||
- name: Push Local Changes | ||
uses: stefanzweifel/git-auto-commit-action@v4.1.2 | ||
with: | ||
commit_message: "Generate SVG files for PlantUML diagrams" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
@startuml | ||
'DevCycle Config Manager | ||
group Config Manager | ||
group Constructor/Initialization | ||
start | ||
if (options.UseRealtimeUpdates) then (yes) | ||
:Start Config Consolidation Thread; | ||
else (no) | ||
endif | ||
stop | ||
end group | ||
|
||
group Config Polling Thread | ||
start | ||
repeat :Polling Interval; | ||
if (Polling Enabled) then (yes) | ||
:Fetch Config; | ||
if (Success) then (yes) | ||
:Update Config; | ||
:Send Config Updated Event to EventHandler; | ||
else (no) | ||
repeat :Retry Fetch; | ||
repeat while (Retryable Error) is (yes) not (no) | ||
:Return error to EventHandler; | ||
kill | ||
endif | ||
else (no) | ||
:Cancel Polling; | ||
kill | ||
endif | ||
repeat while (Polling Enabled) is (yes) | ||
stop | ||
end group | ||
|
||
|
||
group Config Consolidation Thread | ||
|
||
while (Event Received) | ||
switch (Event Type) | ||
case () | ||
:New Config Available; | ||
:Fetch Config with minimum Last-Modified timestamp; | ||
case () | ||
:Config Updated; | ||
if (SSE URL is different than existing?) then (yes) | ||
:Disable SSE; | ||
:Update SSE URL; | ||
:Start SSE Connection; | ||
else (no) | ||
endif | ||
case () | ||
:SSE Connection Error; | ||
:Disable SSE; | ||
:Start Polling Thread; | ||
case () | ||
:SSE Connection Success; | ||
:Disable Polling; | ||
endswitch | ||
endwhile | ||
-[hidden]-> | ||
detach | ||
end group | ||
end group | ||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
@startuml | ||
'DevCycle Config Manager | ||
group Event Manager | ||
group Constructor/Initialization | ||
start | ||
if (options.DisableAutomaticEventLogging and options.DisableCustomEventLogging) then (yes) | ||
end | ||
else (no) | ||
:Start Event Flush Thread; | ||
endif | ||
stop | ||
end group | ||
|
||
group Event Flush Thread | ||
while (Event Received) is (not Flush Stop) | ||
switch (Event Type) | ||
case () | ||
:Flush Interval; | ||
case () | ||
:Force Flush; | ||
endswitch | ||
:Flush Events; | ||
endwhile (Flush Stop) | ||
end | ||
end group | ||
end group | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
@startuml | ||
'DevCycle Server SDK Initialization Sequence Diagram | ||
start | ||
:new DevCycleClient(sdkKey, options); | ||
group Constructor/Initialization | ||
if (Valid Server SDK Key) then (yes) | ||
if (options.UseLocalBucketing) then (yes) | ||
fork | ||
group Initialize Config Manager | ||
:Initialize Config Manager; | ||
end group | ||
fork again | ||
group Initialize Event Manager | ||
:Initialize Event Manager; | ||
end group | ||
fork again | ||
if (options.ConfigEventHandler exists) then (yes) | ||
fork | ||
group Initial Fetch Thread | ||
:Fetch Initial Config; | ||
if (Success) then (yes) | ||
:Initialize Config; | ||
else (no) | ||
if (Retryable Error) then (yes) | ||
:Retry Fetch; | ||
else (no) | ||
:return error to EventHandler; | ||
endif | ||
endif | ||
:Send Initialized Event; | ||
end group | ||
end fork | ||
else (no) | ||
:Fetch Initial Config; | ||
if (Success) then (yes) | ||
:Initialize Config; | ||
else (no) | ||
if (Retryable Error) then (yes) | ||
:Retry Fetch; | ||
else (no) | ||
:Throw error; | ||
kill | ||
endif | ||
endif | ||
endif | ||
end fork | ||
if (options.UseRealtimeUpdates) then (no) | ||
:Start Config Polling Thread; | ||
else (yes) | ||
endif | ||
else (no) | ||
if (options.ConfigEventHandler exists) then (yes) | ||
:Send Initialized Event; | ||
else (no) | ||
endif | ||
endif | ||
else (no) | ||
:SDK Key Validation Failed; | ||
:Throw error; | ||
kill | ||
endif | ||
end group | ||
:Return DevCycleClient; | ||
stop | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this option is named wrong here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's more "human" here - but if we want to make it exact that works too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well either use words or use the name of the option if youre going to write it as
options.Something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to make it clear that the value is being pulled from the options passed into the initialization call - thoughts on how to better do that? Our options aren't named consistently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
they are named consistently in most cases. Any case where they aren't should be fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact you said "most" means they aren't :P Plus - all server SDKs don't actually have this functionality enabled - so for the 1/1 for go - thoughts on using the
options.EnableRealtimeUpdates
? oroptions.DisableRealtimeUpdates
? -Go will be disabled by default - so will have Enabled as the option name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should be named the same as the existing option in the other SDKs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and it should be enabled by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until we're confident in it with the test harness - it's going to be disabled by default - cc @jonathannorris
The other SDKs this is relevant to (server sdks) do not have a current option - do we want to match the client sdks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we want it to match the client SDKs