Add observability into "violations" for rubocop based package protections - #9
Merged
Merged
Conversation
added 3 commits
September 7, 2022 09:25
shageman
approved these changes
Sep 7, 2022
alexevanczuk
deleted the
ae-add-observability-into-rubocop-exclusions
branch
September 7, 2022 14:09
Collaborator
|
It seems to me like concern #1 is at least as much in control of the implementing organization as counting "all" (even non-activated enforcements) for privacy and dependency. Anyone who'd like to implement the script can do so. I agree that it is a step in the right direction to expose the total metric. Maybe someone (including us) wants to invest in team and package based metrics later on. |
Collaborator
|
Filling a knowledge gap: Can someone opt accept a rubocop based protection violation by commenting on a line instead of the todo list entry? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For privacy and dependency enforcement, we have two primarily metrics:
Note that for (2), We compute this regardless of whether the enforcement is on or off at Gusto (i.e. we turn on the protection then run packwerk)
Note also that for both (1) and (2), we compute these metrics by package and also by team.
For rubocop based protections, such as typed API or namespace protection (shipped with package protections) or other Gusto-specific protections, we only count the number of packages that have the protection turned on (also aggregated by team).
We do not currently capture how many violations there are, so we do not have a true vision of progress. That is – 100% of packages can have a protection turned off with 100% of the code in those packages not conforming to the protection via rubocop exclusions.
This PR DOES capture:
This PR DOES NOT capture:
.rubocop_todo.ymlfiles and runbundle exec rubocop --only=PackageProtections/CopName --format=files. However, I'm afraid that will be a bit of a maintenance nightmare, for now. For that reason, I opted to only capture exclusions as they are in the codebase. For this reason we can expect to see the metric rapidly going up and down as folks turn protections on and off. I think this is fine. We can focus on two separate goals: getting the protection turned on, and then working the exclusions list down.