Repository navigation
chore(lambda): remove github-oauth-bridge, redeploy scheduler-handler on al2023 (#716) - #720
Merged
Conversation
… on al2023 (#716) Closes the two operational items left on #716, and fixes three defects found doing them — two in the deploy script, one in the census I wrote an hour ago. --- github-oauth-bridge removed A Lambda exchanging a GitHub login for AWS credentials via STS, deployed January 2026 and superseded by the current portal. Verified unused before touching it: zero invocations on BOTH the function and its API Gateway over 60 days, no page on spore.host referencing its endpoint, and the spawn-dashboard Cognito pool uses Google and Globus rather than its OIDC issuer. Code and config archived first. Gone: function, API Gateway, IAM role, the role's custom policy, and lambda/github-oauth/. Its GITHUB_CLIENT_SECRET and JWT_SECRET were in plaintext environment variables and the client id was a hardcoded default in the source. Deleting AWS resources does NOT invalidate the GitHub OAuth app — that secret stays valid until revoked on GitHub, which is the one remaining action and not mine to take. --- scheduler-handler on provided.al2023, and why the script could never do it update-function-code does not change a runtime, and --runtime appeared only in the CREATE path, which never runs for an existing function. The script could therefore declare provided.al2023 and redeploy forever while the deployed function stayed on provided.al2 — exactly what happened from January to October. The configuration update now carries the runtime. That block also ended in `&>/dev/null || true`, swallowing failures silently. A step that hides its errors is a poor place to put the thing you are relying on, so it no longer does. --- the region trap, which I walked straight into REGION came from ${AWS_REGION:-us-east-1}. AWS_REGION is ambient — mine was still us-west-2 from the reaper work — so the script CREATED a second scheduler-handler in us-west-2 instead of updating the real one in us-east-1. The create path then had no wait, so the configuration update failed against a 'Creating' function. Region is now us-east-1, which is what cmd/schedule.go hardcodes (LoadInfraAWSConfig(ctx, "us-east-1")) — so a deployment anywhere else is unreachable by its only caller. Overridable only through an explicit SPAWN_LAMBDA_REGION, and a mismatched AWS_REGION is reported rather than obeyed. The create path waits for function-active-v2. The stray function was deleted; us-west-2 had 0 schedules and the copy had no invoke policy, so nothing used it. --- the census overclaimed It greps for the function NAME, and github-oauth-bridge's source was lambda/github-oauth/ — byte-identical to the deployed code and NEWER — because the directory is named for the service, not the function. So the census said "NOT in this repo at all" about code sitting in the repo. A name grep cannot prove absence, so it no longer claims to: the message says no file mentions the name and lists lambda/*/ as candidates. The strong claim was the error, not the grep. Verified: the redeploy took the UPDATE path in us-east-1; a before/after diff of the function configuration shows exactly three changes — runtime al2 to al2023, CodeSha256, and LastModified — with role, handler, timeout, memory and environment untouched. The census is now clean across declared and deployed runtimes in both accounts.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #716. The two operational items are done, and doing them surfaced three defects — two in the deploy script, one in the census I wrote an hour earlier.
github-oauth-bridgeremovedA Lambda exchanging a GitHub login for AWS credentials via STS, deployed January 2026 and superseded by the current portal. Verified unused before touching anything:
spawn-dashboardCognito pool uses Google and Globus, not its OIDC issuer — and the OIDC discovery handler wasn't even routedGone: function, API Gateway, IAM role, the role's custom policy, and
lambda/github-oauth/. Code and config archived first.One action left, and it isn't mine to take. Its
GITHUB_CLIENT_SECRETandJWT_SECRETsat in plaintext environment variables, and the client id was a hardcoded default in the source. Deleting the AWS resources does not invalidate the GitHub OAuth app — that secret stays valid until the app is revoked on GitHub.scheduler-handleronprovided.al2023, and why the script could never have done itupdate-function-codedoes not change a runtime, and--runtimeappeared only in the create path — which never runs for an existing function. So the script could declareprovided.al2023and redeploy forever while the deployed function stayed onprovided.al2. That is exactly what happened between January and October.The configuration update now carries the runtime. It also used to end in
&>/dev/null || true, swallowing failures silently — a poor property for the step you are relying on.The region trap, which I walked straight into
REGIONcame from${AWS_REGION:-us-east-1}.AWS_REGIONis ambient, mine was stillus-west-2from the reaper work, and the script created a secondscheduler-handlerin us-west-2 instead of updating the real one. The create path then had no wait, so the configuration update failed against aCreatingfunction.Region is now
us-east-1— whatcmd/schedule.gohardcodes, so anywhere else is unreachable by its only caller — overridable only through an explicitSPAWN_LAMBDA_REGION, with a mismatchedAWS_REGIONreported rather than obeyed. The create path waits forfunction-active-v2. The stray function was deleted; us-west-2 had 0 schedules and the copy had no invoke policy.The census overclaimed, and that was the error
It greps for the function name, and
github-oauth-bridge's source waslambda/github-oauth/— byte-identical to the deployed code and newer — because the directory is named for the service, not the function. So it asserted "NOT in this repo at all" about code sitting in the repo.A name grep cannot prove absence, so it no longer claims to: the message says no file mentions the name, and lists
lambda/*/as candidates. The grep wasn't wrong; the strong claim was.Verified
The redeploy took the update path in us-east-1, and a before/after diff of the function configuration shows exactly three changes:
Role, handler, timeout, memory and environment untouched — zero unintended drift. The census is clean across declared and deployed runtimes in both accounts.
One honest limit: the runtime is applied and the function is
Active, but the new static binary will not have executed until the next schedule fires. There is one schedule in us-east-1.