Skip to content

[TEST] bugfix/indexed-commit-display — resolve bytebell ls commit display#58

Merged
Dead-Bytes merged 1 commit into
ByteBell:merge-test/fix_index_Dorivikafrom
Dorivika:fix/indexed-commit-display
May 21, 2026
Merged

[TEST] bugfix/indexed-commit-display — resolve bytebell ls commit display#58
Dead-Bytes merged 1 commit into
ByteBell:merge-test/fix_index_Dorivikafrom
Dorivika:fix/indexed-commit-display

Conversation

@Dorivika
Copy link
Copy Markdown

What changed

  • Added shared commit metadata helpers to validate and normalize indexed Git commit hashes.
  • Updated /api/v1/repos response shaping so legacy commitId: "latest" values do not leak into bytebell ls.
  • Updated bytebell ls and repo selector details to display the resolved indexed commit SHA instead of trusting raw source.commitId.
  • Updated GitHub pull no-op logic to use the same resolved indexed commit and normalize target SHAs before comparing.
  • Added write-side guards so invalid GitHub commit values such as "latest" cannot be persisted through setKnowledgeCommit or upsertKnowledge.
  • Added focused Bun tests for legacy "latest" metadata, mixed commit history shapes, invalid hashes, uppercase SHAs, dedupe, and empty/missing commit history.

Why

Fixes #55.

bytebell ls could show latest as the indexed commit for GitHub repositories. The issue was in the metadata/listing path: consumers trusted source.commitId directly, so a stale sentinel value like "latest" was rendered as if it were a real commit.

The fix makes commit display resolve only from valid 40-character Git SHAs. If commitId is invalid, ByteBell falls back to the newest valid SHA in commitHashes. Existing metadata is repaired at read time without requiring a Mongo migration, and future invalid writes are rejected.

How to test

  1. Install dependencies:

    bun install

@Dead-Bytes Dead-Bytes self-requested a review May 21, 2026 10:32
@Dead-Bytes Dead-Bytes added bug Something isn't working under review changes are under review labels May 21, 2026
Dead-Bytes
Dead-Bytes previously approved these changes May 21, 2026
@Dead-Bytes Dead-Bytes added the testing changes are being tested label May 21, 2026
@bharatsachya bharatsachya changed the base branch from main to pre-release May 21, 2026 10:59
@bharatsachya bharatsachya changed the base branch from pre-release to main May 21, 2026 11:06
@bharatsachya bharatsachya dismissed Dead-Bytes’s stale review May 21, 2026 11:06

The base branch was changed.

@Dead-Bytes
Copy link
Copy Markdown
Collaborator

@Dorivika i am merging this on our testing branch for further testing and then will raise PR on main

@Dead-Bytes Dead-Bytes changed the base branch from main to merge-test/fix_index_Dorivika May 21, 2026 11:27
@Dead-Bytes Dead-Bytes merged commit da6505f into ByteBell:merge-test/fix_index_Dorivika May 21, 2026
2 checks passed
@Dorivika Dorivika deleted the fix/indexed-commit-display branch May 21, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working testing changes are being tested under review changes are under review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] All the repositories shows the commit as "latest"

2 participants