Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force local headings to over-ride remote #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rgee0
Copy link
Contributor

@rgee0 rgee0 commented Apr 17, 2022

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 (alexellis/go-execute#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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.

A recent issue (alexellis/go-execute#10)
indirectly highlighted that the merging of local and remote configs
was producing a superset which included duplicate headings.  The
intended mode of operation for the Issue template headings was
for the local to over-ride the remote.  This is diffent to the other
fields, such as maintainers.

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

Signed-off-by: Richard Gee <richard@technologee.co.uk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant