Support depots of depth > 1
Our Perforce depots use a 4-depth system to help organize branches. RUGS doesn't seem to recognize this format as it's not reporting badges for our builds made in other streams.
Docker logs look like this:
2024-04-11T15:39:10.763075Z INFO rugs::handlers: Creating new project for stream //project/mainline, project name main/core/projectgame
2024-06-03T15:19:06.683648Z INFO rugs::handlers: Creating new project for stream //project/mainline, project name release/demo/projectgame
When I'd expect to see something like this instead:
2024-04-11T15:39:10.763075Z INFO rugs::handlers: Creating new project for stream //project/mainline/main/core, project name projectgame
2024-06-03T15:19:06.683648Z INFO rugs::handlers: Creating new project for stream //project/mainline/release/demo, project name projectgame
We are seeing badges in mainline properly, and I'm assuming that's because it was the first branch/stream for the entire depot.
We use a depth of 3 for our streams, and I am about to try to integrate RoboMerge for badging. Will report back.
Added release branch and no metadata. I'll attempt a PR to resolve this. I'm thinking of an environment variable that accepts the same depth value as P4 when creating the stream depo.
I don't think / can be in a stream name, so would it be safe to grab the last index of / when trying to find the project name?
Ahh, P4 indeed enforces that your stream name can not have more slashes than your depot depth. If you are trying to determine a subpath of the stream, depth seems necessary, though.
PR in; however, migrating the data from the incorrect project name in the DB to the correct one before updating would still be an exercise for the user.
I am going to push up a container and give it a test in my live instance.
PR in; however, migrating the data from the incorrect project name in the DB to the correct one before updating would still be an exercise for the user.
I am going to push up a container and give it a test in my live instance.
How did the tests go? Is this ready to merge?
Testing this now, currently stalled on working through what the migration query. I think I can run a slightly insane query to update the paths in the DB, and then test.
Did not work, see:
https://github.com/jorgenpt/rugs/pull/13#issuecomment-2251073677