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

scripts/promote-config: fix git submodule handling #194

Merged
merged 1 commit into from
Dec 18, 2024

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Dec 18, 2024

The --recurse-submodules option to git reset only works if there are already submodules to recurse into. In the case where we're promoting from one branch which has a submodule to one which doesn't, this will not cause a git submodule directory to be created. Instead, we need to explicitly initialize potential new submodules.

We also need to handle the case where the submodule did exist but it was bumped by the promotion and so we need to update it.

Calling git submodule update --init handles both cases.

The `--recurse-submodules` option to `git reset` only works if there are
already submodules to recurse into. In the case where we're promoting
from one branch which has a submodule to one which doesn't, this will
not cause a git submodule directory to be created. Instead, we need to
explicitly initialize potential new submodules.

We also need to handle the case where the submodule did exist but it was
bumped by the promotion and so we need to update it.

Calling `git submodule update --init` handles both cases.
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM

@dustymabe
Copy link
Member

after this merges we can add the ok-to-promote label on coreos/fedora-coreos-streams#1002 to test it - we can then close the PR since we don't want to promote yet.

@jlebon jlebon merged commit b17da8e into coreos:main Dec 18, 2024
1 check passed
@jlebon jlebon deleted the pr/fix-submodule-promote branch December 18, 2024 16:53
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.

2 participants