address pending comments from amp's review and fix lint errors#7
Open
Kiran01bm wants to merge 3 commits intoblock:mainfrom
Open
address pending comments from amp's review and fix lint errors#7Kiran01bm wants to merge 3 commits intoblock:mainfrom
Kiran01bm wants to merge 3 commits intoblock:mainfrom
Conversation
d189ca6 to
4cfa6d9
Compare
Co-authored-by: Claude Code <noreply@anthropic.com> Ai-assisted: true
Co-authored-by: Claude Code <noreply@anthropic.com> Ai-assisted: true
Contributor
|
pkg/eol/endoflife/provider_test.go — import "strings"
// then:
if err != nil && !strings.Contains(err.Error(), "non-standard") { |
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.
What and Why ?
This PR applies suggestions from amp's internal code review. These changes address 3 main areas: preventing misuse of the generic EOL provider for products with non-standard schemas, eliminating code duplication in inventory sources, and improving documentation for design decisions.
This PR also bulk addresses all the lint check failures in a disctinct atomic commit.
Changes
1. EKS Non-Standard Schema Protection 🔒
Problem: EKS uses a non-standard schema on endoflife.date where
cycle.EOLmeans "end of standard support" (NOT true EOL). If someone accidentally used the genericendoflife.Providerfor EKS instead of the dedicatedEKSEOLProvider, dates would be silently wrong.Solution:
ProductsWithNonStandardSchema = []string{"amazon-eks"}blocklistListAllVersions()rejects blocked products with clear error:engine eks (product: amazon-eks) uses non-standard endoflife.date schema
and cannot use generic provider; use dedicated provider instead (e.g., EKSEOLProvider)
TestProvider_BlocksNonStandardSchema()verifying all EKS variants are blocked2. CSV Duplication Elimination 🧹
Problem: Aurora, EKS, and ElastiCache inventory sources had ~43 lines of identical CSV-row-iteration + error-handling logic, risking copy-paste drift.
Solution:
parseWizReport()helper inpkg/inventory/wiz/helpers.go//nolint:duplcommentsImpact:
3. Version-Not-Found Design Documentation 📝
Problem: Missing explanation for why providers return lifecycle with empty
Versionrather than error when version not found.Solution: Added comprehensive design decision comments to all three EOL providers:
Breaking Changes
None. All changes are backward compatible