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

Tony new gov #192

Open
wants to merge 82 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
8921631
merged
tonytrinh3 Jun 13, 2024
326e5b0
started gov page
tonytrinh3 Jun 13, 2024
158da47
logo and home page working
tonytrinh3 Jun 17, 2024
cf2b102
added images to card
tonytrinh3 Jun 17, 2024
9054b5f
made card same size
tonytrinh3 Jun 17, 2024
043e980
replaced all with card wrapper
tonytrinh3 Jun 18, 2024
7e0f2c6
made object for all stuff on home page
tonytrinh3 Jun 18, 2024
74c0d21
added nav for gov
tonytrinh3 Jun 18, 2024
297dcc1
centralized handlelogout
tonytrinh3 Jun 18, 2024
4e0c5ce
removed handlelogout
tonytrinh3 Jun 18, 2024
0c921a3
step one of simplifying nav link
tonytrinh3 Jun 20, 2024
e8c5d29
removed variable navmobilelink
tonytrinh3 Jun 20, 2024
bfd9a4d
navlink
tonytrinh3 Jun 20, 2024
342b4a0
removed launchclub feature flag
tonytrinh3 Jun 20, 2024
68d3732
removed launchclub feature flag
tonytrinh3 Jun 20, 2024
8a31a36
popover standardized
tonytrinh3 Jun 20, 2024
810244d
standardized messaging
tonytrinh3 Jun 20, 2024
0304d04
added pic to the hashmap
tonytrinh3 Jun 21, 2024
400d779
trying to update user
tonytrinh3 Jun 26, 2024
207636e
removed christine
tonytrinh3 Jun 27, 2024
9cc4e42
added background image to gov
tonytrinh3 Jun 27, 2024
4613211
added hero imgs
tonytrinh3 Jun 27, 2024
53c53a9
added patch card
tonytrinh3 Jun 27, 2024
6d02429
text experiment
tonytrinh3 Jun 27, 2024
0c7d2c6
added change image hero
tonytrinh3 Jun 27, 2024
c5489f3
hero image cover
tonytrinh3 Jun 27, 2024
dc255d4
got hero rdesign to work
tonytrinh3 Jun 28, 2024
701eabb
got hero rdesign to work
tonytrinh3 Jun 28, 2024
ba1fa18
fixed bug card section
tonytrinh3 Jun 28, 2024
3e42f58
merged
tonytrinh3 Jun 28, 2024
96aed16
created ff in python
tonytrinh3 Jul 1, 2024
5c6c91f
updated teraform
tonytrinh3 Jul 1, 2024
4c6da90
added metric for experimentation
tonytrinh3 Jul 2, 2024
d0b83fe
added metric for experimentation
tonytrinh3 Jul 2, 2024
428d739
added metric for experimentation
tonytrinh3 Jul 2, 2024
ec9d713
added metric for experimentation
tonytrinh3 Jul 2, 2024
6c3e605
fixed audience key where it is same when you intialized the page, log…
tonytrinh3 Jul 3, 2024
d1cc496
added metrics and experiment
tonytrinh3 Jul 8, 2024
96434da
Merge branch 'main' of https://github.com/launchdarkly-labs/ld-core-d…
tonytrinh3 Jul 8, 2024
1a22a74
footer
tonytrinh3 Jul 9, 2024
9e48a42
got name into object
tonytrinh3 Jul 9, 2024
72ced02
hero styling
tonytrinh3 Jul 9, 2024
6c4d4ee
work
tonytrinh3 Jul 10, 2024
c606549
added service cards
tonytrinh3 Jul 10, 2024
3751b86
made news cards
tonytrinh3 Jul 10, 2024
60300f1
made news card
tonytrinh3 Jul 10, 2024
2d824b1
cleaned home page
tonytrinh3 Jul 11, 2024
52f0f29
fix login to get experimentaiton to work
tonytrinh3 Jul 11, 2024
a47c5c5
added login context in login component
tonytrinh3 Jul 11, 2024
7404ac4
removed unncessary props from login component
tonytrinh3 Jul 11, 2024
d21e071
removed footer from oter pages
tonytrinh3 Jul 11, 2024
daebf40
fixd login in nav
tonytrinh3 Jul 11, 2024
01e6f49
experiment
tonytrinh3 Jul 11, 2024
c7b9fa7
Merge branch 'tony_gov' of https://github.com/launchdarkly-labs/ld-co…
tonytrinh3 Jul 11, 2024
fb64032
fixed login component in nav bar
tonytrinh3 Jul 11, 2024
d8930a4
added new vertical log
tonytrinh3 Jul 11, 2024
dede0d3
added ? to includes
tonytrinh3 Jul 11, 2024
33d3552
fixed footer
tonytrinh3 Jul 11, 2024
2d1bc70
removed previous logo
tonytrinh3 Jul 11, 2024
d921f06
aded padding back in login component
tonytrinh3 Jul 16, 2024
92aafe8
fix python
tonytrinh3 Jul 17, 2024
9a7bf6a
temp remove function gov python
tonytrinh3 Jul 17, 2024
cfbc4cb
temp remove function gov python
tonytrinh3 Jul 17, 2024
5d2e835
fix chatbot surveyresponsenotification
tonytrinh3 Jul 18, 2024
2d8ce29
new persona quicklogin constant
tonytrinh3 Jul 26, 2024
f04bf0d
udpated login component
tonytrinh3 Jul 26, 2024
d9e72fc
updated navbar and constants and launchclubstatus
tonytrinh3 Jul 26, 2024
281851f
updated userobject call
tonytrinh3 Jul 26, 2024
841d626
moved over some tsx changes
tonytrinh3 Aug 21, 2024
3c3d00e
correct constants
tonytrinh3 Aug 21, 2024
1da3bbf
corrected chatbot
tonytrinh3 Aug 21, 2024
c462733
login
tonytrinh3 Aug 21, 2024
b6e3d86
added government in chat
tonytrinh3 Aug 21, 2024
d9c071b
added logo chatbot
tonytrinh3 Aug 21, 2024
5503d54
fixed government homepage
tonytrinh3 Aug 21, 2024
a53e38f
add drop down to login
tonytrinh3 Aug 21, 2024
0c4e47e
fix empty persoa
tonytrinh3 Sep 16, 2024
eda9727
added show login in navbar flag
tonytrinh3 Sep 16, 2024
a40209d
created py scrip
tonytrinh3 Sep 16, 2024
c51f446
created py scrip
tonytrinh3 Sep 16, 2024
2efd951
changed ai bot to gov
tonytrinh3 Sep 16, 2024
8bc2c88
forgot key
tonytrinh3 Sep 16, 2024
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
92 changes: 91 additions & 1 deletion .github/workflows/ld_api/create_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,103 @@
import yaml
import base64
import time


def main():

createFunnelExperiment()
createFeatureExperiment()
createAIFeatureExperiment()
createGovSignUpExperiment()

def createGovSignUpExperiment():

ld_api_key = os.getenv('LD_API_KEY')
namespace = os.getenv('NAMESPACE')
project_key = f"{namespace}-ld-demo"

if not ld_api_key:
print("LD_API_KEY not set")
exit(1)

if not namespace:
print("NAMESPACE not set")
exit(1)

variations = getAIFeatureFlagDetails()

url = "https://app.launchdarkly.com/api/v2/projects/" + project_key + "/environments/" + namespace + "/experiments"

payload = {
"name": "Hero Redesign Leading to Increase Signup Experiment",
"description": "Track which Hero Redesign Leading to Increase Signup",
"maintainerId": "6127d90d9971632664df6f1a",
"key": "gov-hero-redesign-experiment",
"iteration": {
"hypothesis": "Which hero redesign leading to increase signup",
"canReshuffleTraffic": True,
"metrics": [
{
"key": "signup-clicked",
"isGroup": False,
},
],
"primarySingleMetricKey": "signup-clicked",
"treatments": [
{
"name": variations[0]['name'],
"baseline": True,
"allocationPercent": "50",
"parameters": [
{
"flagKey": "show-hero-redesign",
"variationId": variations[0]['_id']
}
]
},
{
"name": variations[1]['name'],
"allocationPercent": "50",
"parameters": [
{
"flagKey": "show-hero-redesign",
"variationId": variations[1]['_id']
}
]
},

],
"flags": {
"show-hero-redesign": {
"ruleId": "fallthrough",
"flagConfigVersion": 1
},
},
"randomizationUnit": "audience"
}
}

headers = {
"Content-Type": "application/json",
"Authorization": ld_api_key,
"LD-API-Version": "beta"
}

response = requests.post(url, json=payload, headers=headers)

