shotgunsoftware / tk-core

The Flow Production Tracking Pipeline Toolkit Core API
https://developer.shotgridsoftware.com/tk-core/
Other
91 stars 116 forks source link

Add Perforce Changelist and Labels descriptors for config deployment from perforce server. #993

Open HaydenA-nDreams opened 1 day ago

HaydenA-nDreams commented 1 day ago

Goal

Use descriptors so that TK can communicate with perforce servers for tracking bundles. This change add support so TK can communicate with a perforce server to track against changelists and labels.

Issue

This works for bundle deployment however we are unable to use for our config & core deployment. I believe this is due to Shotgrid Desktop app and tk-framework-desktopstartup use the latest GitHub release first. Having this there would allow us to use perforce fully for our distributed configs and provide any other studios that would like to deploy from Perforce.

Usage

perforce_change

    {
        type: perforce_change,
        path: //DEPOT/AppStore/tk-multi-loader2
        changelist: 12345
    }

sgtk:descriptor:perforce_change?path=//DEPOT/AppStore/tk-multi-loader2&changelist=12345

perforce_label


    {
        type: perforce_label
        path: //DEPOT/AppStore/tk-multi-loader2
        label: v3.0.0
    }

sgtk:descriptor:perforce_label?path=//DEPOT/AppStore/tk-multi-loader2&label=v3.0.0

Note

This change is not so much of a way to support Source control from perforce in ShotGrid but just for ShotGrid to get bundles from perforce much like Git.

codecov[bot] commented 1 day ago

Codecov Report

Attention: Patch coverage is 24.00000% with 171 lines in your changes missing coverage. Please review.

Project coverage is 73.13%. Comparing base (67de82a) to head (1da0c8e).

Files with missing lines Patch % Lines
python/tank/descriptor/io_descriptor/perforce.py 22.82% 71 Missing :warning:
...on/tank/descriptor/io_descriptor/perforce_label.py 21.53% 51 Missing :warning:
...n/tank/descriptor/io_descriptor/perforce_change.py 22.22% 49 Missing :warning:

:exclamation: There is a different number of reports uploaded between BASE (67de82a) and HEAD (1da0c8e). Click for more details.

HEAD has 1 upload less than BASE | Flag | BASE (67de82a) | HEAD (1da0c8e) | |------|------|------| ||12|11|
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #993 +/- ## ========================================== - Coverage 79.78% 73.13% -6.65% ========================================== Files 198 201 +3 Lines 20770 20994 +224 ========================================== - Hits 16571 15354 -1217 - Misses 4199 5640 +1441 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

HaydenA-nDreams commented 1 day ago

Added tests, however this would require a perforce depot and p4 application. As well as some paths, commits & labels to match for the build machines.