Skip to content

Suggested update to PR https://github.com/devfile/api/pull/580 #1

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

Merged
merged 1 commit into from
Aug 11, 2021

Conversation

amisevsk
Copy link

What does this PR do?

As we briefly discussed, this PR is an example of embedding the GitProjectSource into another struct in order to extend it with additional fields. This allows reuse of the existing GitProjectSource, which is reused elsewhere in the API, while moving the Git-only field GitLocation within that section of JSON.

I didn't regenerate files for readability, but the net effect is moving the GitLocation field down a level.

What issues does this PR fix or reference?

Is your PR tested? Consider putting some instruction how to test your changes

Docs PR

Moves GitLocation in DockerfileImage Image component type under the Git
struct to make clear that this field is intended only for use when
specifying a git repo.

(Files not regenerated for readability)

Signed-off-by: Angel Misevski <[email protected]>
@@ -66,3 +62,11 @@ type Dockerfile struct {
// +optional
RootRequired bool `json:"rootRequired,omitempty"`
}

type DockerfileGitProjectSource struct {
GitProjectSource `json:",inline"`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it really be GitProjectSource? Like why dockerfileGitSource needs a name, attributes, clonePath?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the main concern was reusing the struct from projects/starterprojects

Like why dockerfileGitSource needs a name, attributes, clonePath?

I'm not sure what you mean -- with this change, a component would look something like

components:
  - name: my-component
    image:
      git:
        gitLocation: "build/Dockerfile"
        checkoutFrom:
          remote: amisevsk
          revision: devel-branch
        remotes:
          origin: https://github.com/devfile/api
          amisevsk: https://github.com/amisevsk/api

(with checkoutFrom optional when there's only one remote)

This comment was marked as outdated.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my fault

@maysunfaisal maysunfaisal merged commit e42ab74 into maysunfaisal:51-1 Aug 11, 2021
@amisevsk amisevsk deleted the 51-1 branch August 11, 2021 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants