Adds configurable topic settings via yaml block
Adds a feature that allows the discoto summary to be configurable on a per-topic basis. Default settings are:
summary:
max_items: -1 # An integer. Values less than zero mean no limit
sort_by: created # One of created, updated
sort_direction: ascending # One of ascending, descending
Checklist
-
Manually verified passing unit tests for this branch locally by running bin/run_docker_tests.sh
- Yes, this is a pain, but GitLab doesn't run reasonably within a docker container in a normal CI pipeline
- See
bin/run_docker_tests.sh --help
for faster/iterative testing options
-
Paste local test output -
Add a CHANGELOG.md entry
Local Test Output
/bin/run_docker_tests.sh output
lptp [ discussion-automation ]: bin/run_docker_tests.sh --no-kill
[>>>] Will not kill docker container (can be re-used)
[>>>] Retrieving token
[>>>] GitLab should be ready
[>>>] Pasteable config into bin/.env:
[>>>]
export DISCOTO_GITLAB_ENDPOINT=http://172.17.0.2
export DISCOTO_GITLAB_TOKEN=J7oR-BpcL48SFmKp26ga
export DISCOTO_PROJECTS=test-group/test-project
export DISCOTO_GROUPS=test-group
export DISCOTO_ISSUABLE_ASSIGNEE=
export DISCOTO_ISSUABLE_AUTHOR=
export DISCOTO_ISSUABLE_LABELS=discoto
[>>>]
[>>>] Running tests on 23-configurable_discoto @ 500ad7956e3d3b1d8add5ef1e805bc365298218f
warning: parser/current is loading parser/ruby27, which recognizes
warning: 2.7.1-compliant syntax, but you are running 2.7.2.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
.................................W, [2021-03-24T14:16:14.660962 #1176049] WARN -- : Discoto::SummarySettings: Data validation errors in summary settings YAML
W, [2021-03-24T14:16:14.660993 #1176049] WARN -- : Discoto::SummarySettings: The property '#/max_items' of type string did not match the following type: integer in schema 18afbda5-bcc4-523e-9131-ee2211df885d
W, [2021-03-24T14:16:14.661005 #1176049] WARN -- : Discoto::SummarySettings: The property '#/sort_by' of type integer did not match the following type: string in schema 18afbda5-bcc4-523e-9131-ee2211df885d
W, [2021-03-24T14:16:14.661014 #1176049] WARN -- : Discoto::SummarySettings: The property '#/sort_by' value 1 did not match one of the following values: created, updated in schema 18afbda5-bcc4-523e-9131-ee2211df885d
W, [2021-03-24T14:16:14.661023 #1176049] WARN -- : Discoto::SummarySettings: The property '#/sort_direction' of type object did not match the following type: string in schema 18afbda5-bcc4-523e-9131-ee2211df885d
W, [2021-03-24T14:16:14.661032 #1176049] WARN -- : Discoto::SummarySettings: The property '#/sort_direction' value {"hello"=>10} did not match one of the following values: ascending, descending in schema 18afbda5-bcc4-523e-9131-ee2211df885d
.W, [2021-03-24T14:16:14.661399 #1176049] WARN -- : Discoto::SummarySettings: Data validation errors in summary settings YAML
W, [2021-03-24T14:16:14.661417 #1176049] WARN -- : Discoto::SummarySettings: The property '#/' of type null did not match the following type: object in schema 18afbda5-bcc4-523e-9131-ee2211df885d
........................
Finished in 2 minutes 34.3 seconds (files took 0.44532 seconds to load)
58 examples, 0 failures
Coverage report generated for RSpec to /home/james/ws/dev/gitlab/discussion-automation/coverage. 728 / 828 LOC (87.92%) covered.
[>>>] Cleaning up
[>>>] Cleaning up
Closes #23 (closed)
Edited by James Johnson