-
Notifications
You must be signed in to change notification settings - Fork 21
fix: resolve undefined variable KUBESTRONAUT_RECEIVERS in AckKubestro… #126
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
base: main
Are you sure you want to change the base?
fix: resolve undefined variable KUBESTRONAUT_RECEIVERS in AckKubestro… #126
Conversation
b4b1f3f to
37a0287
Compare
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.
Pull request overview
This PR fixes a NameError bug caused by incorrect variable naming. The environment variable KUBESTRONAUT_RECEIVERS was being stored in a variable named pwd, which would cause a crash when the code attempted to reference KUBESTRONAUT_RECEIVERS on line 29.
Key Changes:
- Renamed variable from
pwdtoKUBESTRONAUT_RECEIVERSto match the actual variable name used later in the code
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| load_dotenv() | ||
| # Store credentials | ||
| pwd = os.getenv('KUBESTRONAUT_RECEIVERS') | ||
| KUBESTRONAUT_RECEIVERS = os.getenv('KUBESTRONAUT_RECEIVERS') |
Copilot
AI
Dec 24, 2025
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.
The variable name KUBESTRONAUT_RECEIVERS is misleading for its actual usage. On line 29, this variable is used as a Google Sheets key/ID in gc.open_by_key(KUBESTRONAUT_RECEIVERS). The name suggests it contains receiver information, but it actually stores a spreadsheet identifier. Consider renaming it to something more descriptive like KUBESTRONAUT_SHEET_KEY or KUBESTRONAUT_SPREADSHEET_ID to better reflect its purpose.
| load_dotenv() | ||
| # Store credentials | ||
| pwd = os.getenv('KUBESTRONAUT_RECEIVERS') | ||
| KUBESTRONAUT_RECEIVERS = os.getenv('KUBESTRONAUT_RECEIVERS') |
Copilot
AI
Dec 24, 2025
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.
Missing validation for the environment variable. If KUBESTRONAUT_RECEIVERS is not set in the environment, os.getenv() will return None, which will cause a runtime error when passed to gc.open_by_key() on line 29. Add error handling to check if the environment variable is set and provide a clear error message if it's missing.
| KUBESTRONAUT_RECEIVERS = os.getenv('KUBESTRONAUT_RECEIVERS') | |
| KUBESTRONAUT_RECEIVERS = os.getenv('KUBESTRONAUT_RECEIVERS') | |
| if not KUBESTRONAUT_RECEIVERS: | |
| raise RuntimeError( | |
| "Environment variable 'KUBESTRONAUT_RECEIVERS' is not set. " | |
| "Please set it to the Google Sheets key before running this script." | |
| ) |
…nautsReceived.py 1. Renamed variable from 'pwd' to 'KUBESTRONAUT_RECEIVERS' to match its usage on line 29. 2. Added validation to check if the environment variable is set, providing a clear error message instead of a cryptic runtime error. Signed-off-by: LALANI DEVARSHI <thelogical369@gmail.com>
37a0287 to
6cb241e
Compare
Summary
Fixes a NameError bug in
Kubestronaut/AckKubestronautsReceived.pywhere the script would crash on execution.Problem
The environment variable was stored in a variable named
pwd: