Skip to content

Add support to registry-support for sample checkoutFrom.revision #1209

@thepetk

Description

@thepetk

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:

- name: go-basic
  displayName: Basic Go
  description: Go 1.16 application
  icon: https://go.dev/blog/go-brand/Go-Logo/SVG/Go-Logo_Blue.svg
  tags:
    - Go
  projectType: Go
  language: Go
  provider: Red Hat
  versions:
    - version: 1.0.2
      schemaVersion: 2.1.0
      git:
        remotes:
          origin: https://github.com/devfile-samples/devfile-sample-go-basic.git
    - version: 2.1.0
      schemaVersion: 2.2.0
      default: true
      git:
        remotes:
          origin: https://github.com/thepetk/devfile-sample-go-basic.git

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:

 versions:
  - version: 2.1.0
    schemaVersion: 2.2.0
    default: true
    git:
      checkoutFrom:
        revision: 2.2.x
      remotes:
        origin: https://github.com/devfile-samples/devfile-sample-go-basic.git
  - version: 1.0.2
    schemaVersion: 2.1.0
    git:
      checkoutFrom:
        revision: main
      remotes:
        origin: https://github.com/devfile-samples/devfile-sample-go-basic.git

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

  • The index generator is able to detect checkoutFrom and use a different branch per version of sample.
  • All related documentation must be updated

Target date: 22 Aug 2023

Metadata

Metadata

Assignees

Labels

area/registryDevfile registry for stacks and infrastructuredemoIssue or PR candidate for a demo at the end of the Sprintseverity/blockerIssues that prevent developers from working

Type

No type

Projects

Status

Done ✅

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions