-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feat(site launch): support for multiple sites #665
Feat(site launch): support for multiple sites #665
Conversation
import .env var for github system token
marked as draft btw |
microservices/site-launch/lambda-functions/redirection-domain-validation/index.ts
Outdated
Show resolved
Hide resolved
microservices/site-launch/lambda-functions/redirection-domain-validation/index.ts
Outdated
Show resolved
Hide resolved
microservices/site-launch/lambda-functions/redirection-domain-validation/index.ts
Outdated
Show resolved
Hide resolved
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.
1 question, rest seems fine
} | ||
if (fileExists) return | ||
await octokit.request( |
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.
when will we ever hit this line? fileExists
is true by default and when it's false
, we do an early return
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.
1bea09a arh you are right, modified!
Problem
The Site Launch form returns an email per site. Ie when using the form to launch 5 sites, the cms backend will return 5 different emails. This can be a hassle for Ops as they have to keep sieving through each of the email to get the site details.
This PR modifies the site launch logic such that the DNS details of the site launches are consolidated into at most 2 emails (one for successful launches and one for unsuccessful launches)
Other sub-issues closed:
The current code in redirection domain lambda is wrong since
octokit.request()
doesn't return an 404 when a file is not found. Instead, it throws an error, which caused our redirection lambda to crash.Solution
Rather than sending an email directly to Ops per site launch, now only two emails are sent back to ops. (one for success, and another for failure)
Breaking Changes
Tests
To just test the functionality of redirection domain lambda:
npm run deploy:dev -- --stage kishore-test
command)testEvent
.You can change the test object to:
{ "primaryDomainSource": "<some-other-url>.isomer.gov.sg", "redirectionDomain": [ { "source": "www.<some-other-url>.isomer.gov.sg", "target": "18.136.36.203", "type": "A" } ] }
, as long as the .conf file never existed in our branch, it should be updated here. This branch is being used for testing anyways, feel free to test with whatever values you like.Here is a short video I made to show a trivial testing of the current state of site the site launch form:
video1052080339.mp4
To replicate the example shown in the video, one would need to
Form Secret Key Dev Site Launch
outgoingQueue
tooutgoingQueueKishoreTest
sites
,repos
anddeployments
ngrok http 8081
launches
andredirections
table.Deploy Notes
This PR will have conflicts with the recent changes in node var, and the changes with convict PR. These will be addressed in a separate PR, when the changes in identity gets merged into develop. Issues have been raised here and here.
New Env Vars
SITE_LAUNCH_FORM_KEY -> use updated value in 1pw
Review Notes
I feel weird about the naming convention for this function, open to suggestions for this!