Skip to content

Use API key from environment if available#242

Merged
jo-sm merged 1 commit intodevelopfrom
use-api-key-from-env
Apr 7, 2026
Merged

Use API key from environment if available#242
jo-sm merged 1 commit intodevelopfrom
use-api-key-from-env

Conversation

@jo-sm
Copy link
Copy Markdown
Member

@jo-sm jo-sm commented Apr 7, 2026

This PR passes the API key via context, and gets it from the environment if available, rather than hardcoding a test API key.

Summary by CodeRabbit

Release Notes

  • Tests
    • Updated integration test infrastructure for improved API key configuration handling in test scenarios.

@jo-sm jo-sm requested a review from konstantinoscs April 7, 2026 10:50
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cde3f338-c8cb-4f49-bd18-ff20ac5e59cf

📥 Commits

Reviewing files that changed from the base of the PR and between 6636aa9 and 46c8981.

📒 Files selected for processing (2)
  • tests/integration/features/environment.py
  • tests/integration/features/steps/cli_steps.py

📝 Walkthrough

Walkthrough

API key configuration for integration tests has been refactored to source from the TOWER_API_KEY environment variable with a fallback default value, replacing hardcoded values in test steps. The setup is initialized in the scenario hook and consumed during CLI command execution.

Changes

Cohort / File(s) Summary
Test Configuration Refactoring
tests/integration/features/environment.py, tests/integration/features/steps/cli_steps.py
API key configuration moved from hardcoded values to environment-based sourcing with fallback. The before_scenario hook now initializes context.api_key from TOWER_API_KEY env variable (defaulting to "sk-test-api-key"), and CLI steps now reference this context attribute instead of hardcoded values.

Poem

🐰 A key from the air, no longer a cage,
From environment whispers, a flexible page,
The test setup dances with configurable grace,
No hardcoded secrets, just context in place! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: using API key from environment instead of hardcoded values in tests.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch use-api-key-from-env

Comment @coderabbitai help to get the list of available commands and usage tips.

@jo-sm jo-sm changed the base branch from main to develop April 7, 2026 10:51
@tower tower deleted a comment from github-actions Bot Apr 7, 2026
@jo-sm jo-sm merged commit 74e0cb6 into develop Apr 7, 2026
32 checks passed
@jo-sm jo-sm deleted the use-api-key-from-env branch April 7, 2026 13:47
@coderabbitai coderabbitai Bot mentioned this pull request Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants