jorgenpt / rugs

Rust Unreal Game Sync (UGS) server
Other
58 stars 10 forks source link

Support depots of depth > 1 #12

Open parnic-sks opened 3 months ago

parnic-sks commented 3 months ago

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.

thejustinwalsh commented 2 months ago

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

thejustinwalsh commented 2 months ago

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.

parnic-sks commented 2 months ago

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?

thejustinwalsh commented 2 months ago

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 commented 2 months ago

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.

parnic-sks commented 1 month ago

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?

thejustinwalsh commented 1 month ago

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 commented 1 month ago

Did not work, see:

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