Make more API keys optional during dashboard boot by snickell · Pull Request #71560 · code-dot-org/code-dot-org

@snickell

Make the following API key secrets optional to set in locals.yml, i.e. dashboard boots w/o them now:

openai_lesson_summaries_api_key:
elevenlabs_api_key:

Follow up PR to #71274

Testing

  • DISABLE_SPRING=1 bundle exec ruby -Itest test/lib/aws_creds_must_be_optional_test.rb
  • DISABLE_SPRING=1 bundle exec ruby -Itest test/helpers/ai_lesson_summaries_helper_test.rb
  • DISABLE_SPRING=1 bundle exec ruby -Itest test/helpers/ai_lesson_summary_podcasts_helper_test.rb

@snickell

@snickell snickell changed the title Make lesson summary API keys optional during dashboard boot Make more API keys optional during dashboard boot

Mar 23, 2026

@snickell

snickell


# Mock CDO constants
CDO.stubs(:openai_lesson_summary_api_key).returns(@api_key)
CDO.stubs(:openai_lesson_summaries_api_key).returns(@api_key)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just a typo in the original

snickell

openai_student_learning_api_key:
langfuse_secret_key:
langfuse_public_key:
openai_measures_of_learning_api_key:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to delete these other ones in the earlier PRs, don't worry, this is all in seth-land (deleting these is what motivated this PR!).

@snickell

snickell

end

def self.client
# TODO before merge: CHANGE TO NEW KEY

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

# TODO before merge: CHANGE TO NEW KEY

This comment was in the original (where API_KEY is defined above) so I preserved it by default in case its an important reminder.

If you don't want it anymore click [Commit Suggestion]

Your call!

@snickell

@Nokondi if you approve PR as-is, go ahead and just merge it in, otherwise feel free to take over the PR/branch to make changes.