-
Notifications
You must be signed in to change notification settings - Fork 39
Display git currently checked-out branch in context and file explorer modals #498
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?
Conversation
This comment has been minimized.
This comment has been minimized.
…ut branch Implements the remaining functionality from the git repo context feature: 1. **Fix 2nd branch checkout issue (Runner)**: - Modified `clone_repo_at_runtime()` in main.py to handle branch switching - When repo already exists, now fetches and checks out the requested branch - Previously skipped clone entirely if repo directory existed 2. **Add /repos/status endpoint (Runner)**: - New GET endpoint to query actual checked-out branches - Returns list of repos with current branch info from git - Used by operator to sync actual state to status 3. **Fetch and store current branch (Operator)**: - Added `fetchActualBranchesFromRunner()` helper function - Calls runner's /repos/status endpoint during reconciliation - Updates status.reconciledRepos with both intended and actual branch - New field: `currentBranch` alongside existing `branch` field 4. **Display actual branch (Frontend)**: - Updated RepositoriesAccordion to support `currentBranch` field - Changed data source from spec.repos to status.reconciledRepos - Badge now shows actual checked-out branch from runner **User Impact**: - Can now add same repo with different branches as context - Context Modal displays the actual checked-out branch - Runner properly switches branches when user adds 2nd branch - System maintains both intended (spec) and actual (status) branch info Fixes the issue described in PR ambient-code#498 where adding a 2nd branch for the same repo would show in UI but not actually checkout in the runner pod. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
6f4ad67 to
4844743
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
d60500d to
eab1369
Compare
This comment was marked as outdated.
This comment was marked as outdated.
d838363 to
6d97fd5
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
cee97b7 to
769ca2f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
769ca2f to
9ad5a71
Compare
This comment was marked as outdated.
This comment was marked as outdated.
9ad5a71 to
3ba68db
Compare
This comment was marked as outdated.
This comment was marked as outdated.
3ba68db to
9ad5a71
Compare
This comment was marked as outdated.
This comment was marked as outdated.
9ad5a71 to
7bd109d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Why use timestamp, can't you use the session id so it's easier to trace back |
…tory handling - Updated ClaudeCodeAdapter to use local variables for message IDs to prevent race conditions during concurrent runs. - Introduced a new `restart_session_tool` for handling session restarts via MCP tools. - Enhanced repository cloning logic to create and checkout feature branches named 'ambient/<session-id>' when cloning at runtime. - Modified the add_repo function to only trigger notifications for newly cloned repositories, preventing duplicate notifications. - Improved logging for better observability of session and repository operations. This refactor enhances the reliability and clarity of session management and repository interactions within the ClaudeCodeAdapter.
9837d9b to
3a2cce2
Compare
and allow for multiple branches within a git repo to be added in context modal. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: sallyom <somalley@redhat.com>
3a2cce2 to
571281c
Compare
Claude Code ReviewSummaryThis PR adds git branch visualization and multi-branch support for repositories in the Context and File Explorer modals. The implementation spans backend (Go), frontend (TypeScript/React), operator (Go), and runner (Python) components. Overall, the code quality is good with solid architecture patterns, but there are several critical security issues and code quality concerns that must be addressed before merge. Key Changes:
Issues by Severity🚫 Blocker IssuesNONE - No blocking issues that prevent merge after critical issues are fixed. 🔴 Critical Issues1. Type Assertions Without Checking (Backend) - VIOLATED RULE #4// components/backend/handlers/sessions.go:1559
session.Metadata = updated.Object["metadata"].(map[string]interface{})Issue: Direct type assertion without checking. This will panic if Required Fix (from CLAUDE.md patterns): metadata, found, err := unstructured.NestedMap(updated.Object, "metadata")
if !found || err != nil {
log.Printf("Failed to get metadata: %v", err)
c.JSON(http.StatusInternalServerError, gin.H{"error": "Failed to parse session metadata"})
return
}
session.Metadata = metadataLocation: 2. Missing User Token Validation on New Endpoint - VIOLATED RULE #1// components/backend/handlers/sessions.go:1721
func GetReposStatus(c *gin.Context) {
project := c.GetString("project")
// ... NO user token validation!Issue: The new Required Fix: func GetReposStatus(c *gin.Context) {
project := c.GetString("project")
sessionName := c.Param("sessionName")
// REQUIRED: Validate user token
reqK8s, reqDyn := GetK8sClientsForRequest(c)
if reqK8s == nil {
c.JSON(http.StatusUnauthorized, gin.H{"error": "Invalid or missing token"})
c.Abort()
return
}
// ... rest of handler
}Location: 3. Frontend: Missing Error Boundary for New
|

Uh oh!
There was an error while loading. Please reload this page.