-
Notifications
You must be signed in to change notification settings - Fork 163
[registry] Fix ArtifactHub sourceURL to persist actual package URL #834
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: aabidsofi19 <65964225+aabidsofi19@users.noreply.github.com>
Co-authored-by: aabidsofi19 <65964225+aabidsofi19@users.noreply.github.com>
|
@copilot looking good . but we are still missing upsert the sourceURL to actual package url into csv . so during first generation search by name and once package is resolved set the SourceURL of csv to actual url not search url and on subsequent updates use this url |
…rsistence Co-authored-by: aabidsofi19 <65964225+aabidsofi19@users.noreply.github.com>
Updated in commit 2d3f1ad. The CSV model's The flow now works as:
|
|
@copilot why are you still reading from disk if the sourceURL in spreadsheet is set to resolved packkage url |
You're right! The disk reading is now redundant. Since we're updating the CSV's |
|
good do it |
|
@copilot after done also update documentation with correct flow |
Co-authored-by: aabidsofi19 <65964225+aabidsofi19@users.noreply.github.com>
Co-authored-by: aabidsofi19 <65964225+aabidsofi19@users.noreply.github.com>
Documentation added in commit 2c258b1. Created comprehensive documentation in
The documentation clearly shows how the sourceURL field is used as a search query initially, then updated to the actual package URL, and reused directly in subsequent updates. |
|
@copilot use the already existing step for writing to fs . we shouldnt write the model again |
… with source_uri support Co-authored-by: aabidsofi19 <65964225+aabidsofi19@users.noreply.github.com>
Fixed in commit 56606e1. Removed the duplicate model write by:
|
Problem Statement
When generating components from ArtifactHub, the model's
sourceURLwas set to the search query instead of the chosen package's actual URL. This caused subsequent updates to re-search ArtifactHub rather than directly using the resolved package URL.Solution Overview
The fix ensures that:
source_uriSourceURLfieldSourceURLis persisted to the Google SpreadsheetSourceURLdirectly (no disk reading needed)Changes Made
1.
generators/artifacthub/package_manager.goModified
GetPackage()method:SourceURLis an actual URL (starts with http://, https://, or oci://)AhPackagedirectly with that ChartUrl instead of searching2.
registry/model.goEnhanced UpdateModelDefinition:
sourceURLtomodelMetadataValuesarraysourceURLcase to store it assource_uriin model metadataSimplified model generation flow:
model.SourceURLfrom the CSVmodel.SourceURLto actual package URL BEFORE callingwriteModelDefToFileSystemwriteModelDefToFileSystemcreates model with source_uri already set via UpdateModelDefinitionModified
GenerateComponentsFromPkg()function:source_urifrom the package's actual URL3.
generators/artifacthub/package_test.goAdded
TestGetPackageWithDirectURL():4.
generators/readme.mdAdded comprehensive documentation:
How It Works
First Generation (New Model)
SourceURLas a search query (e.g., "consul")model.SourceURLupdated to actual package URLwriteModelDefToFileSystemcreates model with source_uri from SourceURLSubsequent Updates
SourceURL= actual URL (not search query)model.SourceURLdirectly (no disk reading!)Benefits
Testing
TestGetPackageWithDirectURLto verify direct URL handlingOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.