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

relaxed contain rule so exports of different kinds can overlap in subjects #25

Merged
merged 1 commit into from
Dec 7, 2018

Conversation

aricart
Copy link
Member

@aricart aricart commented Dec 7, 2018

exports of same kind will generate an error if their subjects overlap or are same
exports of different kind are allowed to overlap or match a different service type

exports.go Outdated
@@ -73,10 +66,28 @@ func (e *Exports) Validate(vr *ValidationResults) error {
for k, v := range m {
var vi ValidationIssue
vi.Blocking = true
vi.Description = fmt.Sprintf("export subject %q already exports %q", k, v)
vi.Description = fmt.Sprintf("%s export subject %q already exports %q", kind.String(), k, v)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If kind has a String(), don't need it with %s.

exports_test.go Outdated
@@ -61,7 +61,7 @@ func TestExportsValidation(t *testing.T) {
exports.Add(i, i2)

vr := CreateValidationResults()
exports.Validate(vr)
_ = exports.Validate(vr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove assignment to nothing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of my tools started complaining about 'unhandled errors'

exports_test.go Outdated
@@ -92,9 +92,54 @@ func TestOverlappingExports(t *testing.T) {
exports.Add(i, i2)

vr := CreateValidationResults()
exports.Validate(vr)
_ = exports.Validate(vr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove assignment.

Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor nits.. Otherwise LGTM.

@aricart aricart merged commit 7d84585 into master Dec 7, 2018
@aricart aricart deleted the export-constraints branch December 7, 2018 17:13
@coveralls
Copy link

coveralls commented Dec 8, 2018

Pull Request Test Coverage Report for Build 127

  • 15 of 15 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.5%) to 91.123%

Totals Coverage Status
Change from base Build 122: 0.5%
Covered Lines: 852
Relevant Lines: 935

💛 - Coveralls

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

3 participants