require 'helix_web_services_client/open_model' require 'open-uri' class HelixWebServicesClient # Create a new client workspace specification for a Helix Sync project. # # Returns a simple object with a 'client' property. def create_helix_sync_client(project_id, device, root) data = { project: project_id, device: device, root: root } obj = execute_method_with_body(:post, '/helix_sync/v1/clients', nil, data) OpenModel.new(obj) end # Get a pending changelist number for the Helix Sync project. # # If the changelist already exists, it should just return that. # # IMPORTANT: The changelist should be updated to use your local client. # You won't be able to use or submit this changelist. # # @param project_id {String} The project ID. # @return A hash containing a `change` field def create_helix_sync_pending_changelist(project_id) obj = execute_method_no_body(:post, "/helix_sync/v1/changes/#{URI.encode(project_id)}") OpenModel.new(obj) end # Retrieve the latest changelist. # # If the change doesn't exist, you'll get a ResourceNotFound exception. def fetch_helix_sync_latest_changelist(project_id) obj = execute_method_no_body(:get, "/helix_sync/v1/changes/#{URI.encode(project_id)}") OpenModel.new(obj) end # Retrieve the pending changelist. # # If the change doesn't exist, you'll get a ResourceNotFound exception. def fetch_helix_sync_pending_changelist(project_id) obj = execute_method_no_body(:get, "/helix_sync/v1/changes/#{URI.encode(project_id)}/pending") OpenModel.new(obj) end # Submits the pending changelist for the helix sync project. # # Currently this assumes that all files are shelved and nothing's open on # the client. This is likely not what we want ... but it's a start. # # @param project_id [String] def submit_helix_sync_pending_change(project_id) obj = execute_method_no_body(:post, "/helix_sync/v1/changes/#{URI.encode(project_id)}/pending") OpenModel.new(obj) end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#13 | 17274 | tjuricek |
Initial revision of Ruby client API. Removing a bunch of the "helper method aliases" and specs that no longer run. The 2016.1 API will be much more like the Java (and TBD C++) APIs. |
||
#12 | 17122 | tjuricek |
Add an optional human-readable description for submits via Helix Sync. P4WEBAPI-165 |
||
#11 | 17038 | tjuricek |
Return the results of p4 submit when Helix Sync submit finishes. We *may* want to preserve the original plan and return that, but because this submit iterates and tweaks the plan as it goes, we probably want to start with just "ok what did you do". Also, set the '+w' flag on Gemfile.lock. I think that might make builds work. |
||
#10 | 16190 | tjuricek | Implement methods for deleting shelf and device clients. | ||
#9 | 16189 | tjuricek | Implement delete for Helix Sync pending changelists on a project. | ||
#8 | 16106 | tjuricek |
Revise the URLs for Helix Sync client workspaces. Added *stubs* for deleting the clients for a user, implementations will follow. |
||
#7 | 16103 | tjuricek | Revision of helix sync 'changelist' methods. | ||
#6 | 16102 | tjuricek | Rename GET /helix-sync/v1/changes/[project] -> GET /helix-sync/v1/[project]/last-change | ||
#5 | 16097 | tjuricek |
Remove POST /helix-sync/v1/changes/[project] This will be handled by the Helix Sync client. |
||
#4 | 16096 | tjuricek | Rename '/helix_sync' URLs to '/helix-sync' | ||
#3 | 15824 | tjuricek |
Fixes to the 'preview' or 'shelf resolve plan'. There's something fundamentally off about the shelf preview and resolve mechanism, I'm still investigating. Until that point, obvious flaws should be cleared up. |
||
#2 | 15757 | tjuricek |
Add resolve implementation for submitting from shelves for Helix Sync Includes additional concepts for creating a "helix sync shelf client" vs a "helix sync device client". It's expected that there's basically one shelf client per user per project. The "device" client is an additional client per user per project per machine. The HWS services will submit via the "shelf client". The resolve implementation remains untested at the moment in order to get the client changes in the hands of Helix Sync developers. |
||
#1 | 15622 | tjuricek |
Move source code to 'source/' subdirectory of branch. build/ will remain where it is. |
||
//guest/perforce_software/helix-web-services/main/helix_web_services_client/lib/helix_web_services_client/helix_sync.rb | |||||
#6 | 15517 | tjuricek | Do not require changelist ID for submitting Helix Sync pending changelists. | ||
#5 | 15499 | tjuricek | Naive implementation of helix sync project submit for "helix versioning engine projects". | ||
#4 | 15497 | tjuricek | Add support to fetch the latest change of a project. | ||
#3 | 15496 | tjuricek |
Revise GET /helix_sync/v1/changes/[project] to /helix_sync/v1/changes/[project]/pending The base method is really intended for the latest changelist number. Meh. |
||
#2 | 15487 | tjuricek | Add basic ability to create pending changelists for helix sync projects. | ||
#1 | 15479 | tjuricek | Added a basic "HVE project" implementation for creating clients. |