Introduce checkout-to-release script - #117
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new top-level helper script intended to synchronize all checked-out subrepositories under repos/ to a specified RELEASE-* tag, with a fallback mechanism when a tag isn’t present in a given subrepo.
Changes:
- Introduces
checkout-to-release.shto iterate over known subrepo directories and checkout a requested release tag. - Adds a fallback behavior that attempts to checkout a “latest” tag when the requested tag isn’t available.
Comments suppressed due to low confidence (1)
checkout-to-release.sh:83
git checkoutfailures (e.g., dirty worktree / missing tag) are not handled, but the script prints a success message regardless. Also,git rev-parse "$TAG"can resolve non-tag refs, and the fallback tag selection is based on creation date and may pick non-release tags.
# Check if tag exists locally or on remote
if git rev-parse "$TAG" >/dev/null 2>&1; then
git checkout "$TAG" --quiet
echo "Checked out $TAG for $d"
else
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for d in repos/unikraft \ | ||
| repos/libs/musl \ | ||
| repos/libs/lwip \ | ||
| repos/libs/libcxx \ | ||
| repos/libs/libcxxabi \ | ||
| repos/libs/libunwind \ | ||
| repos/libs/compiler-rt \ | ||
| repos/libs/nginx \ | ||
| repos/libs/python3 \ | ||
| repos/libs/click \ | ||
| repos/libs/libelf \ | ||
| repos/apps/elfloader \ | ||
| repos/libs/redis \ | ||
| repos/libs/wamr \ | ||
| repos/libs/sqlite; do |
There was a problem hiding this comment.
This looks hard to maintain.
Isn't something like this possible?
for d in repos/libs/* repos/apps/* repos/unikraft
99a36a7 to
acc42ce
Compare
|
I applied the suggested changes to make it easier to maintain. Let me know if you have any other thoughts or if there is anything to improve! |
|
Looks good. Reviewed-by: Rares Goidescu known.as.rares@gmail.com |
StefanJum
left a comment
There was a problem hiding this comment.
See the inline comments. Besides that, make sure to be consistent with things like variables quoting etc. Paste the script in https://www.shellcheck.net/ to make sure of that.
acc42ce to
913b361
Compare
Add checkout-to-release script to sync subrepos to a release tag and falls back to the latest tag if a subrepo doesn't have the requested version. Signed-off-by: Andrei Radulescu <andrei.radulescu2703@gmail.com>
913b361 to
7a32f77
Compare
Add checkout-to-release script to sync subrepos to a release tag and falls back to the latest tag if a subrepo doesn't have the requested version.