-
Notifications
You must be signed in to change notification settings - Fork 1
Add some new utility and info functions to Tower SDK #168
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
Conversation
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 adds new utility and diagnostic functions to the Tower SDK, making it easier for users to access runtime information, retrieve parameters and secrets, and check execution context.
Changes:
- Added a new
infomodule with functions to retrieve runtime environment details (schedule info, run metadata, runner details, execution context) - Added utility functions in
_utils.pyfor accessing parameters and secrets from environment variables - Exposed the new
infomodule and utility functions through the main SDK package
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/tower/info/init.py | Implements diagnostic functions to retrieve runtime environment information such as schedule details, run metadata, hostname/port, runner info, and execution context |
| src/tower/_utils.py | Adds utility functions for retrieving parameters and secrets from environment variables |
| src/tower/init.py | Exports the new utility functions and info module to make them accessible to SDK users |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
konstantinoscs
left a comment
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.
LGTM
| return os.getenv(name, default) | ||
|
|
||
|
|
||
| def parameter(name: str, default: str = ""): |
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.
why?
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.
Just for convenience.
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.
Then why not just get rid of the param method altogether? feels weird
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Title says it all. We need some new utility functions in the Tower SDK that make it easier to get diagnostic info (see the
infomodule) as well as get getting parameters and secrets. This just makes things a little easier for users.