-
Notifications
You must be signed in to change notification settings - Fork 380
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
fix: overwrite attribute values when not mergeable #1952
base: master
Are you sure you want to change the base?
Conversation
1a675a4
to
06fe94e
Compare
merger/merger.go
Outdated
} | ||
} | ||
|
||
isManaged := func(r *rule.Rule, attr string) bool { | ||
// Name and visibility are uniquely managed by gazelle. | ||
if attr == "name" || attr == "visibility" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually don't think visibility
should be here but it causes too many changes in this repo atm. I think those changes are actually correct but they could be breaking such as reducing the visibility of //internal/...
.
06fe94e
to
5a35779
Compare
5a35779
to
697c5bf
Compare
23e8768
to
40bd8f4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tyler-french Could you test this at Uber?
rule/merge.go
Outdated
@@ -41,6 +41,9 @@ import ( | |||
// marked with a "# keep" comment, values in the attribute not marked with | |||
// a "# keep" comment will be dropped. If the attribute is empty afterward, | |||
// it will be deleted. | |||
// | |||
// If src has an attribute not present in 'mergeable' and not marked with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be
// If src has an attribute not present in 'mergeable' and not marked with a | |
// If dst has an attribute not present in 'mergeable' and not marked with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment is correct as-is, although maybe confusing.
This is pointing out that attributes in src
will overwrite those in dst
if they are unknown and the value in dst
is not marked as # keep
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the comment a bit. See the fixup commits.
40bd8f4
to
e710945
Compare
08ca365
to
02d0808
Compare
I'm seeing 1000s of build files behaving differently, need to dig a bit deeper. Please hold off on merging for now |
@tyler-french what types of changes are you seeing? Are effected attributes in the |
Fix #1962
What type of PR is this?
What package or component does this PR mostly affect?
What does this PR do? Why is it needed?
Allow updating non-mergeable/resolveable attributes.
Which issues(s) does this PR fix?
Fixes #1962
Other notes for review