-
Notifications
You must be signed in to change notification settings - Fork 22
calling cf-api while setting up github actions during init command #907
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?
calling cf-api while setting up github actions during init command #907
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
…n-installation-for-the-user
…n-installation-for-the-user
actually I think I've faced this issue in the past, if it it is an issue, open and resolve in a separate ticket |
KRRT7
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.
respond to the General code suggestions
|
also, have you signed our CLA? |
…n-installation-for-the-user
… HEAD state and providing fallback options. Update user prompts for API key setup and enhance error logging for better user experience.
Enhance the test suite for Git utilities by adding scenarios to check behavior when the HEAD is detached. This includes mocking the repository state to ensure proper handling in both attached and detached scenarios during branch push operations.
| try: | ||
| response = self.make_ai_service_request("/workflow-gen", payload=payload, timeout=60) | ||
| except requests.exceptions.RequestException as e: | ||
| # AI service unavailable - this is expected, will fall back to static workflow |
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 is it expected?
User description
CLI: Automate GitHub Actions Workflow Setup via API
Summary:
Updated
codeflash initto create GitHub Actions workflow PRs via the CF-API instead of writing files locally.Technical Changes:
Added API integration (
codeflash/api/cfapi.py):setup_github_actions()function calls/cfapi/setup-github-actionsto create workflow PRs remotelyUpdated GitHub Actions installation (
codeflash/cli_cmds/cmd_init.py):User Experience:
Users running
codeflash initnow see PRs created automatically with the workflow file, eliminating manual commit/push steps. The CLI handles errors gracefully and falls back to the previous behavior when needed.CLI.demo.mp4
PR Type
Enhancement
Description
Add CF-API endpoint to create workflow PR
Init uses API, with local fallback
Detect current branch for PR base
Improved user messaging and logging
Diagram Walkthrough
File Walkthrough
cfapi.py
New API client for workflow PR creationcodeflash/api/cfapi.py
setup_github_actionsAPI wrapper./setup-github-actions.cmd_init.py
Init flow uses API with fallback and UX updatescodeflash/cli_cmds/cmd_init.py
setup_github_actionsinto init flow.