Workflow.yaml #2

  • //
  • guest/
  • perforce_software/
  • sdp/
  • dev/
  • Server/
  • Unix/
  • p4/
  • common/
  • bin/
  • triggers/
  • Workflow.yaml
  • View
  • Commits
  • Open Download .zip Download (4 KB)
# 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

# 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

# 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
# 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/...")
# default_reviewers: an array of user ids - reviewers to be added by by default for reviews for this project
projects:
  - name:                       ProjectA
    post_submit_create_review:  y
    pre_submit_require_review:  y
    require_job:                y
    update_review:              n
    depot_paths:
      - //depot/inside/A/...
      - //depot/inside/A1/...
      - "-//depot/inside/....c"
    default_reviewers:
      - user1
      - user2

  - name:                       ProjectB
    post_submit_create_review:  n
    pre_submit_require_review:  n
    require_job:                y
    update_review:              n
    depot_paths:
      - //depot/inside/B/...
      - //depot/inside/B2/...
    default_reviewers:
      - user1
      - user2
# Change User Description Committed
#9 26652 Robert Cowham This is Tom's change:

Introduced new 'Unsupported' directory to clarify that some files
in the SDP are not officially supported. These files are samples for
illustration, to provide examples, or are deprecated but not yet
ready for removal from the package.

The Maintenance and many SDP triggers have been moved under here,
along with other SDP scripts and triggers.

Added comments to p4_vars indicating that it should not be edited
directly. Added reference to an optional site_global_vars file that,
if it exists, will be sourced to provide global user settings
without needing to edit p4_vars.

As an exception to the refactoring, the totalusers.py Maintenance
script will be moved to indicate that it is supported.

Removed settings to support long-sunset P4Web from supported structure.

Structure under new .../Unsupported folder is:
   Samples/bin             Sample scripts.
   Samples/triggers        Sample trigger scripts.
   Samples/triggers/tests  Sample trigger script tests.
   Samples/broker          Sample broker filter scripts.
   Deprecated/triggers     Deprecated triggers.

To Do in a subsequent change: Make corresponding doc changes.
#8 25625 Robert Cowham First version of trigger to enforce stream folder naming structure - control at which
level in a stream users are allowed to create new folders.
#7 24624 Robert Cowham Add new feature/test for CheckSubmitHasReview:
- pre_submit_test_must_pass
When set, the Swarm testStatus config must equal 'pass'
#6 24158 Robert Cowham Refactor - tidy up triggers to make a little more consistent.
No functional change.
#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