Skip to content
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

Improve submodule loading #813

Merged
merged 1 commit into from
Jun 22, 2021
Merged

Improve submodule loading #813

merged 1 commit into from
Jun 22, 2021

Conversation

HeavyWombat
Copy link
Contributor

Changes

Add --depth flag to be able to configure the shallow depth setting.

Add depth setting to Git submodule command to improve loading times.

Fixes #785

Submitter Checklist

  • Includes tests if functionality changed/was added
  • Includes docs if changes are user-facing
  • Set a kind label on this PR
  • Release notes block has been filled in, or marked NONE

See the contributor guide
for details on coding conventions, github and prow interactions, and the code review process.

Release Notes

Fixed issue in source retrieval code that led to slow loading times compared to the previous implementation.

@HeavyWombat HeavyWombat added the kind/bug Categorizes issue or PR as related to a bug. label Jun 22, 2021
@openshift-ci openshift-ci bot added the release-note Label for when a PR has specified a release note label Jun 22, 2021
@gabemontero
Copy link
Member

gabemontero commented Jun 22, 2021

@HeavyWombat should we not expose a way to manipulate the setting of the new arg from https://github.com/shipwright-io/build/blob/main/pkg/reconciler/buildrun/resources/sources/git.go#L36-L43

otherwise why make it and arg at all and just hard code it

or do you plan to do that in a separate PR

@HeavyWombat
Copy link
Contributor Author

@HeavyWombat should we not expose a way to manipulate the setting of the new arg from https://github.com/shipwright-io/build/blob/main/pkg/reconciler/buildrun/resources/sources/git.go#L36-L43

otherwise why make it and arg at all and just hard code it

or do you plan to do that in a separate PR

@gabemontero Good question. I added the depth flag mostly for two reasons, one being that it was like that in the Tekton Git resource and the other one that we would be able to configure it in case we run into issues with the default value.

@SaschaSchwarze0 What is your take on this? Do you want the --depth 1 in the step configuration right away or should we tackle that with another PR?

@SaschaSchwarze0
Copy link
Member

@SaschaSchwarze0 What is your take on this? Do you want the --depth 1 in the step configuration right away or should we tackle that with another PR?

To the best I can tell is that setting this to a different value makes sense when you want to access the history of the repository for whatever reason, for example to run git log to list commits. I can understand that use case in the context of Tekton where one can run generic pipelines that might have that use case (like one that builds the commit history of a release). In the context of Shipwright and the focus on just the image building aspect, I have not come across a use case.

So, the flag on the command does not hurt. Before exposing it as a flag on a Git source item under spec.sources or the currently existing Git-specific spec.source, I would like to see a use case first.

@gabemontero
Copy link
Member

@SaschaSchwarze0 What is your take on this? Do you want the --depth 1 in the step configuration right away or should we tackle that with another PR?

To the best I can tell is that setting this to a different value makes sense when you want to access the history of the repository for whatever reason, for example to run git log to list commits. I can understand that use case in the context of Tekton where one can run generic pipelines that might have that use case (like one that builds the commit history of a release). In the context of Shipwright and the focus on just the image building aspect, I have not come across a use case.

So, the flag on the command does not hurt. Before exposing it as a flag on a Git source item under spec.sources or the currently existing Git-specific spec.source, I would like to see a use case first.

I'm good with waiting, as long as we put a comment somewhere near the flag summarizing what @SaschaSchwarze0 spelled out.

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gabemontero

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 22, 2021
Fixes #785

Add `--depth` flag to be able to configure the shallow depth setting.

Add depth setting to Git submodule command to improve loading times.
@HeavyWombat
Copy link
Contributor Author

@SaschaSchwarze0 What is your take on this? Do you want the --depth 1 in the step configuration right away or should we tackle that with another PR?

To the best I can tell is that setting this to a different value makes sense when you want to access the history of the repository for whatever reason, for example to run git log to list commits. I can understand that use case in the context of Tekton where one can run generic pipelines that might have that use case (like one that builds the commit history of a release). In the context of Shipwright and the focus on just the image building aspect, I have not come across a use case.
So, the flag on the command does not hurt. Before exposing it as a flag on a Git source item under spec.sources or the currently existing Git-specific spec.source, I would like to see a use case first.

I'm good with waiting, as long as we put a comment somewhere near the flag summarizing what @SaschaSchwarze0 spelled out.

/approve

@gabemontero @SaschaSchwarze0 Thanks for the feedback. I put in two comment sections explaining the different types of flags and that the --depth is optional and probably fine for all our use cases.

Copy link
Member

@SaschaSchwarze0 SaschaSchwarze0 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 22, 2021
@openshift-merge-robot openshift-merge-robot merged commit a5aa912 into shipwright-io:main Jun 22, 2021
@HeavyWombat HeavyWombat deleted the fix/issue-785 branch September 6, 2021 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note Label for when a PR has specified a release note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate new git step performance
4 participants