rugs icon indicating copy to clipboard operation
rugs copied to clipboard

Support depots of depth > 1

Open parnic-sks opened this issue 1 year ago • 8 comments

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.

parnic-sks avatar Jun 04 '24 05:06 parnic-sks

We use a depth of 3 for our streams, and I am about to try to integrate RoboMerge for badging. Will report back.

thejustinwalsh avatar Jul 10 '24 04:07 thejustinwalsh

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.

thejustinwalsh avatar Jul 10 '24 20:07 thejustinwalsh

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?

parnic-sks avatar Jul 10 '24 20:07 parnic-sks

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.

image

thejustinwalsh avatar Jul 10 '24 21:07 thejustinwalsh

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.

thejustinwalsh avatar Jul 11 '24 16:07 thejustinwalsh

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?

parnic-sks avatar Jul 24 '24 21:07 parnic-sks

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.

thejustinwalsh avatar Jul 25 '24 11:07 thejustinwalsh

Did not work, see:

https://github.com/jorgenpt/rugs/pull/13#issuecomment-2251073677

thejustinwalsh avatar Jul 25 '24 17:07 thejustinwalsh