while True:
if response.status_code == 201:
print("Feature Experiment created successfully")
break
elif response.status_code == 429:
print("Rate limit exceeded, waiting 10 seconds to retry...")
time.sleep(10)
else:
data = response.json()
print(data)
print(response.status_code)
break


def createAIFeatureExperiment():

Expand Down
201 changes: 197 additions & 4 deletions .github/workflows/ld_api/create_ld_featureflags.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ def main():
createCartSuggestedItemsFeatureFlag()
createDestinationRecommendationFeatureFlag()
createAIChatbotModelsFeatureFlag()
createGovShowCardsSectionComponentFeatureFlag()
createGovPatchShowCardsSectionComponentFeatureFlag()
createGovShowHeroRedesignFeatureFlag()
createGovShowDifferentHeroImageFeatureFlag()
createShowLoginInNavbarFeatureFlag()

def createAIChatbotModelsFeatureFlag():

Expand All @@ -34,9 +39,9 @@ def createAIChatbotModelsFeatureFlag():
url = "/flags/" + project_key

payload = {
"name": "09 - LaunchAirways Chatbot (AI Models)",
"name": "Bureau of Risk Reduction Chatbot (AI Models)",
"key": "ai-chatbot",
"description": "This feature flag will change AI models in real-time for the LaunchAirways Chatbotcomponent in LaunchAirways.",
"description": "This feature flag will change AI models in real-time for the Bureau of Risk Reduction Chatbot Component.",
"clientSideAvailability": {
"usingMobileKey": True,
"usingEnvironmentId": True
Expand Down Expand Up @@ -79,7 +84,7 @@ def createAIChatbotModelsFeatureFlag():
}
],
"tags": [
"ai"
"ai", "government"
]
}
response = requests.request("POST", BASE_URL + url, headers = {'Authorization': ld_api_key, 'Content-Type': 'application/json'}, data = json.dumps(payload))
Expand Down Expand Up @@ -481,6 +486,194 @@ def createReleaseNewRecentTradesDBFeatureFlag():
if(response.status_code == 201):
print("Release New Recent Trades DB feature flag created successfully.")


def createGovShowCardsSectionComponentFeatureFlag():

print("Creating Show Cards Section Component [Gov Vertical] feature flag...")

url = "/flags/" + project_key

payload = {
"clientSideAvailability": {
"usingEnvironmentId": True,
"usingMobileKey": True
},
"key": "show-cards-section-component",
"name": "Show Cards Section Component [Gov Vertical]",
"description": "Show Cards Section Component [Gov Vertical]",
"variations": [
{
"value": True,
"name": "Show Card Section"
},
{
"value": False,
"name": "Hide Card Section"
}
],
"defaults":{
"onVariation": 0,
"offVariation": 1
},
"tags": [
"government"
]
}

response = requests.request("POST", BASE_URL + url, headers = {'Authorization': ld_api_key, 'Content-Type': 'application/json'}, data = json.dumps(payload))
if(response.status_code == 201):
print("Show Cards Section Component [Gov Vertical] feature flag created successfully.")

def createGovPatchShowCardsSectionComponentFeatureFlag():

print("Creating Patch Show Cards Section Component [Gov Vertical] feature flag...")

url = "/flags/" + project_key

payload = {
"clientSideAvailability": {
"usingEnvironmentId": True,
"usingMobileKey": True
},
"key": "patch-show-cards-section-component",
"name": "Patch Show Cards Section Component [Gov Vertical]",
"description": "Patch Show Cards Section Component [Gov Vertical]",
"variations": [
{
"value": True,
"name": "Apply Patch"
},
{
"value": False,
"name": "Not Apply Patch"
}
],
"defaults":{
"onVariation": 0,
"offVariation": 1
},
"tags": [
"government"
]
}

response = requests.request("POST", BASE_URL + url, headers = {'Authorization': ld_api_key, 'Content-Type': 'application/json'}, data = json.dumps(payload))
if(response.status_code == 201):
print("SPatch Show Cards Section Component [Gov Vertical] feature flag created successfully.")

def createGovShowHeroRedesignFeatureFlag():

print("[Experimentation] Show Hero Redesign [Gov Vertical] feature flag...")

url = "/flags/" + project_key

