-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add support to registry-support for sample checkoutFrom.revision #1209
Add support to registry-support for sample checkoutFrom.revision #1209
Comments
Blocker for #1112 |
A PR is created and currently is under review |
After the merge of the PR for the support of branches for multiple devfile versions an update to the documentation of the Registry contributing guide was added with this PR |
@thepetk is there an issue for registry-support library to support this? |
I'm working on the library part of this issue in order to be able to provide a function which will be able to return all newer (2.2.x) samples. |
@maysunfaisal I think the best way to use the new feature is to:
I was wondering if we need to create a func to wrap all this logic somewhere. If yes, where do you think it should be the best place to implement that? |
|
@maysunfaisal package main
import (
"fmt"
indexSchema "github.com/devfile/registry-support/index/generator/schema"
registryLibrary "github.com/devfile/registry-support/registry-library/library"
)
const registryURL = "https://registry.devfile.io"
func main() {
// devfiles matching debugging
fmt.Printf("** Checking registryLibrary.GetRegistryIndex() ** \n")
// indexSchema.StackDevfileType will return no results as there are no versions using schemaVersion 2.2.x
// use indexSchema.StackDevfileType to get more results
registryIndex, err := registryLibrary.GetRegistryIndex(registryURL, registryLibrary.RegistryOptions{
Filter: registryLibrary.RegistryFilter{MinSchemaVersion: "2.2.0"}, Telemetry: registryLibrary.TelemetryData{}, NewIndexSchema: true,
}, indexSchema.StackDevfileType)
if err != nil {
fmt.Printf("error:: %s", err)
} else {
for _, devfile := range registryIndex {
fmt.Printf("Devfile %s found\n", devfile.Name)
for _, version := range devfile.Versions {
fmt.Printf("Version %s - using schemaVersion %s\n", version.Version, version.SchemaVersion)
}
}
}
} This way I take only the samples using |
The issue remains under review (regarding PR which updates the contributing guide of registry). If the PR is approved, it can be merged and if the proposed solution for usage of registry support in order to filter samples is ok, we can close the issue. |
@thepetk thanks, let me try it out to see if it meets my needs! I shall get back to you shortly! |
Which area this feature is related to?
/area registry
Which functionality do you think we should add?
As mentioned in issue #1112 it could be a good solution to check inside the
extraDevfileEntries.yaml
for any branches mentioned for the git repo that each sample has.Why is this needed? Is your feature request related to a problem?
This feature will open the way to other registry features needed, like supporting multiple sample parent stacks versions while having a single repo to maintain.
Detailed description:
The idea of this feature was brought up inside the issue #1112 where we need to intoruce different versions of parent stacks per sample version. For example, a proposed update to a sample like
go-basic
would be:As you can see, we will have 2 different versions pointing to different parent stack version. Right now, with the current version of registry-support we are not able to use the same repo with different branches.
Describe the solution you'd like
Ideally we could add an additional check to the cache_samples file in order to use a specific branch when caching all samples.
So after this feature is created we can have:
As you can see, we can use the same repo but different branches in order to support different versions of parent stacks.
Describe alternatives you've considered
Other alternatives can be found here
Acceptance Criteria
checkoutFrom
and use a different branch per version of sample.Target date: 22 Aug 2023
The text was updated successfully, but these errors were encountered: