| {%- from "gerrit/map.jinja" import client with context %} |
| {%- set project = salt['pillar.get']('gerrit:client:project:'+project_name) %} |
| |
| {%- if project.description is defined %} |
| |
| [project] |
| description = {{ project.description }} |
| |
| {%- endif %} |
| |
| [receive] |
| requireChangeId = {{ project.get('require_change_id', True)|lower }} |
| requireContributorAgreement = {{ project.get('require_agreement', False)|lower }} |
| requireSignedOffBy = {{ project.get('require_signed_off_by', False)|lower }} |
| |
| [submit] |
| mergeContent = {{ project.get('merge_content', True)|lower }} |
| action = {{ project.get('action', 'merge if necessary')|lower }} |
| |
| {# |
| [capability] |
| administrateServer = group Administrators |
| priority = batch group Non-Interactive Users |
| streamEvents = group Non-Interactive Users |
| #} |
| |
| {%- if project.inherit_access is defined %} |
| |
| [access] |
| inheritFrom = {{ project.inherit_access }} |
| |
| {%- endif %} |
| |
| {%- for access_name, access in project.access.items() %} |
| |
| [access "{{ access_name }}"] |
| {%- for action in access.get('actions', []) %} |
| {{ action.name }} = group {{ action.group }} |
| {%- endfor %} |
| {%- for label in access.get('labels', []) %} |
| label-{{ label.name }} = {{ label.score }} group {{ label.group }} |
| {%- endfor %} |
| |
| {%- endfor %} |