monorepo: [bug] `repo.firstCommitHash()` returns `undefined` - the SDK can't create project ids
Problem
- The SDK can’t generate project ids because
- Lix returns
undefinedwhen the SDK callsrepo.firstCommitHash()
Expected behavior
- The SDK generates a project_id
- Lix does not return
undefinedforrepo.firstCommitHash()
Reproduction
https://github.com/opral/monorepo/assets/35429197/7bc446b4-6e34-4e44-bb19-2b1b65c7b150
- Start the ide extension debugger in vscode
- Open
monorepo/inlang/source-code/end-to-end-tests/inlang-nextjswith the vscode window that is ran as debugged version - set a breakpoint in
generateProjectId()
Other information
- platform: node, mac os
About this issue
- Original URL
- State: closed
- Created 5 months ago
- Comments: 15 (15 by maintainers)
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 problemWe 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.”
@janfjohannes https://www.loom.com/share/7cd006a145e9492ebfd0b3653f24caf2
@jldec
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.
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 🚀