alexellis / derek

Reduce maintainer fatigue by automating GitHub
https://github.com/alexellis/derek/blob/master/USER_GUIDE.md
MIT License
808 stars 70 forks source link

Force local headings to over-ride remote #185

Open rgee0 opened 2 years ago

rgee0 commented 2 years ago

Signed-off-by: Richard Gee richard@technologee.co.uk

Description

The intended mode of operation for the Issue template headings was for the local to over-ride the remote. This is different to the other fields, such as maintainers.

This change adds the test to highlight the issue and addresses the issue in MergeDerekRepoConfigs.

Motivation and Context

A recent issue (https://github.com/alexellis/go-execute/issues/10) indirectly highlighted that the merging of local and remote configs was producing a superset which included duplicate headings

How Has This Been Tested?

Wrote the test, and ran it:

Running tool: /usr/local/go/bin/go test -timeout 30s -run ^Test_mergeDerekRepoConfigs_UseLocalHeadings$ github.com/alexellis/derek/types

--- FAIL: Test_mergeDerekRepoConfigs_UseLocalHeadings (0.00s)
    /Users/rgee0/go/src/github.com/alexellis/derek/types/merge_test.go:102: RequiredInIssues want [#2], but got [#1 #2 #2]
FAIL
FAIL    github.com/alexellis/derek/types    0.229s
FAIL

Note the got set is a merge of the remote and local so includes #2 twice.

Amended MergeDerekRepoConfigs() so that if required_in_issue is set locally then those values will take precedence. Re-ran the test:

Running tool: /usr/local/go/bin/go test -timeout 30s -run ^Test_mergeDerekRepoConfigs_UseLocalHeadings$ github.com/alexellis/derek/types

ok      github.com/alexellis/derek/types    0.233s

Ran a build using the Dockerfile.

Types of changes

Checklist: