Fix repetitive diagnosis output in init response#1890
Fix repetitive diagnosis output in init response#1890cam72cam merged 5 commits intoopentofu:mainfrom buraksenn:1812-init-response-repetitive-diags-fix
Conversation
|
Reminder for the PR assignee: If this is a user-visible change, please update the changelog as part of the PR. |
Signed-off-by: buraksenn <buraksenb@gmail.com>
fix typo in error string in test
ollevche
left a comment
There was a problem hiding this comment.
Hey @buraksenn, thank you for working on this issue!
Ignoring backDiags when we print earlyConfDiags may require users to run init multiple times just to find out there are more errors that need fixing.
I would suggest trying to consolidate those diags even if they are errors. It needs to be done delicately so we don't silence any useful messages, that are not duplicated.
That will also help with failed tests, since we don't change the existing behaviour.
Happy to answer any questions and discuss potential concerns!
That made sense to me as well but I saw that we are not consolidation error level if source is nil so thought that this would be the fix. Then the resolution would be to expand consolidateWarnings or add another method such as consolidateErrors to prevent duplicates right @ollevche ? |
|
Hmm, I've done some related work on one of my branches: 032c9ff#diff-cb9acfeab1fa4de42a8453d53172343075c9db7dfbd41d59569050760f455132 I can take some time today to get that PR ready for review. It could make sense to rebase this work on top of my changes once they are reviewed and merged. |
|
I would also prefer the opinion that consolidate duplicated error. I noticed Christian have made some progress. |
|
Long term, we should revise how and where we are loading configuration (only once). That depends on a lot of refactoring in the command package that we have not had time to start or review. The question is do we want to do a "generic" merge like in #1894 or do we want to have a more explicit "merge between these two sets" logic, which might make more sense here. |
In that case @ollevche, it probably wouldn't make sense for this PR to be based on mine, though it could be used as a reference. |
|
I want to contribute in long-term but since this is my first commit and I'm not familiar with the project structure and architecture decisions I don't want to proceed without asking in this case. So I'm not sure which approach I should take right now. I would be glad to do the work related to consolidating etc but it would be great to clarify the approach. @cam72cam should I wait for your PR to be merged to continue? |
|
@buraksenn You should be able to continue on this branch with the approach of merging two different lists of diagnostics, removing any exact duplicates. This would probably look something like: |
Thanks @cam72cam , I will continue with this. Appreciate it |
…@gmail.com> Signed-off-by: buraksenn <buraksenb@gmail.com>
|
@ollevche can you review again if possible? |
|
@buraksenn I'll take a look at the PR today. Thank you for working on this one! |
ollevche
left a comment
There was a problem hiding this comment.
Thank you for the contribution!
It looks pretty good, special kudos for adding a test. However, I think we need to change the comparison logic to something similar to ConsolidateWarnings' implementation.
Left a comment with more details.
…l.com> Signed-off-by: buraksenn <buraksenb@gmail.com>
|
Thanks @buraksenn ! |
In the issue #1812 it was explained and demonstrated clearly that init response was outputting duplicate diagnosis error. I have added
Mergemethod to diagnostics to not add exact equal diagnostics to prevent duplicates.Resolves #1812
Target Release
1.9.0
Checklist
Go checklist