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

docs: Spring Boot Examples #6884

Merged
merged 3 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
326 changes: 326 additions & 0 deletions website/docs/feature-flag-tutorials/java/spring-boot-examples.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -382,3 +382,4 @@ The message rendering in the browser confirms that the app is now targeting the

In this tutorial, we created a new feature flag in Unleash and built a new page in the Spring Pet Clinic app. From there, we created two service implementations within the app for the new page and toggled between them with the feature flag. The Unleash Spring Boot SDK gave us the proper annotations to automatically toggle between the two implementations with minimal configuration.

Continue on to our [Spring Boot examples documentation](/feature-flag-tutorials/spring-boot/examples) for more advanced use cases of feature flags in Java Spring Boot using the Spring PetClinic app!
10 changes: 5 additions & 5 deletions website/docs/feature-flag-tutorials/python/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Navigate to the gradual rollout page where you can edit your strategy.

Adjust the percentage of users to 50% or whichever value you choose, and refresh your app in the browser to see if your user has the new feature experience. This might take 30 seconds for a server-side app to propagate.

![A gradual rollout form can allow you to customize your flag strategy.](/img/react-ex-grad-rollout-form.png)
![A gradual rollout form can allow you to customize your flag strategy.](/img/ex-grad-rollout-form.png)


You can achieve this same result using our API with the following code:
Expand Down Expand Up @@ -98,17 +98,17 @@ We will build a strategy constraint on our existing gradual rollout strategy. Th
In Unleash, start from the feature flag view and edit your Gradual Rollout strategy from your development environment.


![Edit your gradual rollout strategy by selecting the 'edit strategy' button.](/img/python-ex-edit-strategy.png)
![Edit your gradual rollout strategy by selecting the 'edit strategy' button.](/img/ex-edit-strategy.png)


This will take you to the gradual rollout form. Next, add a new constraint.


![Add a constraint to your strategy.](/img/python-ex-add-constraint.png)
![Add a constraint to your strategy.](/img/ex-add-constraint.png)

Let’s say we are experimenting with releasing the “delete” feature to all environments except production to test it with internal users before releasing it to all users.

![The new constraint form includes a context field, operator, and values field to customize the conditions under which a user will be exposed to the flag](/img/python-ex-constraint-page.png)
![The new constraint form includes a context field, operator, and values field to customize the conditions under which a user will be exposed to the flag](/img/ex-constraint-page.png)


We can configure the constraint in the form to match these requirements:
Expand Down Expand Up @@ -189,7 +189,7 @@ While we won’t implement all the functionality required to save and restore de

In Unleash, navigate to your gradual rollout strategy, then ‘Edit Strategy'.

![Add a variant to your gradual rollout strategy.](/img/python-ex-add-strategy-variant.png)
![Add a variant to your gradual rollout strategy.](/img/ex-add-strategy-variant.png)

In the form, add 2 variants:

Expand Down
2 changes: 1 addition & 1 deletion website/docs/feature-flag-tutorials/react/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Navigate to the Gradual Rollout form in Unleash by using the "Edit strategy" but
Adjust the percentage of users to 50% or whichever value you choose, and refresh your app in the browser to see if your user has the new feature experience.


![A gradual rollout form can allow you to customize your flag strategy.](/img/react-ex-grad-rollout-form.png)
![A gradual rollout form can allow you to customize your flag strategy.](/img/ex-grad-rollout-form.png)


You can achieve this same result using our API with the following code:
Expand Down
10 changes: 5 additions & 5 deletions website/docs/feature-flag-tutorials/ruby/ruby-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Navigate to the gradual rollout page where you can edit your strategy.

Adjust the percentage of users to 50% or whichever value you choose, and refresh your app in the browser to see if your user has the new feature experience. This might take 30 seconds for a server-side app to propagate.

![A gradual rollout form can allow you to customize your flag strategy.](/img/react-ex-grad-rollout-form.png)
![A gradual rollout form can allow you to customize your flag strategy.](/img/ex-grad-rollout-form.png)

You can achieve the same result using our API with the following code:

Expand Down Expand Up @@ -96,15 +96,15 @@ We will build a strategy constraint on our existing gradual rollout strategy. Th

In Unleash, start from the feature flag view and edit your Gradual Rollout strategy from your development environment.

![Edit your gradual rollout strategy by selecting the 'edit strategy' button.](/img/python-ex-edit-strategy.png)
![Edit your gradual rollout strategy by selecting the 'edit strategy' button.](/img/ex-edit-strategy.png)

This will take you to the gradual rollout form. Next, add a new constraint.

![Add a constraint to your strategy.](/img/python-ex-add-constraint.png)
![Add a constraint to your strategy.](/img/ex-add-constraint.png)

Let’s say we are experimenting with releasing the “delete” feature to all environments except production to test it with internal users before releasing it to all users.

![The new constraint form includes a context field, operator, and values field to customize the conditions under which a user will be exposed to the flag](/img/python-ex-constraint-page.png)
![The new constraint form includes a context field, operator, and values field to customize the conditions under which a user will be exposed to the flag](/img/ex-constraint-page.png)

We can configure the constraint in the form to match these requirements:

Expand Down Expand Up @@ -176,7 +176,7 @@ In Unleash, navigate go to a feature flag, then click on an environment to open

Click ‘Edit Strategy'

![Add a variant to your gradual rollout strategy.](/img/python-ex-add-strategy-variant.png)
![Add a variant to your gradual rollout strategy.](/img/ex-add-strategy-variant.png)

Only enable your flag for 50% of users.

Expand Down
5 changes: 5 additions & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ module.exports = {
label: 'Spring Boot',
id: 'feature-flag-tutorials/java/spring-boot-implementing-feature-flags',
},
{
type: 'doc',
label: 'Spring Boot Examples',
id: 'feature-flag-tutorials/java/spring-boot-examples',
},
],
},
{
Expand Down
Binary file added website/static/img/spring-boot-events-log.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/static/img/spring-boot-ex-edit-flag.png
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.
Binary file added website/static/img/spring-boot-ex-metrics.png
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.
Binary file added website/static/img/spring-boot-ex-variants.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.