monorepo: [bug] `repo.firstCommitHash()` returns `undefined` - the SDK can't create project ids

Problem

  1. The SDK can’t generate project ids because
  2. Lix returns undefined when the SDK calls repo.firstCommitHash()

Expected behavior

  1. The SDK generates a project_id
  2. Lix does not return undefined for repo.firstCommitHash()

Reproduction

https://github.com/opral/monorepo/assets/35429197/7bc446b4-6e34-4e44-bb19-2b1b65c7b150

  1. Start the ide extension debugger in vscode
  2. Open monorepo/inlang/source-code/end-to-end-tests/inlang-nextjs with the vscode window that is ran as debugged version
  3. set a breakpoint in generateProjectId() CleanShot 2024-01-24 at 11 50 37@2x

Other information

  • platform: node, mac os

About this issue

  • Original URL
  • State: closed
  • Created 5 months ago
  • Comments: 15 (15 by maintainers)

Commits related to this issue

Most upvoted comments

@jldec should I go ahead and push a PR loadProject to use UUID when there is no first commit?

No.

A project can’t be loaded if no repo (first commit) exists. In #2069 I recommend throwing an error like NoRepositoryExistsError. But hold on till next week. I have an idea which I thought would be too early now but it might not be and resolves this problem

New projects can use UUIDs.

We will introduce a createNewProject() function in the SDK that will create a UUID for the newly created project.

@here i have identified the bug, it was allready a bug in my todos of fixing potential bugs. as they say: “We have identified the issue and we are currently working on a resolution.”

@jldec

  1. Old projects need to be migrated with rhe same ID. Given the distributed nature, we need a common “info” from which an ID is derived. Otherwise, we will count projects multiple times and merge conflicts will arise. The first commit hash was the most realiable option. New projects can use UUIDs.

  2. no, not at the moment.

Re the video: noted. I was in a cafe when i recorded this. Recording with voice would have been rude.

@felixhaeberle this likely means that the vscode extension is used by more projects than currently known 🚀