-
Notifications
You must be signed in to change notification settings - Fork 205
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
Improve heuristic for detection of ARM Resource References #3832
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3832 +/- ##
==========================================
- Coverage 53.40% 53.39% -0.02%
==========================================
Files 1510 1510
Lines 545857 545863 +6
==========================================
- Hits 291532 291471 -61
- Misses 209396 209461 +65
- Partials 44929 44931 +2 ☔ View full report in Codecov by Sentry. |
"github.com/go-logr/logr" | ||
"github.com/pkg/errors" | ||
kerrors "k8s.io/apimachinery/pkg/util/errors" | ||
"regexp" |
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.
minor: stdlib, goes at the top
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.
Fixed.
@@ -20,7 +20,7 @@ import ( | |||
// TransformCrossResourceReferencesStageID is the unique identifier for this pipeline stage | |||
const TransformCrossResourceReferencesStageID = "transformCrossResourceReferences" | |||
|
|||
var armIDDescriptionRegex = regexp.MustCompile("(?i)(.*/subscriptions/.*?/resourceGroups/.*|ARM ID|Resource ID|resourceId)") |
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.
minor: Consider either colocating this regex in the pipeline stage, or putting the new regex you added in the pipeline stage here?
It feels like the armIDDescriptionRegex
and the armIDNameRegex
should be together.
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.
Moved.
What this PR does / why we need it:
As detailed in #3772 we have a few properties that are ARM Resource References, but had slipped through both our heuristic and our manual checks.
This PR improves our heuristic to try and prevent future issues.
Closes #3772
How does this PR make you feel: