Skip to content

fix: Address issues and improve code quality #80

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mirza-Samad-Ahmed-Baig
Copy link

This PR improves the security, stability, and maintainability of the WorkArena codebase through several targeted fixes and enhancements.

Security: Remove Hardcoded Password
What changed: Replaced the static password "aStrongPassword!" in src/browsergym/workarena/api/user.py with a secure, random token generated via secrets.token_urlsafe(16).

Why it was an issue: Hardcoding credentials is a critical security flaw that risks unauthorized access if the code is exposed.

Impact: Eliminates this vulnerability by ensuring each new user account receives a unique, cryptographically strong password.

API Stability: Refactor Retry Logic
What changed: Replaced a recursive call in table_api_call within src/browsergym/workarena/api/utils.py with a direct requests.request call for GET operations.

Why it was an issue: Recursive retries risked exceeding Python’s recursion limit and complicated error handling.

Impact: Provides reliable, stack-safe retry logic with predictable error management, improving ServiceNow API interaction stability.

Dependency Management: Playwright Version Pinning
What changed: Added playwright==1.53.0 to requirements.txt.

Why it was an issue: Dependency installation failures (notably with greenlet on Windows + Python 3.13) prevented the project from being installed in some environments.

Impact: Resolves a critical installation blocker, improving setup reliability and developer experience across platforms.

Code Consistency: Black Auto-Formatting
What changed: Applied Black to format the entire codebase.

Why it was an issue: Inconsistent code style increased cognitive load, hindered readability, and risked merge conflicts.

Impact: Enforces a clean, uniform code style, streamlining future development and code reviews.

Overall, these changes strengthen project security, enhance system reliability, and improve maintainability for all contributors.

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.

1 participant