# This is the config file for various workflow triggers: # - CreateSwarmReview.py # - CheckSubmitHasReview.py # - DefaultSwarmReviewDesc.py # - RequireJob.py # In an SDP installation the default location is /p4/common/config # But it can be specified on the command line (so in trigger table entry) # It is a standard Yaml format - when in doubt put quotes around string values! # api: API version for Swarm. "api/v6" is 2017.2 api: "api/v6" # user: Perforce user name to access Swarm as user: p4swarm # ticket: P4 Ticket for the above user - generate with: # p4 -u <username> login -ap ticket: AA1233C0FD5EF69605B08070AFB86711 # review_description: The default review description. # Can be a single quoted string (with embedded '\n' for newlines, or an array of quoted strings. # The values $jobDescription and $changeDescription if found will be expanded as # appropriate. review_description: - "$jobDescription" - "" - "<Please edit these fields as desired>" - "Review type: Delta/Full" # ------------------------------------------ # For CheckFixes.py # Note the use of fix_allowed_paths per project. # fix_state_field: the name of the field in the Perforce job spec fix_state_field: "JiraStatus" # link_allowed_states: An array of values for fix_state_field in which links are allowed to be created # or deleted between jobs and changelists fix_allowed_states: - "Accepted" # msg_cant_link_jobs: An array of lines for the message # For legibility it is good to have the first line blank msg_cant_link_jobs: - "" - "You are not allowed to link changes to or unlink changes from these jobs" - "because of the state of their associated JIRA issues." - "Please change the state first in JIRA and try again." # ------------------------------------------ # For CheckSubmitHasReview.py # Allow certain users to submit directly without review being required # An array of user IDs submit_without_review_users: - jenkins # msg_submit_requires_review: An array of lines for the message # For legibility it is good to have the first line blank msg_submit_requires_review: - "" - "You are not allowed to submit a change without a review." - "Please shelve the change for Swarm review first." - "Jenkins will build the change and if successful submit on your behalf." # ------------------------------------------ # Projects - an array of project entries # Each project expected to have entries for: # require_job: y/n - for pre-submit or pre-shelve trigger - whether a job is required or not # post_submit_create_review: y/n - whether to create a review on submit # pre_submit_require_review: y/n - read by CheckSubmitHasReview.py to avoid bypassing pre-submit review # Also SwarmReviewTemplate.py to set review description to value of 'review_description' # swarm_review_template: y/n - read by SwarmReviewTemplate.py (relevant if pre_submit_require_review=n) # Updates review description to value of 'review_description' # update_review: y/n - if y then try and update the first review found associated with linked job # depot_paths: an array of values for which to process other fields # Controlling here allows you to not have to update the trigger table entry every # time you wish to adjust. Also, it is possible to have this file be updated by ordinary # users and not just superusers. You can even auto-sync this file if required via trigger. # Use quotes if spaces in the path, or if you have an exclude mapping ("-//some/path/...") # fix_allowed_paths: an array of depot paths for which the CheckFixes.py checkes shown above # does not apply. This allows integrators to copy up changes (thus creating a new submit), # even when the associated issue is closed. Specify one or more paths with wildcards where # you will let submits to be handled. # Same rules for quoting as for depot_paths, and exclude mappings also possible # If field empty or not present then there are no exclusions projects: - name: ProjectA post_submit_create_review: y pre_submit_require_review: y swarm_review_template: n require_job: y update_review: n depot_paths: - //depot/inside/ - "-//depot/inside/....c" fix_allowed_paths: - //depot/inside/rel/... - name: ProjectB post_submit_create_review: n pre_submit_require_review: n swarm_review_template: y require_job: y update_review: n depot_paths: - //depot/inside/B/... - //depot/inside/C/...
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 23960 | noe_gonzalez | "Forking branch Dev of perforce-software-sdp to noe_gonzalez-sdp." | ||
//guest/perforce_software/sdp/dev/Server/Unix/p4/common/bin/triggers/Workflow.yaml | |||||
#5 | 23779 | Robert Cowham | Add new field 'swarm_review_template' to workflow.yaml and let trigger accept it. | ||
#4 | 23662 | Robert Cowham |
Allow one or more users to bypass trigger, e.g. jenkins user |
||
#3 | 23527 | Robert Cowham | Add a config option fix_allowed_paths per project for CheckFixes.py | ||
#2 | 23419 | Robert Cowham |
Refer to Workflow.yaml Change name of field from create_review to post_submit_create_review |
||
#1 | 23418 | Robert Cowham |
New trigger with test. Reworked sample yaml file to Workflow.yaml |
||
//guest/perforce_software/sdp/dev/Server/Unix/p4/common/bin/triggers/CreateSwarmReview.yaml | |||||
#3 | 23131 | Robert Cowham | New RequireJob pre-submit trigger. | ||
#2 | 23122 | Robert Cowham | Add functionality to allow depot paths to be specified in groups | ||
#1 | 23074 | Robert Cowham | Sample Yaml config file |