-
-
Notifications
You must be signed in to change notification settings - Fork 1
Add comprehensive Git submodule support with proper commit ordering to Jenkinsfile #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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: roryeckel <16675082+roryeckel@users.noreply.github.com>
@copilot It's not that simple - the final commit/push needs to occur for the submodules in a similar fashion to the existing logic before the parent project commits so the ref updates are properly added as a part of the commit |
- Add submodule-specific commit logic before parent repository commits - Iterate through submodules and commit changes within each submodule first - Update parent repository to capture submodule reference updates - Include submodule push support when ENABLE_GIT_PUSH is enabled - Update documentation to reflect enhanced submodule handling Co-authored-by: roryeckel <16675082+roryeckel@users.noreply.github.com>
You're absolutely right! I've enhanced the implementation to handle proper commit ordering. The pipeline now:
This ensures submodule ref updates are properly included as part of the parent commit, maintaining correct Git submodule semantics. Fixed in commit 7a7db69. |
Needs testing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive Git submodule support to the Jenkinsfile pipeline with proper commit ordering to maintain Git submodule semantics. When enabled via the new ENABLE_SUBMODULES
parameter, the pipeline will initialize and update all submodules recursively, handle change detection for submodule content, and commit changes in the correct order (submodules first, then parent repository).
- Added
ENABLE_SUBMODULES
boolean parameter (defaults to false) for backward compatibility - Enhanced pipeline stages to support submodule initialization, change detection, and proper commit ordering
- Implemented submodule-aware git operations including individual submodule pushing when changes are detected
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
README.md | Documents the new submodule feature, parameter, and updated pipeline behavior |
Jenkinsfile | Implements submodule initialization, enhanced change detection, and proper commit ordering logic |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This PR implements comprehensive Git submodule support for the Codex Jenkinsfile pipeline, including proper commit ordering to maintain Git submodule semantics.
Problem
The current Jenkinsfile performs standard Git operations (
git clone
,git checkout
,git reset
) but doesn't handle Git submodules. When working with repositories that contain submodules, the pipeline would:Solution
Added comprehensive Git submodule support with proper commit workflow:
New Parameter
ENABLE_SUBMODULES
(boolean, defaults tofalse
): When enabled, initializes and updates all Git submodules after repository checkoutEnhanced Pipeline Stages
Initialize Workspace:
git submodule init
andgit submodule update --recursive
when enabledCheck for Git Changes:
Commit and Push Changes:
ENABLE_GIT_PUSH
is enabledKey Features
--recursive
flag to handle nested submodulesUsage
To enable submodule support, simply set the
ENABLE_SUBMODULES
parameter totrue
when running the pipeline. The pipeline will then:git submodule init
git submodule update --recursive
ENABLE_GIT_PUSH
is enabledThis ensures that repositories with submodules are fully populated before Codex operations begin, and that any changes made by Codex are properly committed with correct submodule reference updates.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.