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

feat(parser) error for all inconsistent services #4171

Merged
merged 3 commits into from
Jun 15, 2023

Conversation

rainest
Copy link
Contributor

@rainest rainest commented Jun 13, 2023

What this PR does / why we need it:

Emit errors for every Service in a multi-Service backend when an annotation is inconsistent.

Previously, the parser would arbitrarily choose one annotation value as the correct value and only log errors for Services with a different value. There was no basis for choosing this as the correct value, it was just the first observed value, and there was no indication which Service was the source of the value. Logging for each informs users of the complete set of Services.

Shortens the log to remove the "review the Route" string, as we're now listing all Services of interest.

Which issue this PR fixes:

Fix #3032

Special notes for your reviewer:

The original request in #3032 was already addressed by a previous change. We were already including Service information in these logs after we converted it to a translation error. However, we would only log Services with the "incorrect" value when there was no basis for choosing the "correct" value--it was just the first one we saw in the loop.

Users need to review all involved Services to select a correct value based on external information, so we want to include all of them.

I initially adjusted the check in TestPopulateServices rather than removing it, but on further review it looks like we shouldn't be checking error count there, only that the service is indeed skipped. Error count should instead be checked for tests of individual skip reasons (it is). Left as a separate commit for comparison to the initial fix.

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@rainest rainest requested a review from a team as a code owner June 13, 2023 18:23
@rainest rainest force-pushed the feat/log-all-inconsistent branch 2 times, most recently from b5533b5 to af0ea15 Compare June 13, 2023 18:41
@codecov
Copy link

codecov bot commented Jun 13, 2023

Codecov Report

Patch coverage: 100.0% and no project coverage change.

Comparison is base (f1b345b) 60.6% compared to head (32e7749) 60.6%.

Additional details and impacted files
@@          Coverage Diff          @@
##            main   #4171   +/-   ##
=====================================
  Coverage   60.6%   60.6%           
=====================================
  Files        150     150           
  Lines      16843   16821   -22     
=====================================
- Hits       10213   10203   -10     
+ Misses      5984    5974   -10     
+ Partials     646     644    -2     
Impacted Files Coverage Δ
internal/dataplane/parser/ingressrules.go 93.7% <100.0%> (-0.1%) ⬇️

... and 4 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@rainest rainest enabled auto-merge (squash) June 13, 2023 18:50
Emit errors for every Service in a multi-Service backend when an
annotation is inconsistent.

Previously, the parser would arbitrarily choose one annotation value as
the correct value and only log errors for Services with a different
value. There was no basis for choosing this as the correct value, it was
just the first observed value, and there was no indication which Service
was the source of the value. Logging for each informs users of the
complete set of Services.
Remove the error count check from TestPopulateServices. This test checks
whether a virtual service is skipped entirely, not the reason why. While
the only existing test case does generate an error per component
Service, this may not be the case for future skip reasons.

The error count for that case (annotation mismatch) is already tested
independently in the TestDoK8sServicesMatchAnnotations test specific to
that skip reason.
Use the apimachinery Set type instead of writing the map directly.

Add comments and rename functions to clarify when we filter out
interesting annotations.

Remove old TODO.
@rainest rainest merged commit 5fa6bf1 into main Jun 15, 2023
28 checks passed
@rainest rainest deleted the feat/log-all-inconsistent branch June 15, 2023 08:48
@pmalek pmalek added this to the KIC v2.11.0 milestone Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logs for inconsistent multi-service backends do not indicate their backend
3 participants