payload = {
"clientSideAvailability": {
"usingEnvironmentId": True,
"usingMobileKey": True
},
"key": "show-hero-redesign",
"name": "[Experimentation] Show Hero Redesign [Gov Vertical]",
"description": "[Experimentation] Show Hero Redesign [Gov Vertical]",
"variations": [
{
"value": "text-left",
"name": "Show Text Left In Hero Component"
},
{
"value": "text-right",
"name": "Show Text Right In Hero Component"
}
],
"defaults":{
"onVariation": 0,
"offVariation": 1
},
"tags": [
"government"
]
}

response = requests.request("POST", BASE_URL + url, headers = {'Authorization': ld_api_key, 'Content-Type': 'application/json'}, data = json.dumps(payload))
if(response.status_code == 201):
print("[Experimentation] Show Hero Redesign [Gov Vertical] feature flag created successfully.")

def createShowLoginInNavbarFeatureFlag():

print("Creating Show Login In Navbar [Gov Vertical] feature flag...")

url = "/flags/" + project_key

payload = {
"clientSideAvailability": {
"usingEnvironmentId": True,
"usingMobileKey": True
},
"key": "show-login-in-navbar",
"name": "Show Login In Navbar [Gov Vertical]",
"description": "Show Login In Navbar [Gov Vertical]",
"variations": [
{
"value": True,
"name": "Show Login Component In Navbar"
},
{
"value": False,
"name": "Hide Login Component In Navbar"
}
],
"defaults":{
"onVariation": 0,
"offVariation": 1
},
"tags": [
"government"
]
}

response = requests.request("POST", BASE_URL + url, headers = {'Authorization': ld_api_key, 'Content-Type': 'application/json'}, data = json.dumps(payload))
if(response.status_code == 201):
print("Show Show Login In Navbar [Gov Vertical] feature flag created successfully.")

def createGovShowDifferentHeroImageFeatureFlag():

print("[Experimentation] Show Different Hero Image [Gov Vertical] feature flag...")

url = "/flags/" + project_key

payload = {
"clientSideAvailability": {
"usingEnvironmentId": True,
"usingMobileKey": True
},
"key": "show-different-hero-image-string",
"name": "[Experimentation] Show Different Hero Image [Gov Vertical]",
"description": "[Experimentation] Show Different Hero Image [Gov Vertical]",
"variations": [
{
"value": "imageA",
"name": "imageA"
},
{
"value": "imageB",
"name": "imageB"
},
{
"value": "imageC",
"name": "imageC"
},
],
"defaults":{
"onVariation": 0,
"offVariation": 1
},
"tags": [
"government"
]
}

response = requests.request("POST", BASE_URL + url, headers = {'Authorization': ld_api_key, 'Content-Type': 'application/json'}, data = json.dumps(payload))
if(response.status_code == 201):
print("[Experimentation] Show Different Hero Image [Gov Vertical] feature flag created successfully.")

if __name__ == "__main__":
main()
21 changes: 21 additions & 0 deletions .github/workflows/ld_api/create_ld_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def createMetricsForLDProject(ld_api_key):
createInCartTotalPriceMetric(ld_api_key, createMetricURL)
createAIChatbotPositiveFeedbackMetric(ld_api_key, createMetricURL)
createAIChatbotNegativeFeedbackMetric(ld_api_key, createMetricURL)
createGovSignupClickedMetric(ld_api_key, createMetricURL)

def createAIChatbotNegativeFeedbackMetric(ld_api_key, createMetricURL):

Expand Down Expand Up @@ -268,6 +269,26 @@ def createInCartTotalPriceMetric(ld_api_key, createMetricURL):

if response.status_code == 201:
print("Metric 'In-Cart Total Price' created successfully.")

def createGovSignupClickedMetric(ld_api_key, createMetricURL):

metricPayload = {
"name": "[Gov] Signup Click in Home Page",
"eventKey": "signup clicked",
"Description": "for government signup experimentation",
"isNumeric": False,
"key": "signup-clicked",
"kind": "custom",
"successCriteria": "HigherThanBaseline",
"randomizationUnits": ["audience", "user"],
"tags": ["government"]
}

response = requests.request("POST", BASE_URL + createMetricURL, headers = {'Authorization': ld_api_key, 'Content-Type': 'application/json'}, data = json.dumps(metricPayload))

if response.status_code == 201:
print("Metric '[Gov] Signup Click in Home Page' created successfully.")


if __name__ == "__main__":
main()
Loading
Loading