Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the monorepo split functionality by updating the Docker volume mounting strategy in the GitHub workflow. The changes address issues with Git operations inside the container by ensuring consistent absolute paths between the host and container environments.
Key changes:
- Enhanced error handling with
set -euxo pipefail - Replaced simple volume mounting with absolute path resolution for Git worktree and Git directory
- Updated Docker run command to use consistent absolute paths and improved volume mounting
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| ssh-private-key: ${{ secrets[matrix.sshKey] }} | ||
|
|
||
| - name: Split monorepo | ||
| run: | |
There was a problem hiding this comment.
The set -euxo pipefail flags should be explained with a comment, as the combination of these flags (especially -x for debug output) may produce verbose logs in CI and -u for undefined variables could cause unexpected failures if variables are intentionally unset.
| run: | | |
| run: | | |
| # Enable strict error handling and verbose output: | |
| # -e: exit on error | |
| # -u: treat unset variables as errors (may cause failures if variables are intentionally unset) | |
| # -x: print commands as they are executed (can produce verbose logs in CI) | |
| # -o pipefail: fail pipelines if any command fails |
|
|
||
| # Resolve absolute paths on the host | ||
| WORKTREE="$PWD" | ||
| GITDIR="$(git rev-parse --git-dir)" |
There was a problem hiding this comment.
[nitpick] This bash pattern matching syntax [[ "${GITDIR}" != /* ]] is checking if GITDIR is not an absolute path, but it would be clearer to add a comment explaining this logic since it's not immediately obvious what /* pattern matching does.
| GITDIR="$(git rev-parse --git-dir)" | |
| GITDIR="$(git rev-parse --git-dir)" | |
| # If GITDIR is not an absolute path (does not start with '/'), prepend WORKTREE to make it absolute |
Jira: CT-XXX
Connection PR: XXX
SAPI PR: XXX
Here is successful split https://github.com/keboola/storage-backend/actions/runs/17066305653 do not ask how I did achieved this :D But it is run from this PR #229 I have cherrypicked changes from there