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

Application strategies part1 #1186

Draft
wants to merge 44 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
bf5172c
Start of the application strategies. Add, edit and delete strategy.
IrinaSouth Oct 2, 2024
57be98f
Fix creating vs. updating strategy
IrinaSouth Oct 3, 2024
96019c8
Merge branch 'main' into feature/application-strategies-part1
IrinaSouth Oct 3, 2024
35737ba
fix async create
IrinaSouth Oct 3, 2024
8051e1d
return error if strategy already exists
IrinaSouth Oct 3, 2024
dca0e4f
tidy up old code
IrinaSouth Oct 4, 2024
0690f3e
ability to add application strategy from the feature value editing sc…
IrinaSouth Oct 22, 2024
dd6eef1
refactor feature value display on the main dashboard and add shared s…
IrinaSouth Oct 25, 2024
17e0659
make strategy editable, fix page reload, ability to remove strategy, …
IrinaSouth Oct 31, 2024
bb7f428
add backend saving support
rvowles Nov 4, 2024
6ea6161
update strategy functionality
IrinaSouth Nov 5, 2024
72e1cfe
changes to ensure we can test properly
rvowles Nov 5, 2024
f1b2122
updates
IrinaSouth Nov 5, 2024
1bedf9e
server related problems
rvowles Nov 6, 2024
fe342da
update issues
rvowles Nov 7, 2024
f0c6de0
ordering of shared strategies
rvowles Nov 7, 2024
923a484
prevent duplicate strategies being passed and sort out deleting
rvowles Nov 8, 2024
d56dc60
delete check and lock check
rvowles Nov 8, 2024
ce594db
fix behaviour when no apps present
IrinaSouth Nov 9, 2024
45c1eb4
support usage API feature
rvowles Nov 9, 2024
5f93906
updated messaging api to deliver feature diffs
rvowles Nov 9, 2024
4cb4537
add application prefix
rvowles Nov 9, 2024
60d979b
display usage in envs and features
IrinaSouth Nov 16, 2024
2a5bee6
more tests but still borked
rvowles Nov 18, 2024
606f943
add slack handlebars for application strategy
IrinaSouth Nov 19, 2024
c01f7ec
unbust build
rvowles Nov 21, 2024
01ed3d3
deal with app strategies being the _only_ thing that changed
rvowles Nov 24, 2024
7811b9f
enable reordering of app strategies
IrinaSouth Nov 27, 2024
bdda85b
add app strategy permissions
IrinaSouth Nov 29, 2024
568b88c
make table non-paginated
IrinaSouth Dec 3, 2024
87825f0
add new properties to app strategy
IrinaSouth Dec 3, 2024
ce25eaa
dawg, updated list application strategies
rvowles Dec 3, 2024
f5d4b30
update
IrinaSouth Dec 4, 2024
e5fa5f8
added pagination for application strategies
rvowles Dec 6, 2024
a8ebd68
include new permission
IrinaSouth Dec 7, 2024
9696113
lots of changes around publishing when changes happen for a app strategy
rvowles Dec 7, 2024
ca27eac
include new permission part 2
IrinaSouth Dec 7, 2024
5c8afbd
fixes around publishing behaviour + testing
rvowles Dec 9, 2024
c8efc0d
update app strategy role permissions for API
rvowles Dec 9, 2024
8062be8
set max on listing app strategies
IrinaSouth Dec 16, 2024
8204ca9
permissions fix to allow superusers and
rvowles Jan 13, 2025
d4ef295
extra tests
rvowles Jan 21, 2025
974ff4b
add search function for shared strategy and add appid into the route
IrinaSouth Jan 25, 2025
1e8ae3e
minor update to include app name on edit screen
IrinaSouth Jan 25, 2025
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
Prev Previous commit
Next Next commit
unbust build
rvowles committed Nov 21, 2024
commit c01f7ec4f2cbca968e434c85a860d8df71b3d999
Original file line number Diff line number Diff line change
@@ -22,7 +22,6 @@ class DummyPublisher : CacheSource, CacheRefresherApi {
override fun deleteEnvironment(id: UUID) {}
override fun publishFeatureChange(appFeature: DbApplicationFeature, update: PublishAction) {}
override fun publishFeatureChange(appFeature: DbApplicationFeature, update: PublishAction, featureKey: String) {}
override fun publishApplicationRolloutStrategyChange(rs: DbApplicationRolloutStrategy) {}
override fun refreshPortfolios(portfolioIds: List<UUID>) {
}

Original file line number Diff line number Diff line change
@@ -66,7 +66,8 @@ class FeatureMessagingCloudEventPublisherImplSpec extends Specification {
def lockUpdate = new SingleFeatureValueUpdate(false, false, false)
def retiredUpdate = new SingleFeatureValueUpdate(false, false, false)
def strategiesUpdate = new MultiFeatureValueUpdate(false, [], [], [])
return new FeatureMessagingParameter(dbFeatureValue, lockUpdate, defaultValueUpdate, retiredUpdate, strategiesUpdate, version)
def appStrategiesUpdate = new MultiFeatureValueUpdate(false, [], [], [])
return new FeatureMessagingParameter(dbFeatureValue, lockUpdate, defaultValueUpdate, retiredUpdate, strategiesUpdate, appStrategiesUpdate, version)
}

def "should publish FeatureMessagingUpdate cloud event"() {
Original file line number Diff line number Diff line change
@@ -79,8 +79,10 @@ class FeatureMessagingConverterImplSpec extends Specification {
def retiredUpdate = new SingleFeatureValueUpdate<Boolean>(
false, false, false)
def strategyUpdates = new MultiFeatureValueUpdate<RolloutStrategyUpdate, RolloutStrategy>(false, [], [], [])
def appStrategyUpdates = new MultiFeatureValueUpdate<RolloutStrategyUpdate, RolloutStrategy>(false, [], [], [])

def featureMessagingParameter = new FeatureMessagingParameter(dbFeatureValue, lockUpdate, defaultValueUpdate, retiredUpdate, strategyUpdates, version)
def featureMessagingParameter = new FeatureMessagingParameter(dbFeatureValue, lockUpdate, defaultValueUpdate,
retiredUpdate, strategyUpdates, appStrategyUpdates, version)

when:
def featureMessagingUpdate = featureMessagingConverter.toFeatureMessagingUpdate(
@@ -117,7 +119,9 @@ class FeatureMessagingConverterImplSpec extends Specification {
def retiredUpdate = new SingleFeatureValueUpdate<Boolean>(
true, true, false)
def strategyUpdates = new MultiFeatureValueUpdate<RolloutStrategyUpdate, RolloutStrategy>(false, [], [], [])
def featureMessagingParameter = new FeatureMessagingParameter(dbFeatureValue, lockUpdate, defaultValueUpdate, retiredUpdate, strategyUpdates, version)
def appStrategyUpdates = new MultiFeatureValueUpdate<RolloutStrategyUpdate, RolloutStrategy>(false, [], [], [])
def featureMessagingParameter = new FeatureMessagingParameter(dbFeatureValue, lockUpdate,
defaultValueUpdate, retiredUpdate, strategyUpdates, appStrategyUpdates, version)

when:
def featureMessagingUpdate = featureMessagingConverter.toFeatureMessagingUpdate(
@@ -161,8 +165,10 @@ class FeatureMessagingConverterImplSpec extends Specification {
StrategyUpdateType.ADDED.name(), null, newStrategy)

def strategyUpdates = new MultiFeatureValueUpdate<RolloutStrategyUpdate, RolloutStrategy>(true, [addStrategyUpdate], [], [])
def appStrategyUpdates = new MultiFeatureValueUpdate<RolloutStrategyUpdate, RolloutStrategy>(false, [], [], [])

def featureMessagingParameter = new FeatureMessagingParameter(dbFeatureValue, lockUpdate, defaultValueUpdate, retiredUpdate, strategyUpdates, version)
def featureMessagingParameter = new FeatureMessagingParameter(dbFeatureValue, lockUpdate,
defaultValueUpdate, retiredUpdate, strategyUpdates, appStrategyUpdates, version)

when:
def featureMessagingUpdate = featureMessagingConverter.toFeatureMessagingUpdate(
@@ -210,8 +216,10 @@ class FeatureMessagingConverterImplSpec extends Specification {
StrategyUpdateType.CHANGED.name(), oldStrategy, changedStrategy)

def strategyUpdates = new MultiFeatureValueUpdate<RolloutStrategyUpdate, RolloutStrategy>(true, [changedStrategyUpdate], [], [])
def appStrategyUpdates = new MultiFeatureValueUpdate<RolloutStrategyUpdate, RolloutStrategy>(false, [], [], [])

def featureMessagingParameter = new FeatureMessagingParameter(dbFeatureValue, lockUpdate, defaultValueUpdate, retiredUpdate, strategyUpdates, version)
def featureMessagingParameter = new FeatureMessagingParameter(dbFeatureValue, lockUpdate, defaultValueUpdate, retiredUpdate,
strategyUpdates, appStrategyUpdates, version)

when:
def featureMessagingUpdate = featureMessagingConverter.toFeatureMessagingUpdate(
@@ -260,8 +268,9 @@ class FeatureMessagingConverterImplSpec extends Specification {
def deletedStrategyUpdate = new RolloutStrategyUpdate(
StrategyUpdateType.DELETED.name(), deletedStrategy, null)
def strategyUpdates = new MultiFeatureValueUpdate<RolloutStrategyUpdate, RolloutStrategy>(true, [addStrategyUpdate, changedStrategyUpdate, deletedStrategyUpdate], [], [])

def featureMessagingParameter = new FeatureMessagingParameter(dbFeatureValue, lockUpdate, defaultValueUpdate, retiredUpdate, strategyUpdates, version)
def appStrategyUpdates = new MultiFeatureValueUpdate<RolloutStrategyUpdate, RolloutStrategy>(false, [], [], [])
def featureMessagingParameter = new FeatureMessagingParameter(dbFeatureValue, lockUpdate, defaultValueUpdate, retiredUpdate,
strategyUpdates, appStrategyUpdates, version)

when:
def featureMessagingUpdate = featureMessagingConverter.toFeatureMessagingUpdate(
@@ -308,7 +317,9 @@ class FeatureMessagingConverterImplSpec extends Specification {
def lockUpdate = new SingleFeatureValueUpdate<Boolean>(false, false, false)
def retiredUpdate = new SingleFeatureValueUpdate<Boolean>(false, false, false)
def defaultValueUpdate = new SingleNullableFeatureValueUpdate<String>(false, null, null)
def featureMessagingParameter = new FeatureMessagingParameter(dbFeatureValue, lockUpdate, defaultValueUpdate, retiredUpdate, strategyUpdates, version)
def appStrategyUpdates = new MultiFeatureValueUpdate<RolloutStrategyUpdate, RolloutStrategy>(false, [], [], [])
def featureMessagingParameter = new FeatureMessagingParameter(dbFeatureValue, lockUpdate, defaultValueUpdate, retiredUpdate,
strategyUpdates, appStrategyUpdates, version)
when:
def featureMessagingUpdate = featureMessagingConverter.toFeatureMessagingUpdate(featureMessagingParameter)
then: