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

[project-clone] Initialize and update submodules when present in project #1167

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

amisevsk
Copy link
Collaborator

@amisevsk amisevsk commented Aug 21, 2023

What does this PR do?

If a cloned-and-checked-out project has a .gitmodules file in the root of the repo, run git submodule update --init --recursive inside the project to clone all submodules.

Failures in setting up submodules result only in a warning log and do not prevent the project from being 'set up', as the user can later initialize submodules manually.

What issues does this PR fix or reference?

Closes #949

Is it tested? How?

Can be tested by cloning https://github.com/dkwon17/submodule-test

Changes are built and pushed to quay.io/amisevsk/project-clone:submodules. To test changes with an existing DevWorkspace Operator, set the RELATED_IMAGE_project_clone environment variable to quay.io/amisevsk/project-clone:submodules

  • Kubernetes/OpenShift manual install: update the devworkspace-controller deployment directly
  • OpenShift Operator subscription: update the devworkspace-operator CSV .spec.install.spec.deployments[0] and wait for the controller to roll out

PR Checklist

  • E2E tests pass (when PR is ready, comment /test v8-devworkspace-operator-e2e, v8-che-happy-path to trigger)
    • v8-devworkspace-operator-e2e: DevWorkspace e2e test
    • v8-che-happy-path: Happy path for verification integration with Che

If a cloned-and-checked-out project has a .gitmodules file in the root
of the repo, run 'git submodule update --init --recursive' inside the
project to clone all submodules.

Failures in setting up submodules result only in a warning log and do
not prevent the project from being 'set up', as the user can later
initialize submodules manually.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
Copy link
Collaborator

@AObuchow AObuchow left a comment

Choose a reason for hiding this comment

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

LGTM, works as expected with the reproducer 👍

@openshift-ci
Copy link

openshift-ci bot commented Aug 21, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amisevsk, AObuchow, dkwon17

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

@amisevsk amisevsk merged commit 9983798 into devfile:main Aug 22, 2023
6 checks passed
@amisevsk amisevsk deleted the project-clone-submodules branch August 22, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Have project-clone container clone git submodules
3 participants